www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/21/08:51:29

From: Tom St Denis <stdenis AT compmore DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How I can get 32Bit code with gcc?
Date: Sun, 21 Jan 2001 13:31:28 GMT
Organization: Deja.com
Lines: 43
Message-ID: <94eobh$du3$1@nnrp1.deja.com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010121142614 DOT 16311B-100000 AT is>
NNTP-Posting-Host: 24.156.37.224
X-Article-Creation-Date: Sun Jan 21 13:31:28 2001 GMT
X-Http-User-Agent: Mozilla/5.0 (Windows 98; U) Opera 5.01 [en]
X-Http-Proxy: 1.1 x68.deja.com:80 (Squid/1.1.22) for client 24.156.37.224
X-MyDeja-Info: XMYDJUIDtomstdenis
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019