Bit operation with ST9
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2003-07-22 3:58 AM
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 2:34 AM
Posted on May 17, 2011 at 11:34
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! AragornOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 2:34 AM
Posted on May 17, 2011 at 11:34
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.