SDCC does not support bdata. And by the way data memory 0x40 is
not bit addressable, 0x20 however is. But still not supported by SDCC.
SDCC does support reading a bit in a byte however when using shift
and/or mask operators. It will get the byte in the accumulator and
access the direct bit from there. It is all explained in the manual. You
must use SDCC 2.5.4 for this to work.
> Hi all,
> I would like to ask some questions about bdata and friends(aka idata
> and pdata).
> I am working for a small school project which is about 8051. this
> project is a small gadget car that move following a reflective
> surface. there are sensors on the gadget car that track the
> pre-defined route. those sensors are maximally 8 pairs , and those are
> Infraid-red pair. Those sensor pin is associated to one of 8051 port.
> I would like to read the sensor at once and put into some kind of bit
> arrays such bdata alike. expecially like memory address 0x40 which is
> bit addressable.
> I used to make the source compiled under keil C with bdata directive,
> the keil product was limited me to 2k rom size. so I make a change to
> sdcc now. BUT life is not that easy. I tested and change alot and
> finally found a problem that SDCC did not directly support bdata. A
> webpage said it can define the data section to 0x40h thus those
> address is bit addressible. The webpage is not very much detsail
> about this. and I only need one varaible like that and is enough. So I
> think this is a very unclear me.
> Well I would like to ask is that HOW can I do the reading from the
> sensor to a variable that is bit addressable?
> Sorry to say that I am not subscribe to the list, So if you have any
> suggestions please reply me by this mail address directly. Thank you
> very much for your attention.
> Best regards,
> George Chan
Maarten Brock schrieb:
> Hello George,
> SDCC does not support bdata. And by the way data memory 0x40 is
> not bit addressable, 0x20 however is. But still not supported by SDCC.
A while ago I did something that adds bit addressing for XOR
if the destination is known to be bit-addressable. (SFR like P0
or DATA declared with the at keyword in the bit addressable area)
Unfortunately I feel I currently cannot attribute much time to SDCC
so I'd be glad if someone could have a look over the code.
And ideally beef it up for bdata and commit it:)
Sorry for abusing this mailing list for a patch.
(George, this is not yet what you were asking for. The variable
would have to be declared with the "at" keyword which f.e. means the
linker doesn't check for overlaps)