1. Yes, the bit addressable range starts from 0x20 omwards , but each bit in
this range has an individual address 0 to 128
i.e setb 5 results in setting bit 20.5
setb 9 results in setting bit 21.1
clr 128 clears bit 2F.7 etc.
This is normal 8051 convention.
2. Have u noticed in the asm file that the bits are defined in an area
called BSEG (BIT)?
Each .ds 1 in this segment reserves one BIT in the space 20.0 to 2F.8 (Bit
addresses 0 to 128)
The .area XXX (BIT) does the trick.
Hope this helps.
----- Original Message -----
From: C. H. Close
Sent: Thursday, August 09, 2001 6:46 AM
Subject: [Sdcc-user] 8051 BIT Definitions
This is my first message to the list it's a simple query regarding bit
definitions on the 8051.
I compiled the Hi.c test program that is provided in the Borland Binary
port on the main site and had a look at the the linker output in the
various listing files. I noticed two things the first being that the bit
addressable area was being defined in the data area as 0x00H; this is
surley incorrect as the bit addressable area in the 8051 starts at 0x20h
with a default set-up such as this one would be overwriting register
Just out of interest I added some more bit declarations and
re-checked the linker output. Adding ten bits appeared to have added ten
bytes to the bit addressable segment. By my reckoning I should have used
less than two bytes of this space. Since the official bit addressable
area is only 16 bytes long this would mean that one would be limited to
a maximum of 16 BIT type declarations before the bit addressable space
was exhausted when in fact there are in actuality 128 bit addressable
locations. If anyone has a solution to this problem I would very much
like to hear from them.
Colin H Close
Sdcc-user mailing list