Using variable name instead of address
As variables can be moved though the program during development it is not always
convenient to specify an address. You can also use the name of the variable :
DIM W as WORD
Dim B as BYTE AT W OVERLAY
Now B is located at the same address as variable W.
For XRAM variables, you need additional hardware : an external RAM and address
decoder chip.
For ERAM variables, it is important to understand that these are not normal variables.
ERAM variables serve as a way to simple read and write the EEPROM memory. You
can use READEEPROM and WRITEEEPROM for that purpose too.
ERAM variables only can be assigned to SRAM variables, and ERAM variables can be
assigned to SRAM variables. You can not use an ERAM variable as you would use a
normal variable.
Dim b as byte, bx as ERAM byte
B= 1
Bx=b ' write to EEPROM
B=bx ' read from EEPROM
Lesezeichen