The R3 values 0x00, 0x01, 0xFE and 0xFF are already handled within the run-time library. Only the values 0x02 - 0xFE are passed to the XPTR access routines described above. The AX51 macro assembler provides the MBYTE operator that calculates the R3 value that needs to be passed to the XPTR access function. Below is an AX51 Assembler example for using XPTR access functions:
MOV R1,#LOW (variable) ; gives LSB address byte of variable
MOV R2,#HIGH (variable) ; gives MSB address byte of variable
MOV R3,#MBYTE (variable) ; gives memory type byte of variable
CALL ?C?CLDXPTR ; load BYTE variable into A
Copyright (c) Keil - An ARM Company. All rights reserved.
Ref : Keil Documentation
No comments:
Post a Comment