This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Why is GCC using DI register?
- To: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Subject: RE: Why is GCC using DI register?
- From: Dan Aalberg <danialaa at conagramalt dot com>
- Date: Mon, 14 May 2001 16:04:22 -0700
Thank you all for your input. With bits here and there from you all, I
found that is was my damn dissassembler and not GCC.
... it has to be asked... Anyone know of a good 32-bit dissassembler for
Linux? :-)
> -----Original Message-----
> From: Dan Aalberg [SMTP:danialaa@conagramalt.com]
> Sent: Monday, May 14, 2001 12:34 PM
> To: 'gcc@gcc.gnu.org'
> Subject: Why is GCC using DI register?
>
> I am trying to get some very simple assembly code from the GCC compiler
> for
> some testing I am doing.
> For sake of this email, I will over simplify the code.
>
> Here is some simple C code I compile with GCC:
>
> int main(void)
> {
> int a;
> a=5;
> return (a);
> }
>
>
> when I compile it, I get this for the machine code (with my comments):
>
> push bp
> mov bp,sp ; normal
> sub (w) sp,+08 ;normal
> mov [di-04],0005 ; what the heck is this?
> add [bx+si],al ;where did BX and SI come into play?
> ;what are we adding?
> mov ax,[di-04] ;next 2 lines are stupid.
> mov [di-08],ax
> mov ax,[di-08]
> leave
> retn
>
> what is with BX, DI and SI? I am trying to compile to a flat, non
> specific
> system and was looking for more of this:
>
> push bp
> mov bp,sp ; normal
> mov [bp-4],0005
> mov ax, [bp-4]
>
> pop bp
> retn
>
>
> Am I missing a GCC command line switch (there are only 472 to choose from
> :-)
>
> Thanks in advance
>
> Dan
>