|
|||||||||||
|
Technical Support On-Line Manuals A251 User's Guide |
A251 User's GuideDATAMemory locations in the memory class DATA can be addressed with both direct and indirect memory accesses. Special Function Registers (SFR) of the A251 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 A251 microcontrollers. Example for all 251 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
| ||||||||||
|
|||||||||||