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

32. Compare Strings

Jo Van Hoey1 
(1)
Hamme, Belgium
 

In the previous chapter, we used strings with implicit lengths, which means that these strings are terminated by a null byte. In this chapter, we will compare strings with implicit lengths and strings with explicit lengths.

Implicit Length

Instead of matching characters, we will look for characters that differ. Listing 32-1 shows the example code we will discuss.
; sse_string2_imp.asm
; compare strings implicit length
extern printf
section .data
       string1    db    "the quick brown fox jumps over the lazy"
                  db    " river",10,0
       string2    db    "the quick brown fox jumps ...

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.