我遵循了几份在线文档,但当我尝试打印存储在寄存器%ecx中的数字时,什么也没有发生。这可能是因为我正在执行计算,然后在循环中尝试打印吗?
mov $48, %ecx #Convert to ascii
mov $1, %edx #Print Byte
add %eax, %ecx
mov $4, %eax #Output To Console
mov $1, %ebx #File Descriptor - Standardout
int $0x80 #Call the Kernel
$
符号表示“立即数”,而不是十六进制。因此,$48
是正确的。当然,$'0'
更易读。 - Jester