assembly - NASM - different behaviour depending on register -


i have string taken user, saved "variable" named num. now, load first character string register further processing. looked like

mov rax, [num] cmp rax, '5' je character_equal_five 

i got problems in later part started debugging 1 line , input "522314" figured out rax register's value 2000, while should five's ascii code. doing

xor rax, rax mov rax, [num] 

did not either. finaly done this

mov al, [num] 

and successful reliable results. question is: why happen? why can't use bigger register task?


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -