Nemesis77
Newbie level 3
- Joined
- Feb 20, 2009
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- South Africa
- Activity points
- 1,301
bit z charu c18
I want to define flags in my code. In assembler I used to do it as follows:
flags equ 0x020 ; Define variable
#define flag0 flags,0 ; Flag0
#define flag1 flags,1 ; Flag0
etc.
How would I do this in C18. i.e. I want to define a CHAR variable and I want to be able to set or clear each bit of the 8bit CHAR variable. C18 has some predefined for example... INTCONbits.GIE = 1; This statement sets only 1 bit in the INTCON register.
I want to define flags in my code. In assembler I used to do it as follows:
flags equ 0x020 ; Define variable
#define flag0 flags,0 ; Flag0
#define flag1 flags,1 ; Flag0
etc.
How would I do this in C18. i.e. I want to define a CHAR variable and I want to be able to set or clear each bit of the 8bit CHAR variable. C18 has some predefined for example... INTCONbits.GIE = 1; This statement sets only 1 bit in the INTCON register.