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
Post a Comment