home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / CCP / EZALIAS3.LBR / EZ10.AZM / EZ10.ASM
Assembly Source File  |  2000-06-30  |  8KB  |  235 lines

  1.  
  2. ;---------------------------------------------------------------------
  3. ;
  4. ;    TITLE:
  5. ;    EZ.ASM (EASY)    version 1.00 as of 08/16/83
  6. ;
  7. ;    AUTHOR:
  8. ;    Robert C. Kuhman
  9. ;    Sysop of the "Cro'sNest" RCP/M - RBBS.
  10. ;
  11. ;    COPYRIGHT STATUS:
  12. ;    Copyright (c)1983 by the author, all rights reserved.
  13. ;    Released to the PUBLIC DOMAIN for non-profit use only.
  14. ;
  15. ;    DESCRIPTION:
  16. ;    This program  uses the  CP/M  autoload  feature to rapidly
  17. ;    execute any "COM" program through the use of "abbreviated"
  18. ;    command  files  which cause autoloading of those programs,
  19. ;    plus execution of any pre-selected options. ("EZ" has been
  20. ;    designed to execute "COM's" that are used frequently,  and
  21. ;    which require lengthy strings of options and intructions.)
  22. ;
  23. ;
  24. ;    EXAMPLES:
  25. ;    1)    Assemble EZ.ASM, then rename it to "D.COM"  for use
  26. ;        instead of one of these  much  longer  commands,...
  27. ;
  28. ;        a) A0>DIR *.* $U0AD    (SD-XX.COM Super Directory program)
  29. ;        b) A0>DIR D:*.AQM $A (Search drive D for all AQM files)
  30. ;        c) A0>DIR B:EZ.ASM $A            (Search for this file)
  31. ;
  32. ;    2)    How about using EWF.COM (ED Work File) instead  of:
  33. ;
  34. ;        a) A0>ED B:WF.ASM          (Load work file for editing)
  35. ;        b) A0>ED FILE.TXT                 (Edit any other file)
  36. ;
  37. ;    3)    Perhaps,... TYPGR.COM  to type  a  group  of files:
  38. ;
  39. ;        a) A0>TYPE THIS.ASM THAT.HLP OTHER.TXT    (TYPE-17.COM)
  40. ;        b) A0>TYPE THIS.AQM THAT.HQP OTHER.TQT (SQUEEZED FILES)
  41. ;
  42. ;    4)    Even  simplify use of MAC to assemble this  program
  43. ;        with: MACWF.COM                  (MAC Working File)
  44. ;
  45. ;           a) A0>MAC B:WF $PZSZ        (MAC assemble Working File)
  46. ;        b) A0>ASM B:EZ.BBX          (ASM assemble this EZ file)
  47. ;
  48. ;    and...  LDWF.COM                        (Load Working File)
  49. ;
  50. ;        a) A0>LOAD B:WF                 (Working File)    
  51. ;        b) A0>LOAD B:EZ                       (EZ)
  52. ;
  53. ;         etc.
  54. ;
  55. ;    USAGE:
  56. ;    EZ.COM (renamed to suit the requirement) will allow 
  57. ;    the  user  to  greatly  abbreviate his command line
  58. ;    inputs  by  setting  up  one or more "EZ" programs.
  59. ;    Once renamed (something like "D.COM" for instance),
  60. ;    EZ will then load any  lengthy command line so that
  61. ;    the CCP (or ZCPR)  can act upon it.  This result is
  62. ;    obtained  by  "fooling"  CP/M  into "thinking" that
  63. ;    the user typed in the entire command line. It's EZ!
  64. ;    e.g.    A0>D <return> ...Might load "DIR *.* $U0AD"
  65. ;    The called program must of course, also be present.
  66. ;    If EZ is to be used with standard CP/M, the EZ file
  67. ;    MUST  reside  on  AND  be executed from the default
  68. ;    disk drive.  The "default" drive is the drive named
  69. ;    in the CCP's prompt "A>".  Use ZCPR to execute "EZ"
  70. ;    from any drive.  The author recommends use of ZCPR.
  71. ;
  72. ;    Examples:    CP/M --->    A>EZ    [CR]
  73. ;            ZCPR --->    D0>B:EZ [CR]
  74. ;
  75. ;    Note: [CR] = "Carriage Return"
  76. ;
  77. ;    ADVANTAGES:
  78. ;    There  are probably more uses for this technique  than those
  79. ;    which have occured to me.  Let me point out some of the most
  80. ;    obvious features.
  81. ;
  82. ;    1) Commands  up  to maximum length of the CP/M command buffer
  83. ;       can  be  executed  with a one character command.  This, in
  84. ;       effect emulates the power of programmed "soft-keys"  found
  85. ;       on the best, most expensive terminals.
  86. ;
  87. ;    2) Repeated entry into an editor to modify a textfile becomes
  88. ;       a much less tedious task, as  does  assembly  and loading.
  89. ;
  90. ;    3) It is faster than a  SUBMIT file for such processing,  but
  91. ;       note  that  the  "calling"  programs generated from EZ.ASM
  92. ;       may be used  with SUBMIT.
  93. ;
  94. ;    4) Program  does  not create any extra files during execution
  95. ;       like  the  $$$.SUB  temporary file (no disk space wasted).
  96. ;
  97. ;    5) Each EZ.COM "calling" program runs very fast and is small.
  98. ;       It  executes invisibly in the sense that it loads  itself,
  99. ;       and then the called program (plus all options) as if  ONLY
  100. ;       the called program and options had been executed.
  101. ;
  102. ;    6) For those using a standard CP/M version, drive  specifiers
  103. ;       can  be  included into each EZ "calling" program - thereby 
  104. ;       avoiding the common errors "NO FILE",and "FILE NOT FOUND".
  105. ;
  106. ;    7) In instances where disk space is limited there may be some
  107. ;       special advantage in placing only the 1-2K "calling" files
  108. ;       onto a work disk. These then execute  some larger programs
  109. ;       on another drive.  The remaining space is  thus  conserved
  110. ;       for allocation to the subject file which  is  being  acted
  111. ;       upon by the larger program.
  112. ;
  113. ;    BE FOREWARNED:
  114. ;    There are some  minor  problems to  be aware of before
  115. ;    attempting to  use  EZ.  Firstly,  there are some CP/M
  116. ;    implementations  which  cause  the  autoload  function
  117. ;    to disable itself once it has  been  used to load CP/M
  118. ;    and a full function BIOS from  a CPMXX.COM file. Next,
  119. ;    those same CP/M versions are likely to cause the drive
  120. ;    and user to be reset to "A>".  Repeating, if EZ is run
  121. ;    under an unmodified CP/M (standard CCP),  the  program
  122. ;    MUST reside on AND be executed from the  default  disk
  123. ;    drive.  Use of ZCPR will solve all of these  problems,
  124. ;    if they exist.
  125. ;
  126. ;    OTHER USES:
  127. ;    This program may also be used with MBASIC to autoload
  128. ;    both  MBASIC  and  a  saved  'BAS' file (assuming the
  129. ;    user  does  not  have  BASCOM  for compilation). This
  130. ;    technique can be especially useful for  RCP/M  Sysops
  131. ;    who may wish to load a LOGIN.BAS or RBBS.BAS program.
  132. ;
  133. ;    CREDITS:
  134. ;    Based in part, on an idea from Tim Gary, Los Altos, CA.
  135. ;
  136. ;    ASSEMBLY:
  137. ;    Assemble with ASM.COM or MAC.COM (One Z80 instruction
  138. ;    can be used, and it is included as a "DB" statement).
  139. ;
  140. ;---------------------------------------------------------------------
  141. ;
  142. TRUE:    EQU    -1
  143. FALSE:    EQU    NOT TRUE
  144. ;
  145. ;    USER DEFINED EQUATES
  146. ;
  147. Z80CPU:    EQU    TRUE        ;TRUE IF Z80 CPU CARD, ELSE FALSE
  148. ;
  149. ZCPR:    EQU    TRUE        ;TRUE IF USING ZCPR, ELSE FALSE
  150. ;
  151. CPMBAS:    EQU    0000H        ;CP/M BASE ADDRESS
  152. ;
  153. ;    END USER DEFINED EQUATES
  154. ;
  155.     ORG    CPMBAS+100H    ;CP/M EXECUTION ADDRESS
  156.     JMP    START
  157. ;
  158. ;    THE COMMAND LINE TO EXECUTE IS THE NEXT "DB" DEFINITION.
  159. ;    IT MAY EQUAL CP/M'S COMMAND BUFFER IN LENGTH.
  160. ;
  161. CMD:    EQU    $            ;MARKER, DO NOT REMOVE
  162. ;
  163.     DB    'A:MAC B:EZ $PZSZ'    ;<--- COMMAND LINE
  164. ;
  165. ;    OTHER EXAMPLES,...
  166. ;
  167. ;    DB    'A:ASM B:EZ.BBX        ;ASSEMBLE THIS FILE
  168. ;    DB    'A:LOAD B:EZ'        ;LOAD THIS FILE.HEX
  169. ;    DB    'A:DIR *.* $U0AD'    ;RCPM DIRECTORY PROGRAM
  170. ;    DB    'A:MBASIC LOGIN'    ;RCPM LOGIN.BAS & MBASIC LOAD
  171. ;    DB    'A:MBASIC RBBS'        ;RCPM RBBS.BAS & MBASIC LOAD
  172. ;
  173.     DB    0            ;DO NOT REMOVE
  174. ENDCMD:    EQU    $            ;MARKER, DO NOT REMOVE
  175. ;
  176. ;    ASSEMBLE COPYRIGHT INTO HEX FILE FOR LOAD
  177. ;
  178. CYRGHT:    DB    'COPYRIGHT (C)1983 ROBERT KUHMAN'
  179. ;
  180. ;    MAIN PROGRAM
  181. ;
  182. START:    LHLD    1        ;GET WBOOT ADDR
  183.     MOV    A,H        ;GET HI ADDR
  184.     SUI    16H        ;SUBTRACT 1600H
  185.     MOV    H,A        ;HL HAS CCP ADDRESS+3
  186.     SHLD    CCP3        ;STORE CCP ADDRESS+3
  187. ;
  188.     INX    H        ;CCP + 4
  189.     INX    H        ;CCP + 5
  190.     INX    H        ;CCP + 6
  191.     INX    H        ;CCP + 7
  192. ;
  193.     MVI    A,ENDCMD-CMD-1    ;LENGTH OF COMMAND LINE
  194.     MOV    M,A        ;PUT IT AT CCP + 7
  195. ;
  196.     INX    H        ;CCP + 8
  197.     XCHG            ;DE HAS CCP + 8 DESTINATION
  198.     LXI    H,CMD        ;HL HAS COMMAND LINE ADDR
  199.     LXI    B,ENDCMD-CMD    ;BC HAS NUMBER BYTES TO MOVE
  200. ;
  201.      IF    Z80CPU        ;Z80 CPU AVAILABLE
  202.     DB    0EDH,0B0H    ;Z80 LDIR INSTRUCTION HERE
  203.      ENDIF            ;Z80
  204. ;
  205.      IF    NOT Z80CPU    ;EMULATE LDIR INSTRUCTION FOR 8080 CPU
  206. MOVE:    MOV    A,M        ;MOVE BYTE
  207.     STAX    D        ;MOVE IT TO ADDRESS IN DE
  208.     INX    H        ;INCREMENT TO NEXT BYTE
  209.     INX    D        ;INCREMENT TO NEXT DESTINATION
  210.     DCX    B        ;SUBTRACT ONE OFF OF COUNT IN BC
  211.     MOV    A,C        ;CHECK IF DONE
  212.     ORA    B        ;OR B ONTO C IF RESULT ZERO, DONE
  213.     JNZ    MOVE         ;GET ANOTHER BYTE TO MOVE
  214.      ENDIF            ;END OF LDIR EMULATION
  215. ;
  216.      IF    ZCPR        ;USING ZCPR?
  217.     LDA    04H        ;GET PRESENT USER/DRIVE
  218.      ENDIF            ;ZCPR
  219. ;
  220.      IF    NOT ZCPR    ;STD CP/M
  221.     MVI    A,00H        ;DRIVE A> USER 0
  222.      ENDIF            ;STD CP/M
  223. ;
  224.     MOV    C,A        ;MOVE A INTO C
  225.     LHLD    CCP3        ;GET CCP ADDRESS + 3
  226.     DCX    H        ;DECREMENT DOWN TO CCP BASE
  227.     DCX    H
  228.     DCX    H        ;HL HAS CCP BASE
  229.     PCHL            ;JUMP THERE
  230. ;
  231. CCP3:    DS    2
  232. ;
  233. ;    END OF PROGRAM
  234. ;
  235.