This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Binutils 2.15.97 available


----Original Message----
>From: Dave Korn
>Sent: 25 April 2005 16:45

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

>>>   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?  

  BTW, whatever way you do it, I just noticed this bit that confused me:

> asm (
> "PS2_mouse_callback:                                                   
> \n" "       .extern _dataPS2                                             


> \n" "       movl    %eax,_dataPS2                                        
> \n" "       movl    16(%esp),%eax                                        
> \n" "       movl    %eax,_dataPS2 + 4                                    

  Shouldn't those be indirect references, if dataPS2 contains a pointer to
the MOUSE structure?  I.e. "movl %eax,[_dataPS2]" and "movl
%eax,4[_dataPS2]"?  The way you have it to start with reads to me as if
you're overwriting the value of the pointer variable and the next 4 bytes
after it.  I may just be misunderstanding AT+T syntax, though, I only speak
intel myself.....


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]