gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: RE: gpasm: res and equates and bitfields
From: scx31114
Date: Wed, 24 Mar 2004 17:00:57 +0100

bitfield0	res	1

 bit0	EQU	( (bitfield0<<3)+0)
 bit1	EQU	( (bitfield0<<3)+1)
 bit2	EQU	( (bitfield0<<3)+2)


The idea is that an array of named bits is created and aliased onto the 
byte reserved by the bitfield.


Now, if you write code to access the bits:

    bcf    bit0 >> 3,  bit0 & 7

one possible solution

bitfield0	res	1

#define  bit0	bitfield0,0
#define  bit1	bitfield0,1
#define  bit2	bitfield0,2

Now, if you write code to access the bits:

    bcf    bit0 




gnupic@linuxhacker.org