© Jo Van Hoey 2019
J. Van HoeyBeginning x64 Assembly Programminghttps://doi.org/10.1007/978-1-4842-5076-1_31

31. Search for a Character

Jo Van Hoey1 
(1)
Hamme, Belgium
 

In this chapter, we will start using the control byte to help us find a specific character in a string.

Determining the Length of a String

In the first example, we will determine the length of a string by looking for a terminating 0.

Listing 31-1 shows the code.
; sse_string_length.asm
extern printf
section .data
;template            0123456789abcdef0123456789abcdef0123456789abcd  e
;template            1234567890123456789012345678901234567890123456  7
      string1 db    "The quick brown fox jumps over the lazy river.",0
      fmt1 db       "This is our string: %s ",10,0
      fmt2 db       "Our ...

Get Beginning x64 Assembly Programming: From Novice to AVX Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.