delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/08/17:05:49

From: Dave Bird <dave AT xemu DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help needed to learn ASM
Date: Mon, 8 Mar 1999 18:45:40 +0000
Organization: very little
Message-ID: <B2EyosAUrB52EwbV@xemu.demon.co.uk>
References: <0LebGBAgcD42EwWu AT dunvegan1 DOT demon DOT co DOT uk>
<36e3787f DOT 7191289 AT 158 DOT 152 DOT 254 DOT 68> <aj2QMDADyb42EwQ0 AT dunvegan1 DOT demon DOT co DOT uk>
<36e2e0cd DOT 23664102 AT 158 DOT 152 DOT 254 DOT 68> <36e3ee80 DOT 57683257 AT newshost DOT cc DOT utexas DOT edu>
NNTP-Posting-Host: xemu.demon.co.uk
X-NNTP-Posting-Host: xemu.demon.co.uk:158.152.196.209
X-Trace: news.demon.co.uk 920930506 nnrp-02:16899 NO-IDENT xemu.demon.co.uk:158.152.196.209
X-Complaints-To: abuse AT demon DOT net
MIME-Version: 1.0
X-Newsreader: Turnpike (32) Version 4.01 <dQumtnY$x4rJ2u5tL5fS$n2vuP>
Lines: 34
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <36e3ee80 DOT 57683257 AT newshost DOT cc DOT utexas DOT edu>, Jeramie Hicks
<Jeramie DOT Hicks AT mail DOT utexas DOT edu> writes
>On Sun, 07 Mar 1999 20:26:22 GMT, krugman AT nospam DOT demon DOT co DOT uk (Kevin)
>wrote:
>
>>>What are the pro's and con's of using inline ASM over something like
>>>NASM?
>
>A single inline assembly statement will typically disable all
>compiler-based optimizations for the entire module in most C compilers

 (1) is this true for Borland C++ ?

 (2) if module == function, it is best to code pretty much a whole
 function in assembler anyway.

>(since a C compiler doesn't try to understand what you're doing with
>the inline asm). Is DJGPP this way too?

 No, it goes mad in the other direction.

 You must always tell it registers IN, OUT, and JUNKED, because every
 register you do not mention it assumes is still unchanged for 
 optimisation purposes.  This adds more book-keeping, but it
 works wonders for optimisation.

 It can also try inlining short functions which are assem,  and 
 (unless you mark the asm block "volatile") moving it out of loops!

-- 
   ^-^-^-@@-^-;-^   http://www.xemu.demon.co.uk/
        (..)__u     news:alt.smoking.mooses


- Raw text -


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