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
|