Keil Logo

A251: Declaring Extended Data and Bits


Information in this article applies to:

  • C251 Version 1.24
  • C251 Version 2.14

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

  • Refer to page 50 in the A251 Assembler User's Guide 07.98 for information on the SEGMENT directive.

SEE ALSO

Last Reviewed: Wednesday, September 21, 2016


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  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.