delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/28/17:55:07

From: "John S. Fine" <johnfine AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Mixing asm and C
Date: Wed, 28 Oct 1998 17:53:06 -0500
Lines: 34
Message-ID: <3637A052.18C5@erols.com>
References: <363247ad DOT 81580547 AT newshost DOT cc DOT utexas DOT edu> <363782F1 DOT 7EA4 AT erols DOT com>
Mime-Version: 1.0
X-Trace: nVmdEH49qjVF4RHXfg/Dbm8htLa3HLJF1T0ftPHMyu4=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 28 Oct 1998 22:53:51 GMT
X-Mailer: Mozilla 3.01 (Win95; U)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

John S. Fine wrote:
> 
> Jeramie Hicks wrote:

> > .model TINY
> > .386
> > .code
> > equalfive proc
> >         mov eax, 5
> >         ret
> > equalfive endp
> > end equalfive

>  Regardless, you first
> need to make the assembler generate 32-bit code rather than 16-bit
> code.  The cleanest way to do that is get rid of the ".model" and
> ".code" directives and write your own SEGMENT directive including
> "USE32" to make sure it is making 32-bit code.

  I forgot to mention that it is even easier if you switch assemblers.
NASM is free, it does only and exactly what you tell it to do.  All
you need is a segment directive with USE32 and it can produce a 32-bit
FLAT COM file with no linker and none of the confusing directives.

  In support of my assertion that ".model TINY" and Microsoft's
other "simplified" directives are more confusing, rather than
simpler, I have seen many people post code for which their primary
problem was misuse of those directives.  That is less common in
NASM, (though several people _have_ misused "BITS 32" in NASM
when they should have used "USE32").  BTW, sorry I drifted so far
off topic for djgpp.
-- 
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/

- Raw text -


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