Keil Logo

BIT Assembler Statement

Arguments
symbol BIT address
Description

The BIT statement assigns an address to the specified symbol. The symbol may not be redefined.

In addition, the BIT statement may create a bit name for the following bit-addressable items:

  • Absolute addresses from 0FD20h-0FDFEh. For example, 0FD10h.7.
  • System Bits. For example, DP3.13, P2.15, and PSW.1. This creates an absolute bit because SFR names (system names) are absolute.
  • Bits based on words contained in bit-addressable data sections. This results in relocatable bits if the bit-addressable data section is relocatable.

Note

  • The BIT statement is provided for compatibility with assemblers from other development tool vendors. The DEFB statement is the preferred way to define bit symbols in the Keil tools.
Example
DATA_SEG        SEGMENT DATA BITADDRESSABLE

RSEG            DATA_SEG              ; Relocatable
                                      ; bit-addressable
                                      ; segment

BITS:           DS      1             ; A 1-byte
                                      ; bit-addressable
                                      ; variable

ALARM           BIT     BITS.0        ; Bit 0 in BITS
D1_OPEN         BIT     ALARM+1       ; Bit 1 in BITS
D2_OPEN         BIT     ALARM+2       ; Bit 2 in BITS

P1_2            BIT     90h.2         ; SFR P1.2
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.