delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/26/17:58:15

From: Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ASM help
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <mu8fls4jvsdvmtm8cchbr8vaoreafrlke6@4ax.com>
References: <39572abe AT news DOT server DOT worldonline DOT co DOT uk>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 47
X-Trace: +rqgtiaEKubhWM54SXvEzFGWKMkYvZj+KA/UiPtu1pfxFadRguOLc11C0DKv0EPIdyITDxaYrSFQ!+i8bieIX+4pUz8G4UrCuVE0cuHxZlgF53Kzdzf+y++i3mj7Wb8F39ZEC2nUkju86xCXO3Vlg7vhy!GCId
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Mon, 26 Jun 2000 18:44:53 GMT
Distribution: world
Date: Mon, 26 Jun 2000 18:44:53 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Mon, 26 Jun 2000 11:08:09 +0100, "Michael Stewart"
<mike AT reggin DOT freeserve DOT co DOT uk> wrote:

>I know practically nothing about ASM, so this error is annoying me somewhat.
>This bit of code is from the User Guide annd was written by Shawn
>Hargreaves.  Anyone know how to fix this error?
>
>void set_bank (int bank_number) {
>   if (cur_bank == bank_number) return;
>
>   asm (
>        " call *%0 "
>      :                             /* no outputs */
>
>      : "r" (pm_bank_switcher),     /* function pointer in any register */
>        "b" (0),                    /* set %ebx to zero */
>        "d" (bank_number)           /* bank number in %edx */
>
>      : "%eax",                     /* clobber list (we have no way of */
>        "%ebx",                     /* knowing which registers the VESA */
>        "%ecx",                     /* code is going to change, so we */
>        "%edx",                     /* have to assume the worst and list */
>        "%esi",                     /* them all here) */
>        "%edi"
>   );
>
>   cur_bank = bank_number;
>}
>
>Error: Invalid `asm' statement:
>Error: fixed or forbidden register 1 (dx) was spilled for class DREG.

Under newer versions of binutils, input registers can't be labeled as
clobbered.  I can see two options (asm gurus please help me on this):
 o save and restore all regs around the VESA call
 o mark clobbered input registers as dummy output registers

Look at newer versions of Allegro (3.12 or 3.9.x) to see how they
accomplish this.

-- 
Damian Yerrick
"I refuse to listen to those who refuse to listen to reason."
See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html

This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses.  http://www.mcafee.com/

- Raw text -


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