This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: Binutils 2.15.97 available
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Etienne Lorrain'" <etienne_lorrain at yahoo dot fr>,"'Nick Clifton'" <nickc at redhat dot com>
- Cc: <binutils at sources dot redhat dot com>,<drow at false dot org>
- Date: Mon, 25 Apr 2005 16:44:30 +0100
- Subject: RE: Binutils 2.15.97 available
----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....