Hello Fredy,
The following assumes that MY_ZEROPAGE is appropriately defined within the Project.prm file -
#pragma DATA_SEG __SHORT_SEG MY_ZEROPAGE
byte dato;
#pragma DATA_SEG DEFAULT
Further to my previous post, you might consider use of the following macros that allow any bit to be manipulated. They should not be dependent on the variable location.
#define set_bit(bitnum,reg) ((reg) |= 1<<(bitnum))
#define clr_bit(bitnum,reg) ((reg) &= ~(1<<(bitnum)))
#define togl_bit(bitnum,reg) ((reg) ^= 1<<(bitnum))
To set bit-7 of dato, you would use the following line -
set_bit(7,dato);
Regards,
Mac
Message Edited by bigmac on
2008-02-06 01:26 PM