Hello all. Trying to give a variable two different names. Right now, I have an array of variables declared thusly:
#DEFINE PARAMETER_BUFFER_SIZE 0X30 ;PARAMETER BUFFER SIZE #DEFINE PARAMETER1 0X00 #DEFINE PARAMETER2 0X01 #DEFINE PARAMETER3 0X02 ; ; and so on and so forth ; UDATA 0X100 PARAMETER_BUFFER RES PARAMETER_BUFFER_SIZE
Then I can access them in my program as
movwf PARAMETER_BUFFER+PARAMETER1, BANKED
However, this gets really annoying when trying to use the debugger watch window because address 0x100 shows the name PARAMETER_BUFFER and all addresses after that just show the address instead of a variable name. What I would like to do is be able to "redeclare" those same memory locations to be named something like
UDATA 0X100 fake_PARAMETER1 RES 1 fake_PARAMETER2 RES 1 fake_PARAMETER3 RES 1
but still leave it dynamically assigned. I've tried
UDATA 0X100 PARAMETER_BUFFER RES PARAMETER_BUFFER_SIZE UDATA 0X100 fake_PARAMETER1 RES 1
but I get the error "Each object file section must be contiguous (section .udata)". I've tried
#define fake_PARAMETER1_ADDR (PARAMETER_BUFFER+PARAMETER1) fake_PARAMETER1 equ fake_PARAMETER1_ADDR
but I get the error "Operand contains unresolvable labels or is too complex". Is there a way to do what I want without declaring every single variable's address statically?
-Will