I'm really new to NASM and I'm trying to convert from string to number in NASM but I don't know if it works. The code compiles without a problem but it's always displaying the same result no matter the numbers
Can someone take a look to see if anything is wrong?
string_int:
xor rbx, rbx ; result saved here
xor rax, rax
xor rcx, rcx ; counter
_loop:
mov al, byte[rsi + rcx]
cmp al, 0xA
je done
inc rcx
sub al, 0x30
mov rax, 0xA
mul rbx
add rbx, rax
jmp _loop
done:
ret