Hello,

__sbit is heavily used in the mcs51 include files of sdcc.
My understanding is that __sbit selects a specific bit from a
register. For example, __sbit at (0x83) P0_3 means P0_3 is bit 3 of
register 0x80.

With the following C source file:

#include <8051.h>
 main()
{
   P0_3 = 1; // set bit 3 of P0 to 1
   P0_5 = 0; // set bit 5 of P0 to 0
   return 0;
 }

 the generated asm file contains:
 ...
 _P0_3=0x0083
 _P0_5=0x0085
 ...
 setb _P0_3
 clr _P0_5
 ...

I don't think that the generated asm instructions do the expected
operation. I may probably miss something obvious.
I'm running sdcc mcs51 3.0.3 #6571.

Thanks
 Zafi.

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to