> gcc tijd2.s -o tijd2
>
> And this example gives a segfault. This segfault disappears when I
> erase the line with "movl %eax,currenttime". But I don't know why?
Converted to nasm and it seems to work.
global main
extern time
extern printf
section .text
main:
push dword 0 ; push zero on the stack
call time ; call time
add esp,4 ; clean stack of previous push
push eax ; push value from time onto stack
push dword .printdec ; form a string for printf
call printf
add esp,8 ; clean two previous push'es
ret
.printdec db "%d",10,0
--- ifmail-tx (i386 Linux)
---------------
* Origin: jvahn@short.circuit.com (1:346/15.1@fidonet)
|