home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug045.arc / LINKASM.DOC < prev    next >
Text File  |  1979-12-31  |  4KB  |  138 lines

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