On Fri, Aug 24, 2001 at 01:01:39AM +0100, Steve Roome wrote:
> How exactly should functions work in assembly, afaict, the
> following C :
>
> void printasint(int p) { printf ("print this %d\n", (int)p);}
Why not just ask the compiler??
$ cc -S -O0 printasint.c
$ cat printasint.s
.file "foo.c"
.version "01.01"
gcc2_compiled.:
.section .rodata
.LC0:
.byte 0x70,0x72,0x69,0x6e,0x74,0x20,0x74,0x68,0x69,0x73
.byte 0x20,0x25,0x64,0xa,0x0
.text
.p2align 2,0x90
.globl printasint
.type printasint,@function
printasint:
pushl %ebp
movl %esp,%ebp
subl $8,%esp
addl $-8,%esp
movl 8(%ebp),%eax
pushl %eax
pushl $.LC0
call printf
addl $16,%esp
.L2:
leave
ret
.Lfe1:
.size printasint,.Lfe1-printasint
.ident "GCC: (c) 2.95.3 20010315 (release)"
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message
- function calls/rets in assembly Steve Roome
- RE: function calls/rets in assembly John Baldwin
- Re: function calls/rets in assembly David O'Brien
- Re: function calls/rets in assembly John Baldwin
- Re: function calls/rets in assembly Leo Bicknell
- Re: function calls/rets in assembly John Baldwin
- Re: function calls/rets in assembly Leo Bicknell
- Re: function calls/rets in assembly Dan Nelson
- Re: function calls/rets in assembly Matt Dillon
- Re: function calls/rets in assembly John Baldwin
- Re: function calls/rets in assembly Valentin Nechayev
- Re: function calls/rets in assembly Peter Pentchev
- Re: function calls/rets in assembly David O'Brien

