【发布时间】:2011-05-26 17:41:36
【问题描述】:
GNU nano 2.2.4 File: argv.s
.section .text
.globl _start
_start:
movl %esp, %ebp
movl 8(%ebp),%ecx
movl $4,%edx
movl $1,%ebx
movl $4,%eax
int $0x80
movl $1,%eax
movl $0,%ebx
int $0x80
让我先说我(显然)是 asm 的新手,欢迎任何与该主题无关的随机一般性建议... 我的意思是简单地从 bash 终端读取 argv[1] 并将其打印出来。这是一个测试,以确保我真的知道如何接受论点。如果我输入一个整数,比如 2。程序会打印 2O。大写“o”,而不是零。为什么?
【问题讨论】:
-
实际上它打印的是 'OR' 而我只是注意到了 'R'