2
我想在Linux上使用程序集(x86)获取当前日期。我写了下面的程序:如何使用gettimeofday()获取当前日期
[BITS 32]
%assign SYS_GETTIMEOFDAY 78
[SECTION .text]
[GLOBAL _start]
_start:
;get the system date
mov dword eax, SYS_GETTIMEOFDAY
int byte 0x80
test eax, eax
js error
done:
convert
error:
whatever
我希望得到的EBX电视结构地址,这样我可以访问秒0(%EBX)和微秒4(%EBX),但是在调试代码后我得到$ ebx = 0x0。为什么?