gnupic: gpasm: res and equates and bitfields
Subject:
RE: gpasm: res and equates and bitfields
From:
"scx31114" ####@####.####
Date:
24 Mar 2004 16:01:36 +0000
Message-Id: <HV38HL$C502BC7860334C6A39FED1E736D4B871@libero.it>
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