LINKER
------




CONVENTIONAL ASSEMBLERS PRODUCE LINKABLE CODE WHICH THEN NEEDS TO BE LINKED
BY A LINKER TO PRODUCE EXECUTABLE CODE,EVEN IF NO ADDITIONAL MODULES NEED TO
BE LINKED IN.



SEKA IS DIFFERENT. THE ASSEMBLER CAN PRODUCE EITHER EXECUTABLE CODE,OR
LINKER CODE,AND FOR SMALL PROGRAMS THERE IS NO NEED TO USE A LINKER. SINCE
THE ASSEMBLER WILL ACCEPT EITHER STANDARD 68000 SOURCE CODE OR LINKER
CODE,IT CAN ACT AS A LINKER,LINKING MODULES OF LINKABLE CODE (WHICH HAS BEEN
LOADED INTO THE LINK BUFFER),AND PRODUCING EXECUTABLE CODE.


A NOVEL "EXTRA" SEKA PROVIDES IS THE ABILITY TO LINK MODULES OF LINKABLE
CODE AND ASSEMBLE SOURCE AT THE SAME TIME,SO ENABLING ONE MODUL TO BE WORKED
UPON - AND SMALL CHANGES MADE - AND THE RESULTS OF TESTS TO BE SEEN VERY
RAPIDLY.



THE 'L' OPTION ON THE ASSEMBLER COMMAND CONTROLS THE OUTPUT:DEFAULT IS
EXECUTABLE,WITH L OPTION GIVES LINKABLE OUTPUT.
BY DEFAULT BOTH LINK INPUT AND SOURCE INPUT FILES ARE TAKEN BY THE
ASSEMBLER/LINKER,BUT WHEN L IS SPECIFIED,THE LINK INPUT FILE IS NOT INPUT
(SINCE LINK INPUT => LINK OUTPUT IS NOT ALLOWED)





ASSEMBLING WITH LINKABLE CODE
-----------------------------

USE THE A COMMAND,WITH L OPTION:




              -------------     ASSEMBLE        --------------------
LINK BUFFER  |SOURCE BUFFER|  ----------->     |CODE BUFF(LINK CODE)|
              -------------                     --------------------



NOTE THAT THE LINK BUFFER REMAINS UNUSED AND UNALTERED.






LINKING
-------
KILL THE SOURCE. USE THE A COMMAND WITHOUT L OPTION:





 ---------                      LINK       -------------------
|LINK BUFF|     SOURCE BUFF --------->    |CODE/DATA/CREL/DREL|
 ---------                                 -------------------

NOTE THAT THE SOURCE BUFFER MUST BE ZERO SIZE,UNLESS IT IS DESIRED TO
ASSEMBLE AS WELL AS LINKING.



ASSEMBLE & LINK
---------------
USE THE A COMMAND WITHOUT L OPTION:




 ---------       -----------    ASSEMBLE & LINK     -------------------
|LINK BUFF| AND |SOURCE BUFF|--------------------> |CODE/DATA/CREL/DREL|
 ---------       -----------                        -------------------





LINKER COMMANDS
---------------


CL-COPY OBJ TO LINK INPUT BUFFER
--------------------------------


USE THIS AFTER AN ASSEMBLE-OPTION L TO PLACE THE LINKABLE CODE IN THE LINK
INPUT BUFFER,READY FOR A LINK.PROMPTS "SURE?" BECAUSE IT DELETES THE SOURCE
BUFFER!! BEWARE!
CL,LIKE RL,APPENDS TO THE LINK INPUT BUFFER,(AS OPPOSITE TO OVERWRITING,SEE
KL).



KL-KILL LINKER BUFFER
---------------------


KILLS LINKER BUFFER. PROMPTS "SURE?".



RL & WL
-------


SEE FILING SECTION.WL CAN BE USED (INSTEAD OF CL,OR POSSIBLE IN ADDITION
TO),TO SAVE THE LINKABLE FILE ASSEMBLED INTO THE OBJ BUFFER.
RL CAN BE USED TO READ IN LINKABLE FILES-THESE ARE READ INTO THE LINK INPUT
BUFFER. NOTE:RL PROMPTS "SURE?" BECAUSE IT DELETES THE SOURCE! RL,LIKE
CL,APPENDS TO THE LINK INPUT BUFFER,(AS OPPOSITE TO OVERWRITING,SEE KL).



RELOCATION MODES-A CLARIFICATION
--------------------------------



ALL ARITHMETIC CAN CONTAIN EXTERNALS OR RELOCATABLES,PROVIDING THE RESULTAT
IS ABSOLUTE,RELOCATIBLE OR EXTERNAL,AND NOT COMPOSITE OF THESE(LIKE REL+REL
OR EXTERN-REL).

e.g    HERE:DC.L  THERE-HERE
       THERE:
IS VALID,AND THE RESULT IS ABSOLUT(A PURE NUMBER).

SIMILARLY BRA HERE DOES AN IMPLIED HERE-*(*IS THE CURRENT LOCATION
COUNTER,INITALLY CODE RELOCATABLE) AND IS OK IF HERE IS A LABLE TO THE SAME
REL SECTION OF THE PROGRAMM.

BUT:    BRA  EXTERN     WILL ATTEMPT TO CALCULATE EXTERN-*.
                        (EXT-REL),AND WILL FAIL WITH AN ERROR.
USE:    JMP  EXTERN

IN PRACTISE DON'T WORRY-UNTIL YOU GET A RELOCATION MODE ERROR.




END OF CHAPTER6

(C)1987 BY CAPTAIN CHAOS FROM THE CAPTAIN CREW

