Keil™, An ARM® Company

Technical Support

A51: DECLARING BITS IN THE SAME BYTE


Information in this article applies to:

  • C51 Version 5.50a
  • C51 Version 6.01

QUESTION

How can I declare some bits in assembly that are guaranteed to be stored in the same byte in the DATA space from 0x20 to 0x2F?

ANSWER

The following program code does what you want. You may change the address of the BIT_BYTE to select a different address for the byte.

DSEG    AT      20h

BIT_BYTE:       DS      1

BIT_NO_0        BIT     BIT_BYTE.0
BIT_NO_1        BIT     BIT_BYTE.1
BIT_NO_2        BIT     BIT_BYTE.2
BIT_NO_3        BIT     BIT_BYTE.3
BIT_NO_4        BIT     BIT_BYTE.4

END

Last Reviewed: Wednesday, May 17, 2000


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