On 25 Apr 2006 03:06:11 -0700, "timmu" <ti****@gmail.com> wrote:
If I have set a macro such like:
#define BIT(a) (1ULL << (a))
will something like
*(u64*)REGISTER1 |= BIT(53)
work if i wanna set bit[53] as 1 ?
Assuming you want little-endian bit numbering, u64 is a typedef for a
sufficiently large (presumably 64-bit) unsigned type, and REGISTER1 is
(or evalutes to) a pointer to something that is large enough and
correctly aligned to hold a u64, yes.
I'm running on MIPS which have several 64bit registers,
just don't know if the syntax will work.
If you mean processor registers, it is extremely rare to be able to
have a pointer to one of those. (There are some odd architectures
which do this, but MIPS is not one of them.) On modern compilers it's
rarely possible to assign a variable to a particular or known
register, or even to any register, but if you can and do for a
variable of type u64 then just x |= BIT(53).
- David.Thompson1 at worldnet.att.net