Mail Archives: djgpp/2000/06/26/17:58:15
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 -