Binutils 2.15.97 available

Dave Korn dave.korn@artimi.com
Mon Apr 25 15:45:00 GMT 2005


----Original Message----
>From: Etienne Lorrain
>Sent: 25 April 2005 16:04

>   Note that I can initialise the MOUSE structure to zero and I no more
>  have this assembler error - but I am not sure this behaviour of GAS
>  is the intended one.

> >   asm volatile (" dataPS2 = %c0 ": : "i" (&MOUSE.data.PS2));

  IIUIC, all you want to do here is initialise an assembler-level variable
with the address of MOUSE.data.PS2 at runtime, yes?  So why not make your
life a load easier, and do it the other way round:


void *dataPS2 = NULL;

unsigned MOUSE_PS2_init (void)
  {
  MOUSE.type = MOUSE_PS2;
  dataPS2 = &MOUSE.data.PS2;
  return 0;
  }

asm (
"PS2_mouse_callback:                                                    \n"
"       .extern _dataPS2                                                \n"
"       pushl   %ds                                                     \n"
"       pushl   %eax                                                    \n"
"       movw    %cs,%ax                                                 \n"
"       addw    $deltaseg,%ax   # not necessary if no CODE_SEGMENT      \n"
"       movw    %ax,%ds                                                 \n"
"       movl    12(%esp),%eax                                           \n"
"       movl    %eax,_dataPS2                                           \n"
"       movl    16(%esp),%eax                                           \n"
"       movl    %eax,_dataPS2 + 4                                       \n"
"       popl    %eax                                                    \n"
"       popl    %ds                                                     \n"
"       lretw                                                           \n"
        );


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....



More information about the Binutils mailing list