TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: JAN WAGEMAKERS
from: JAMES VAHN
date: 1997-12-17 21:40:00
subject: Re: leal

> 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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.