Yes, it's possible the Sdcc is nice project, but the documentation is not strong.
I find the example, how to do this for the 8051, in a Maxim application notes. http://www.maxim-ic.com/app-notes/index.mvp/id/3477 Example: A file (byte) register addressable by bits. union { unsigned char a_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 } a_bit; } a; bit b; void main(void) { a.a_byte = 0x05; a.a_bit.bit6 = 1; b= 1; while(1); // program loop } Regards fro, Brazil. On 07/17/2010 07:37 PM, 谢继雷 wrote: >> unsigned char bdata a; >> sbit a0 = a^0; >> sbit a1 = a^1; >> sbit a2 = a^2; >> >> thus, allocate bit variable (a0, a1, a2) within the bit-addressable >> byte variable (a). >> >> Is this possible in SDCC? >> >> > Though I can use absolute address by __at(), but I'm wondering if the > compiler can allocate the appropriate bit addressable byte for me. > > Lenik > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Sdcc-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/sdcc-user > ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Sdcc-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sdcc-user
