home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / cpm80 / lasm.txt < prev    next >
Text File  |  2020-01-01  |  5KB  |  150 lines

  1. *****************************************************************
  2. *                                                               *
  3. *  10/01/81                                                     *
  4. *                                                               *
  5. *  LASM is an update of LINKASM, with the minor change that     *
  6. *  it prints the name of each linked file before it is opened.  *
  7. *  This helps track progress, and helps find misspelled names.  *
  8. *                                                               *
  9. *                                         -Ward Christensen     *
  10. *                                                               *
  11. *****************************************************************
  12.  
  13. LINKASM.COM
  14. 01/07/80    by Ward Christensen
  15.  
  16. OVERVIEW:
  17.     LINKASM is based on CP/M assembler 1.0, and is
  18. compatible with 1.0, 1.3, and 1.4 assemblers.  (2.0? Dunno.)
  19.         ----------------
  20. LINKASM is a rewrite of CP/M 1.0 ASM.COM, incorporating:
  21.  
  22. *    A new pseudo-op code, LINK.
  23. *    Smaller .COM file size (6K vs 8K).
  24. *    Faster execution via larger ASM, HEX, and PRN buffers
  25. *    Corrections to properly handle lower case DB values.
  26. *    Prints the number of source lines read
  27. *    Produces a symbol table for use under SID
  28.  
  29.     The LINK pseudo-op allows a file to "chain" to the 
  30. next .ASM file, thereby allowing very large source files to
  31. be processed without having to PIP them together.
  32.  
  33. RESTRICTIONS:
  34.     All the linked .ASM files must be on the same disk.
  35.     Nested IFs are not handled (ASM.COM didn't either)
  36. Note that you can use IF to conditionally link to the next
  37. module:
  38.  
  39.     IF    CLOCK
  40.     LINK    CLOCKRTN
  41.     ENDIF
  42. ;
  43.     IF    NOT CLOCK
  44.     LINK    OTHERRTN
  45.     ENDIF
  46.  
  47.     For example, if CLOCK is true, then LINK CLOCKRTN
  48. (i.e. CLOCKRTN.ASM) will take place, and the assembler
  49. will never see the ENDIF.  This is not a problem as the
  50. next encountered IF will be handled properly.
  51.         ----------------
  52. USAGE:
  53.     LINKASM is totally compatible with ASM.COM, and
  54. you may therefore replace ASM.  Its performance will be
  55. slightly better than ASM.COM, and it takes less space on
  56. disk (6K vs 8K).
  57.     Execute it just like ASM.COM, i.e. 
  58.     
  59.     LINKASM name.p1p2p3
  60.  
  61. where:    p1 is the .ASM file disk (A, B, ...)
  62.     p2 is the .HEX file disk (A, B, ... or Z for none)
  63.     p3 is the .PRN file disk (A, B, ... or Z for none,
  64.         or X for the console)
  65.  
  66.     The default is the logged in disk for all 3.
  67.  
  68.     If you wish to write a symbol table file, follow
  69. the command line with the disk to be written to (A, B, ...)
  70. then a colon.  For example, to assemble FOO from the A:
  71. disk, put the .HEX on the A: disk, send the .SYM file to
  72. B:, and the listing to the console:
  73.  
  74.     LINKASM FOO.AAX B:
  75.  
  76.     To assemble it doing everything on the A: disk
  77. (assuming A: is the logged in disk):
  78.  
  79.     LINKASM FOO A:
  80.  
  81.     The ":" must be specified after the .SYM disk.  The 
  82. .SYM file is "partially" sorted, i.e. all Axxxx then all Bxxxx
  83. etc.  SID fully scans the symbol table anyway, so sorting
  84. it is not necessary, so I did this quick sort hack just to
  85. make it eaiser for YOU to find a symbol.
  86.         ----------------
  87.     The LINK pseudo ops take a single operand: the name
  88. of an .ASM file to be processed next.  For example:
  89. ----------------
  90. A:TEST1.ASM:
  91.  
  92.     ORG    100H
  93.     LXI    H,MSG
  94.     MVI    C,9
  95.     CALL    BDOS
  96.     RET
  97.     LINK    TEST2
  98. ----------------
  99. A:TEST2.ASM:
  100.  
  101. MSG    DB    'Linked'
  102. BDOS    EQU    5
  103. ----------------
  104.     Then assemble it:
  105.  
  106. A>LINKASM TEST1.AZX
  107. LINKASM AS OF 7/13/79
  108.  
  109.  
  110.  0100            ORG    100H
  111.  0100 210901        LXI     H,MSG
  112.  0103 0E09        MVI    C,9
  113.  0105 CD0500        CALL    BDOS
  114.  0108 C9        RET
  115.                         LINK    TEST2
  116.  0109 4C696E6B65MSG     DB    'Linked'
  117.  0005 =        BDOS    EQU    5
  118. 010F
  119. 000H use factor
  120. 8 input lines read
  121. End of assembly
  122.  
  123.         ----------------
  124.     I will make one apology for LINKASM - I neglected
  125. to put in an error message saying the name of the missing
  126. file, if you should accidentally LINK to a non-existant file. 
  127. It just says the source file is not present.
  128.     If necessary, you can find the name which was
  129. being searched for.  It's in memory at 186H.  If you have
  130. a PROM monitor, you can examine it.  If not, do the following
  131. BEFORE executing any more COM programs following the LINKASM:
  132.  
  133.     SAVE 1 BADNAME.COM    Save 100-1ff to disk     
  134.     DDT BADNAME.COM        Bring in under DDT (or SID)
  135.     D186,190        Dump the name
  136.     ^C            Reboot (some people use G0)
  137.     ERA BADNAME.COM        ERA the temporary file.
  138.  
  139. Sorry for that hack, but I thought it better to put LINKASM
  140. in the CP/M UG with that problem, rather than holding it
  141. back "trying to make it perfect".
  142.         ----------------
  143. I have not encountered any problems using LINKASM as my
  144. main assembler for about the last 6 months.  Among other
  145. things, I use it to assemble CBBS.ASM which, with its 14
  146. or so LINKed files, is over 6000 lines.  It takes about 5 1/2
  147. minutes, as I recall (HEX and SYM, no PRN).
  148.  
  149.                 Ward Christensen
  150.