Keil Logo Arm Logo

A166 User's Guide

DEFR Assembler Statement

Arguments
symbol DEFR sfr-address <[>, attribute<]>
Description

The DEFR statement defines Special Function Register (SFR) symbols. The specified sfr-address must be an even constant value in the range 0FE00h-0FFDEh or 0F000h-0F1DEh (which is the SFR space of the C16x/ST10 and which may only be used if the MOD167 assembler directive was specified).

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

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.