We are using Cypress Microcontroller with Keil uVision 2 platforms. One of Cypress register OEB (address = 0xB2) non-bit addressable SFR registry. In our application we are planning to use as a bit addressable configuration. Is there easy way to do by using keil macros?
Registers that aren't bit-addressable requires you to directly (or through macros) use | & ^ and ~.
You can of course create macros SET_BIT(addr,bit), CLR_BIT(addr,bit), TST_BIT(addr,bit) if you want to.
Did tried to use | & ^ ~ operators, but code size is becoming big to access 10 of those kind of registries.
Is there any Keil defined (well tested) macros available?
Why would they be specific to Keil?
The only thing here that's specific to Keil is their language extension to exploit the 8051's bit addressability.
Where the object is not bit-addressable, it's back to plain, vanilla, standard ANSI 'C'.
Have you investigated Erik's suggestion of using a "shadow" variable that is bit addressable? That's certainly where I'd be looking...
View all questions in Keil forum