Linker.def 766 B

123456789101112131415161718192021
  1. DEFINITION MODULE Linker ;
  2. (* Linker and .COM writer.
  3. The compiler already emits a whole image - the runtime at offset 0, the
  4. program after it - so there is nothing to relocate. "Linking" means
  5. padding the file so the program's data area exists, and writing it as a
  6. DOS .COM, which loads at CS:0100. *)
  7. FROM SYSTEM IMPORT BYTE ;
  8. PROCEDURE LinkSize () : CARDINAL ;
  9. (* Size the .COM must be: the image padded out to cover the whole data area.
  10. Usually larger than Compiler.ImageBytes, because the data base is a fixed
  11. 4 KiB above the code. *)
  12. PROCEDURE WriteCom (path : ARRAY OF CHAR) : BOOLEAN ;
  13. (* Write the linked image to `path`. FALSE on failure, and the partial file
  14. is removed so it cannot be mistaken for a good one. *)
  15. END Linker.