Hello My problem is that i want to create a file that contains some subroutine and call these routines from an other files that contains the main program. So in the main file i write this lines
NbMod EQU 2 SRC EQU 1000H DST EQU 1100H PUBLIC NbMod PUBLIC SRC PUBLIC DST
in the other file i write
EXTRN Number(NbMod) EXTRN Number(SRC) EXTRN Number(DST) XSEG AT Source ; Error absolute expression required SRC_RAM: DS 16 * NbMod ; Error Relocatable expression XSEG AT DST ; Error absolute expression required DST_RAM: DS 16 * NbMod ; Error Relocatable expression
you can show the message error in the right of each line but when i do these lines
NbMod EQU 2 SRC EQU 1000H DST EQU 1100H
in the same file ( i mean the file that contains the subroutine) i haven't this problem i don't understand why since i declare the Public in the main and EXTRN in the subroutine files
Thank you
From the linker's perspective, I believe that your public symbol is treated as a relocatable item.
What you can do in an expression is limited when it comes to having a component of that expression which is relocatable.
The expression can have simple addition and subtraction but not multiplication of a relocatable item.
Refer to:
www.keil.com/.../a51_wp_simplerelocatable.htm