Mail Archives: djgpp/2000/05/06/10:15:44
This is a multi-part message in MIME format.
------=_NextPart_000_0074_01BFB776.38830DC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Please help. I've used the following inline assembly code function in =
my
program using gpp 2.8.1 and all was well. I've just made a new =
installation
on a different PC using gpp 2.9.5.2 and get a compiler error. What have =
I
missed?
inline void set_vesa_bank_pm(int bank_number)
{
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"
);
}
Errors reported against 3rd line of code segment:
"Invalid 'asm' statement"
"fixed or forbidden register 1 (dx) was spilled for class DREG"
Is it an installation problem or a coding problem?
Thanks
Paul
------=_NextPart_000_0074_01BFB776.38830DC0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>Please help. I've used the following inline =
assembly=20
code function in my<BR>program using gpp 2.8.1 and all was well. =
I've just=20
made a new installation<BR>on a different PC using gpp 2.9.5.2 and get a =
compiler error. What have I<BR>missed?<BR><BR>inline void=20
set_vesa_bank_pm(int bank_number)<BR>{<BR> asm =
(<BR> "=20
call *%0 "<BR> =20
: =
&=
nbsp; =20
/* no outputs */<BR> : "r"=20
(pm_bank_switcher), /* function pointer in any =
register=20
*/<BR> "b"=20
(0), &nb=
sp; =20
/* set %ebx to zero */<BR> "d"=20
(bank_number) =
/*=20
bank number in %edx */<BR><BR> :=20
"%eax", =
=20
/* clobber list (we have no way of */<BR> =20
"%ebx", =
=20
/* knowing which registers the VESA */<BR> =20
"%ecx", =
=20
/* code is going to change, so we */<BR> =20
"%edx", =
=20
/* have to assume the worst and list */<BR> =20
"%esi", =
=20
/* them all here) */<BR> "%edi"<BR> =20
);<BR>}<BR><BR><BR>Errors reported against 3rd line of code =
segment:<BR>"Invalid=20
'asm' statement"<BR>"fixed or forbidden register 1 (dx) was spilled for =
class=20
DREG"<BR><BR>Is it an installation problem or a coding=20
problem?<BR><BR>Thanks<BR>Paul<BR><BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_0074_01BFB776.38830DC0--
- Raw text -