我想显示参数计数(argc)。我知道ESP寄存器指向argc,但无法将值传递给ECX注册表。我该怎么办?
EXIT = 1
READ = 3
WRITE = 4
STDOUT = 1
SYSCALL32 = 0x80
ERR_CODE = 0
.text
.global _start
_start:
mov $WRITE, %eax
mov $STDOUT, %ebx
mov %esp, %ecx
mov $1, %edx
int $SYSCALL32
ret
_exit:
mov $EXIT, %eax
mov $ERR_CODE, %ebx
int $SYSCALL32