This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem declaration

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

Parents
  • "is it not the case that EQU in assembler is equivalent to #define in 'C' - so it doesn't work with PUBLIC/EXTERN...?"

    No. With the original Intel A51 assembler (and Keil's modern equivalent), equates can be made public and can be accessed from other modules by extern.

    See my above comment with regards to relocatable expressions.

Reply
  • "is it not the case that EQU in assembler is equivalent to #define in 'C' - so it doesn't work with PUBLIC/EXTERN...?"

    No. With the original Intel A51 assembler (and Keil's modern equivalent), equates can be made public and can be accessed from other modules by extern.

    See my above comment with regards to relocatable expressions.

Children