2003-07-22 03:58 AM
2011-05-17 02:34 AM
Hello!
I'm working with ST92F150 and I need to operate with bits. Here is my structure (coming from an application for ST7 with Cosmic compiler): union bit_byte { unsigned char byte; struct { unsigned char bit0:1; unsigned char bit1:1; unsigned char bit2:1; unsigned char bit3:1; unsigned char bit4:1; unsigned char bit5:1; unsigned char bit6:1; unsigned char bit7:1; } bitdef; }; And I use it in this way: #define Bit0 bitdef.bit0 ... #define FLAG_abc AKEY1.Bit0 But when I call the instruction FLAG_abc = TRUE; in .lis file I don't see the bset assembly code, but only a byte operation (or dpr:pof(@FLAGSx),#1). How can I be more efficient? Thanks a lot! Aragorn2011-05-17 02:34 AM
In the ST9 instruction set the bit set is limited to the working registers (used for function parameters and frame pointer): have a look to the ST9 Programming Manual.
Your variable is either in RAM or in the Regiser File as General Purpose Register and there is no way to make a bit set.