Mail Archives: djgpp/2001/01/21/08:51:29
In article <Pine DOT SUN DOT 3 DOT 91 DOT 1010121142614 DOT 16311B-100000 AT is>,
djgpp AT delorie DOT com wrote:
>
> On Sun, 21 Jan 2001, Christian Merz wrote:
>
> > I have following problem with gcc. If I compile and link, for example the
> > following code with "gcc -c main.c -o
> > main.o -nostdlib -fno-builtin -nostartfiles -Di586" and "ld -o
> > main.com -oformat binary -T startup\link.scr startup\c1.o main.o" (c1.o is
> > my on startup code).
> >
> > /*main.c*/
> > int main() {
> > for(;;);
> > return 0;
> > }
> >
> > i'll get somthing like that, if I take a look with the dos debug.exe:
> >
> > 0x100: pusb bp
> > 0x101: mov bp,sp
> > 0x103: nop
> > 0x104: jmp 0x104
> > 0x106: mov si,si
> > 0x109: xor ax,ax
> > 0x10c: jmp 0x10f
> > 0x10f: leave
> > 0x110: ret
>
> What does "objdump --disassemble main.o" produce? Does it show 32-bit
> code or 16-bit code?
>
> (DOS's DEBUG is not a reliable tool to look at anything except code
> produced by real-mode DOS compilers.)
DJGPP assumes it is a 32-bit segment and won't emit prefixes to force it.
DEBUG doesn't know this so it assumes the code is 16-bit.
Tom
Sent via Deja.com
http://www.deja.com/
- Raw text -