Keil Logo


Memory locations in the memory class DATA can be addressed with both direct and indirect memory accesses. Special Function Registers (SFR) of the A51 have addresses above 0x80 in the DATA memory class. SFR locations can only be addressed with direct memory accesses. An indirect memory access to SFRs is not supported in the A51 microcontrollers.

Example for all 8051 variants
?DT?myvar  SEGMENT DATA         ; define a SEGMENT of class DATA
           RSEG    ?DT?myvar
VALUE:     DS      1            ; reserve 1 BYTE in DATA space

IO_PORT2   DATA    0A0H         ; special function register
VALUE2     DATA    20H          ; absolute memory location

?PR?myprog SEGMENT CODE         ; define a segment for program code
           RSEG    ?PR?myprog
           MOV     A,IO_PORT2   ; direct memory access to DATA
           ADD     A,VALUE
           MOV     VALUE2,A
           MOV     R1,#VALUE    ; load address of VALUE to R1
           ADD     A,@R1        ; indirect memory access to VALUE
  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.