Keil™, An ARM® Company

Technical Support

A51: ADDRESSING BITS AND BYTES


Information in this article applies to:

  • A51 Version 5.50

QUESTION

How do I address a bit-addressable byte as both bits and a byte in assembly?

ANSWER

Here is the code that shows the code for addressing bit addressable internal memory as bits and bytes

NAME    TEST

?PR?main?TEST        SEGMENT CODE
?BA?TEST             SEGMENT DATA BITADDRESSABLE
        EXTRN   CODE (?C_STARTUP)
        PUBLIC  bit0
        PUBLIC  byte
        PUBLIC  main

        RSEG  ?BA?TEST
           byte:   DS   1
bit0    EQU     (byte+0).0

        RSEG  ?PR?main?TEST
        USING   0
main:
        SETB    bit0
?C0001:
        SJMP    ?C0001
        RET

        END

MORE INFORMATION

To add other bits just duplicate the EQU to represent the remaining locations.

SEE ALSO

Last Reviewed: Saturday, March 31, 2001


Did this article provide the answer you needed?
 
Yes
No
Not Sure