TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: ALL
from: JAN WAGEMAKERS
date: 1997-11-22 15:17:00
subject: leal

Hi All,
I have asked in Cprog.B a question about how it is possible with the
C-programming-language to get the current time. I have get there a really
useful answer and even have learned some things about C :-)
Now, with gcc -S I have converted this C-program to asm-source. I'll post
here a piece of it because to me it looks a little-bit strange and I don't
understand what "leal -4(%ebp),%eax" exactly do.
/* (A piece of TIJD.S)
main:
        pushl %ebp
        movl %esp,%ebp
        subl $8,%esp
        leal -4(%ebp),%eax
        pushl %eax
        call time
        addl $4,%esp
        leal -4(%ebp),%eax
        pushl %eax
        call localtime
        addl $4,%esp
*/
So, maybe some-one can help me to understand this piece of code?
I hope that when I understand how it works that I can create a macro that
makes it easy to get the current time in a Linux-Assembly program. Who
knows... maybe it is possible together with my ncurses-macro's to make a
bautifull analog clock ;-)
Have a nice day.                       - Jan Wagemakers - 
 
o_o   :-)  The magic of a smile. 
--- Terminate 5.00/Pro /Linux.DosEmu.JanW-DOS(PTS)
2:292/854.19)
---------------
* Origin: - Belgi‰/Belgium - Internet : JanW@mail.dma.be

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™.