asm constraints

Chris Johns ccj@acm.org
Fri Oct 9 20:33:00 GMT 1998


Art Berggreen wrote:
> 
> According to my m68k data books, move.b from an address register is
> not allowed.  The g constraint is allowing the compiler to place data
> in an address resgister which is not compatible with your chosen
> instruction.  

Not important, see below.

> Why use the asm() macro?  Why not just cast the address
> to (unsigned char *) and do the store from C++?  The compiler might
> be able to generate a move.b #data,addr.
> 

I am not sure if you are asking why use the asm statement or why use a
maco. IMO the marco is good practice. We can control the type of access
we use for devices in one place. In the dim dark past of this code I
think a compiler (not gcc) removed some accesses even if volatile was
used. It has also been used to perform device simulation in software.

For the asm statement usage I have gone and run a test using egcs-1.1b
and like what I see. I will change the macros to use cast pointers.
Thanks for asking and making me go and look.

-- 
 Chris Johns  Networks, Plessey Asia Pacfic Pty. Ltd.
  mailto:ccj@acm.org    mailto:cjohns@plessey.com.au
________________________________________________
To get help for the crossgcc list, send mail to
crossgcc-request@cygnus.com with the text 'help'
(without the quotes) in the body of the message.



More information about the crossgcc mailing list