gcc -S test.c -o test ??

P

Paminu

The option -S produces the corresponding assembly code for a .c file in the
file specified after -o. But where can I get a lsit of what the different
expresssions mean?

I have this example:


cat test
.file "mips.c"
.text
..globl sub
.type sub, @function
sub:
pushl %ebp
movl %esp, %ebp
movl 12(%ebp), %edx
movl 8(%ebp), %eax
subl %edx, %eax
popl %ebp
ret
.size sub, .-sub
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.3.5 (Debian 1:3.3.5-8ubuntu2)"

I could be nice to get some information on what %ebp means.
 
W

Walter Roberson

The option -S produces the corresponding assembly code for a .c file in the
file specified after -o. But where can I get a lsit of what the different
expresssions mean?

Anything having to do with gcc specifically, or to do with assembly
language, is platform specific, and should be referred to an
appropriate newsgroup.


[OT]

I have this example:
pushl %ebp
movl %esp, %ebp
movl 12(%ebp), %edx
movl 8(%ebp), %eax
subl %edx, %eax
popl %ebp
I could be nice to get some information on what %ebp means.

http://c.ittoolbox.com/documents/popular-q-and-a/3062
http://ocw.mit.edu/OcwWeb/Electrica...s/detail/pc_hardware_and_x86_-programming.htm
 
G

Gordon Burditt

The option -S produces the corresponding assembly code for a .c file in the
file specified after -o. But where can I get a lsit of what the different
expresssions mean?

If you don't know assembly language, getting assembly code is of
questionable value.
I could be nice to get some information on what %ebp means.

It's a machine register for a particular CPU. If you don't know
about the architecture of the machine you're getting assembly code
for, you're going to have trouble making any sense out of it.

Gordon L. Burditt
 
E

emanshu, Munish Nayyar

well, these are the CPU registers, you can refer 8086 CPU documentation
for more details.
and
%ebp is extended base pointer,
%esp is extended stack pointer
%edx,%eax, these are register sets of CPU.
movl,subl,popl these are the machine instruction specific particular
CPU machine.
in you code sub: is a SYMBOL or althernative in more easier we may call
this as a function also.
Infact,in your high level code sub is one function/routine but in
Assemble code this is name as a routine or mostly SYMBOL.

rgrds,
Munish Nayyar
emanshu "Innovative MInd"
http://www.sarovar.org/projects/rtda
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top