ARM Technical Support Knowledge Articles

ADDRESSING BITS AND BYTES

Applies to: A51 Macro Assembler

Answer


Information in this article applies to:


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

Article last edited on: 2001-03-31 00:00:00

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential