ARM Technical Support Knowledge Articles

DECLARING EXTENDED DATA AND BITS

Applies to: A251 Macro Assembler

Answer


Information in this article applies to:


QUESTION

How do I declare variables in the 80251 extended data, edata, and extended bit areas?

ANSWER

The following two program examples demonstrate how to declare these variable types.

edVAR1  EQU     EDATA   200h    ; edata VAR1
ebVAR3  EQU     EBIT    40H.0   ; ebit VAR3

dVAR0   DATA    01H             ; data VAR0
bVAR2   BIT     20H.0           ; bit VAR2

ORG     0000H                   ; RESET VECTOR
        LJMP    START

ORG     100H
START:
        MOV     R11,#0          ; ACC=0
        MOV     dVAR0,R11       ; move to data
        MOV     edVAR1,R11      ; move to edata
        CLR     C               ;
        MOV     bVAR2,C         ; move to bit
        MOV     ebVAR3,C        ; move to bit

        SJMP    $               ; and die here
END

The following example is a more structured example that shows how to declare variables to be compatible with the C251 C Compiler.

; Declare the segment, select the segment, and
; reserve space for each variable.  Note that
; the name of the segment (XX?TEST) is compatible
; with segments from the C251 compiler.

?ED?TEST SEGMENT EDATA
RSEG     ?ED?TEST
edata_var:      DS 1

?DT?TEST SEGMENT DATA
RSEG     ?DT?TEST
data_var:       DS 1

?EB?TEST SEGMENT EBIT
RSEG     ?EB?TEST
ebit_var:       DBIT 1

?BI?TEST SEGMENT BIT
RSEG     ?BI?TEST
bit_var:        DBIT 1


CSEG    AT      0000h
        LJMP    START

CSEG    AT      0100h

START:  MOV     R11, #0         ; ACC = 0
        CLR     C               ; CARRY = 0

        MOV     data_var, R11   ; write to data

        MOV     edata_var, R11  ; write to edata

        MOV     bit_var, C      ; write to bit

        MOV     ebit_var, C     ; write to ebit


        SJMP    $               ; loop forever

END

MORE INFORMATION

SEE ALSO

Article last edited on: 2005-06-12 11:52:45

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential