我正在尝试编写一段代码来显示 txt 文件的内容。我只有数字存储在新文件中,每行一个数字 (%d \n)。目前代码如下所示:
movl $0 , 320(%ebp)
#a pre reserved location on the stack for the first number that needs to be cleared first
leal 320(%ebp), %eax #a pre-chosen location for the memory
push %eax
push $dataformat # . asciz "%d \n"
push %ebx #the result from the fopen is stored in ebx
call _fscanf
push 320(%ebp)
push %dataformat
call _printf
但是,除非我将 movl $0 更改为其他内容,否则结果仍然为 0。