我尝试将两个大整数相加,但是输出以ASCII格式显示,如何打印整数值?
这是主要代码:
section .bss
res: resq 8
sum:
mov rax,rdi
add rax,rsi
add rax,'0'
ret
_start: ;tells linker entry point
mov rdi,'100'
mov rsi,'102'
call sum
mov [res],rax
mov rdx,3 ;message length
mov rsi,res ;message to write
mov rdi,1 ;file descriptor (stdout)
mov rax,1 ;system call number (sys_write)
syscall
mov rax,60 ;system call number (sys_exit)
syscall
输出: �`