I'm using this macro to define strings.
.MACRO _m_dbStr ; Param: VarNameAdr, VarNameLen, Data
str_start:
.db @2,0x00 ; terminating NULL char
str_end:
.equ @0 = ((str_start)<<1) ; Adr
.equ @1 = 2*((str_end)-(str_start)) ; Len
.ENDMACRO
It is used this way:
m_dbStr ADR_STR_RESET, LEN_STR_RESET, "Reset"
m_dbStr ADR_STR_STEP1, LEN_STR_STEP1, "Step1"
m_dbStr ADR_STR_STEP2, LEN_STR_STEP2, "Step3"
This work fine. No errors from AVRA and the strings are
printed correctly - which is actually quite strange
because according to the docs multiple labels will
exist with the same name. Well, so I though about
adding "_%" to the labels:
.MACRO _m_dbStr ; Param: VarNameAdr, VarNameLen, Data
str_start_%:
.db @2,0x00 ; terminating NULL char
str_end_%:
.equ @0 = ((str_start_%)<<1) ; Adr
.equ @1 = 2*((str_end_%)-(str_start_%)) ; Len
.ENDMACRO
Now AVRA complains about "((str_start_%)<<1)" beeing
invalid. As a workaround, I'm using "_@0" now, which
also works fine and the *.lst file look ok.
.MACRO _m_dbStr ; Param: VarNameAdr, VarNameLen
str_start_@0:
.db @2,0x00 ; terminating NULL char
str_end_@0:
.equ @0 = ((str_start_@0)<<1) ; Adr
.equ @1 = 2*((str_end_@0)-(str_start_@0)) ; Len
.ENDMACRO
Question is, if the "_%"-Version is supposed to work?
Logged In: YES
user_id=726755
Hi,
1.1 is the Beta version ov avra under development. I
couldn't manage to remove this bug so far due to the lack of
time. If someone would provide a patch for this issue, I
would add it immediatley to a new version.
Tobias