Keil Logo Arm Logo

A166 User's Guide

DEFA Assembler Statement

Arguments
symbol DEFA RAM-address <[>, attribute<]>
Description

The DEFA statement defines on-chip RAM symbols. The specified RAM-address must be even constant value in the range 0FA00h-0FDFEh. This address range specifies the internal data RAM area of the C16x/ST10.

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

DEFB, 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

Keil logo

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.