EXT - ksherlock/merlin-wiki GitHub Wiki

EXT - define a label external to the current REL module.

label  EXT
       EXT label [, label]*       ; Merlin 16 only

This defines the label in the label column as an external label. This means that references to this label within the source will assume the value for LABEL is an as-yet undefined address, presumably found in another module that will be ultimately linked with this source file. Any external label must be defined as an ENTry label in its own REL module, otherwise it will not be reconciled by the Linker since the label would not have been found in any of the other linked modules. The EXTernal and ENTry label concepts are what allows REL modules to communicate and use each other as subroutines, etc.

The value of the label is set to $8000 and will be resolved by the Linker. In the symbol table listing, the value of an external will be $8000 plus the external reference number ($00-$fe) and the symbol will be flagged with an X.

In Merlin 16, the EXT and ENT opcodes accept the following syntax:

       EXT LABEL1,LABEL2,LABEL3 

This makes it possible to declare absolute symbols as entries. Thus if LABEL1 was an equate instead of a location in the code, then it can still be used as an external by other modules. Thus it does not have to be equated in all the files using it. For example, if all three modules in a linked system used the labels HOME, COUT, and BELL, the first module could define these labels with the usual HOME EQU $FC58, etc. equates, and then use ENT HOME,COUT,BELL to make those equates available to the other modules being linked. This would avoid having to defined the labels in each of the other modules.

With this particular syntax, you must not use a label in the label column. That will cause the assembler to assume you are using the more usual syntax.

Compatibility

  • Operand support was added in Merlin 16