【发布时间】:2019-09-11 22:22:48
【问题描述】:
我正在尝试从程序集中调用fputs(str, stdout);。
我为什么要push dword [stdout] 而不仅仅是push stdout?
既然在 C 中我们不做 fputs(str, *stdout),为什么我们需要在汇编中取消引用 stdout?
完整代码:
extern fputs
extern stdout
section .data
hw: db "Hello World!", 10, 0
section .text
global main
main:
enter 0,0
push dword [stdout]
;push stdout
push hw
call fputs
leave
mov eax, 0
ret
【问题讨论】:
标签: assembly x86 nasm calling-convention fputs