Message-ID: <007f01bfb76e$0020d320$2f5293c3@pkcrone> From: "Paul Crone" To: Subject: inline asm problem Date: Sat, 6 May 2000 16:14:57 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0074_01BFB776.38830DC0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Reply-To: djgpp AT delorie DOT com 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
Please help.  I've used the following inline = assembly=20 code function in my
program using gpp 2.8.1 and all was well.  = I've just=20 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=20 set_vesa_bank_pm(int bank_number)
{
   asm = (
   "=20 call *%0 "
   =20 :            =             &= nbsp;   =20 /* no outputs */
    : "r"=20 (pm_bank_switcher),     /* function pointer in any = register=20 */
   "b"=20 (0),           &nb= sp;       =20 /* set %ebx to zero */
   "d"=20 (bank_number)          = /*=20 bank number in %edx */

    :=20 "%eax",           =          =20 /* clobber list (we have no way of */
  =20 "%ebx",           =          =20 /* knowing which registers the VESA */
  =20 "%ecx",           =          =20 /* code is going to change, so we */
  =20 "%edx",           =          =20 /* have to assume the worst and list */
  =20 "%esi",           =          =20 /* them all here) */
   "%edi"
  =20 );
}


Errors reported against 3rd line of code = segment:
"Invalid=20 'asm' statement"
"fixed or forbidden register 1 (dx) was spilled for = class=20 DREG"

Is it an installation problem or a coding=20 problem?

Thanks
Paul

------=_NextPart_000_0074_01BFB776.38830DC0--