[Top] [All Lists]

Re: M700 partition problem

Subject: Re: M700 partition problem
From: Systemkennung Linux <>
Date: Thu, 18 Apr 1996 21:29:39 +0200 (MET DST)
In-reply-to: <> from "Per Fogelstrom" at Apr 18, 96 07:03:37 pm

> Ok!
> #define ldunaligned(x) \  
>         ({ int __result; \
>         __asm__("lwr    %0,0(%1);lwl    %0,3(%1)" \
>                 : "&=r" (__result) : "r" (x)); __result; })
>       int nn = ldunaligned(*arbitrary address*);
> You have to swap "lwr" and "lwl" if you run in big endian mode.
> And the order too perhaps, if the last one ends up as a nop if "x" is
> aligned.

You can also use the macro instructions uld, ulw, ulh, ulhu, usd, usw, ush,
ushu provided by the assembler.  That way you won't have to worry about byte
order.  Btw - GAS generates bad code for these under some circumstances.


<Prev in Thread] Current Thread [Next in Thread>