我必须在汇编中编写一个简短的程序,但我的版本不起作用。它应该打印 ASCII 字符,然后通过 atoi 函数将其更改为整数值并打印出该值。重要的是使用 C 中的程序:puts() 和 atoi()。
我做错了什么?请尽可能清楚地为我解释。我正在使用 gcc,并且正在使用 intel_syntax 程序集编写代码。
这是我的代码:
.intel_syntax noprefix
.text
.globl main
main:
mov eax, offset msg
push eax
call puts
pop eax
push eax
call atoi
pop eax
push eax
call puts
pop eax
.data
msg:
.asciz "a"
先感谢您