Keil Logo Arm Logo

A166 User's Guide

DEFB Assembler Statement

Arguments
symbol DEFB bit-address <[>, attribute<]>
Description

The DEFB statement defines bit symbols. The specified bit-address must be specified in the base.bitpos format where base is a bit-addressable word and bitpos is a constant number representing the bit position (0-15). You must ensure that the the base address is bit-addressable (not all SFR addresses are).

The optional attribute may be one of the following:

attribute Description
R Read-Only Accesses Allowed.
RW Read-Write Accesses Allowed (this is the default).
W Write-Only Accesses Allowed.
See Also

DEFA, DEFR

Example
LOC  OBJ                LINE     SOURCE
                        1     CONFIG  DEFR    0FF0CH,RW ; SysCon SFR
                        2     ZREG    DEFR    0FF1CH,R  ; Zeroes SFR, read-only
                        3     XFA00   DEFA    0FA00H    ; RAM address 0FFA0H
                        4     P0P1    DEFB    0FF00H.1  ; Bit, Port0.1
                        5     BZ0     DEFB    ZREG.0    ; Bit, Zeroes.0
                        6     ODDREG  DEFR    0FF1DH    ; ERROR: odd address
*** __________________________________________^
*** ERROR #101, LINE #6, INVALID SYSTEM ADDRESS
                        7     XBIT    DEFB    CONFIG.3
                        8     P0P2    BIT     P0.2
                        9             END

SYMBOL TABLE LISTING
------ ----- -------

N A M E             TYPE   VALUE  I  ATTRIBUTES

BZ0. . . . . . . .  BIT    8EH.0  A
CONFIG . . . . . .  WORD   FF0CH  A  SFR
ODDREG . . . . . .  WORD   FE00H  A  SFR
P0 . . . . . . . .  WORD   FF00H  A  SFR
P0P1 . . . . . . .  BIT    80H.1  A
P0P2 . . . . . . .  BIT    80H.2  A
XBIT . . . . . . .  BIT    86H.3  A
XFA00. . . . . . .  WORD   FA00H  A
ZREG . . . . . . .  WORD   FF1CH  A  SFR

arm-logo-small

Keil logo
Important information

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