On Mon, Feb 1, 2010 at 3:06 PM, Sébastien Lorquet <squa...@gmail.com> wrote:

> hi,
> what about:
>
> __sbit__ at (0xD7) CY;
>
> ?
>
>
That will be OK. But it's not convenient. It is convenient to write PSW +1,
+2, +3... etc.

Also, in compiler.h, you have:

#if defined SDCC
# define SBIT(name, addr, bit)  __sbit  __at(addr+bit)
 name

which would be the same with mine previous code.

On Sun, Jan 31, 2010 at 10:16 AM, Grissiom <chaos.pro...@gmail.com> wrote:
>
>> Hello all,
>>
>> I want to define a sbit in a sfr. Here is the code, which is for a 8051:
>>
>> __sfr __at (0xD0) PSW;
>> __sbit __at (PSW + 7) CY;
>> ...
>>
>> But sdcc(20100130-5661) complains:
>>
>> error 2: Initializer element is not constant
>>
>> So how to define a sbit in sfr easily?
>>
>> Thanks in advance.
>>
>



>
>>
> --
Cheers,
Grissiom
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to