home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol116 / nzcpr207.dif < prev    next >
Encoding:
Text File  |  1984-04-29  |  9.1 KB  |  340 lines

  1. 1d 0
  2. 3c 17200
  3. *  N Z C P R 207- Z80-Based Command Processor Replacement, Version 2.07    *
  4. .
  5. 16c 24427
  6. *                                    *
  7. *  This is DIF file Mod 0.7 to be combined with mod 0.1 VERS of ZCPR2.  *
  8. *  To obtain the full file do:                             *
  9. *  SSED ZCPR2.ASM <NZCPR207.DIF >NZCPR207.ASM                    *
  10.  
  11.  
  12. *=======================================================================*
  13. *                                      *
  14. *              S U M M A R Y     O F    C H A N G E S             *
  15. *        IN REGARD WITH THE ORIGINAL ZCPR2            *
  16. *                                    *
  17. *            by Peter Pinchis                *
  18. *                                    *
  19. *    1. DIR and ERA commands have user selectable number of columns. *
  20. *       This may be achieved by adjusting the NRCOL equate in     *
  21. *       NZCPRHDR.LIB.                        *
  22. *       The display produced shall stop at each full screen.        *
  23. *    2. Form feeds are ignored by the TYPE command display.        *
  24. *    3. The TYPE command accepts wild card as file name.        *
  25. *    4. ERAV equate from the library has a new meaning :             *
  26. *        - when set TRUE , the same as in ZCPR2.            *
  27. *        - when set FALSE the user is always prompted except    *
  28. *          when ERDFLG is present in the command line.        *
  29. *            Example:                     *
  30. *             A>era *.asm                    *
  31. *             NZCPR207.ASM | NZCPR206.ASM            *
  32. *             Erase?y                    *
  33. *             A>era *.hex n                        *
  34. *             NZCPR207.HEX                    *
  35. *             A>                        *
  36. *    5. If a file is not found by the load,TYPE,REN,DIR,GET or ERA   *
  37. *          command then the file name is printed after "No File" prompt.*
  38. *    6. If during the execution of a multiple command line ,an error *
  39. *       occurs ( ie: a file is not found or wild card is illegaly    *
  40. *       specified in a REN or SAVE command ), then a prompt 'Abort?' *
  41. *       shall provide the choice to continue or not with the remain- *
  42. *          der of the command line.                    *
  43. *          Example:                        *
  44. *                  B1>asmbl myprog a;type yyy;dir b5:xxx.com    *
  45. *                  ;...asmbl and yyy not present         *
  46. *                  ;...b5: empty                *
  47. *                  B1>No File ASMBL MYPROG A            *
  48. *                  B1>Abort?n                *
  49. *                  B1>No file YYY                *
  50. *                  B1>Abort?n                *
  51. *                  B1>No File B5:XXX.COM            *
  52. *                  B1>                    *
  53. *          Other example:                    *
  54. *                  B1>era qqq.com;ren pp.txt=rr.txt        *
  55. *                  ;..qqq.com not present; pp.txt exist'g    *
  56. *                  B1>No File QQQ.COM            *
  57. *                  B1>Abort?n                *
  58. *                  B1>Erase PP      .TXT?y            *
  59. *                  B1>No File RR.TXT                *
  60. *                  B1>                    *
  61. *       7. When DIR or TYPE is interrupted by ^C during a multiple cmd  *
  62. *       line ,the user is prompted to abort or not the rest of the   *
  63. *       cmd line.                            *
  64. *    8. When ^C is typed during a submit file, the user is prompted  *
  65. *       to continue or not with the next cmd in the submit file.    *
  66. *       9. When an error occurs during a submit file( ie: a file is not *
  67. *       found or wild card is illegaly specified in a REN or SAVE    *
  68. *       command ), then the user is prompted to abort or not the     *
  69. *       remainder of the submit file.                *
  70. *          -Note that in the last two cases when you answer 'Y', *
  71. *           to the 'Abort?' prompt the rest of the cmd line is   *
  72. *           ignored. In order to avoid that you should answer 'N'*
  73. *           and to type ^C after each cmd in the submit file.    *
  74. *                                    *
  75. *=======================================================================*
  76.  
  77.  
  78.  
  79. *  29 MAR 1983  =  VERS 2.07 ; BY PETER PINCHIS, TORONTO,ONT        *
  80. *          Mods to the TYPE command by Jim Kuzman included.    *
  81. *          TYPE routine further changed to accept wild cards.    *
  82. *          Use module NZCPRHDR.LIB ver 2.02 to compile this file.*
  83. *                                    *
  84. *  11 MAR 1983   = VERS 2.06 ; BY PETER PINCHIS, TORONTO, ONT.        *
  85. *           All mods from ZCPR22.ASM by Rich Conn included .    *
  86. *          BREAK routine futher changed to run proprely.        *
  87. *          ERROR routine has new features.            *
  88. *          Use module NZCPRHDR.LIB ver 2.02 to compile this file.*
  89. *                                                                       *
  90. *  28 FEB 1983   = VERS 2.05 ; BY PETER PINCHIS, TORONTO, ONT.        *
  91. *        - Major bug fixed: in the original ZCPR2 mod 0.1 every  *
  92. *          time when a wrong command is issued in the multiple   *
  93. *          command line ( i.e : a file not found or a wild card  *
  94. *          in the save or ren cmd ) ,the ZCPR stops and the rest *
  95. *          of the command line is ignored.            *
  96. *          The present fix solves this problem .            *
  97. *          If other commands follow the ofending one, then an    *
  98. *           other prompt "Abort?" is displayed.            *
  99. *          The user could abort or not the execution of the rest *
  100. *          of command line.                        *
  101. *          Use module NZCPRHDR.LIB ver 2.02 to compile this file.*
  102. *                                    *
  103. *  25 FEB 1983   = VERS 2.04 ; BY PETER PINCHIS, TORONTO, ONT.        *
  104. *          Included in vers 2.05                    *
  105. *                                    *
  106. *  23 FEB 1983  = VERS 2.03 ; BY PETER PINCHIS, TORONTO, ONT.        *
  107. *         Included in vers 2.05                    *
  108. *                                    *
  109. *  18 FEB 1983  = VERS 2.02 ; BY PETER PINCHIS, TORONTO, ONT.        *
  110. *         - DIR routine has been changed to provide user select-  *
  111. *          able number of columns for DIR and ERA display.    *
  112. *          DIR and ERA shall now page at each full screen.    *
  113. *        - CONOUT routine modified to ignore Form feeds.        *
  114. *               - ERAV has a new meaning : when FALSE the user is always*
  115. *          prompted except when ERDFLG is present in the command *
  116. *          line.                            *
  117. *        - The module ZCPRHDR.LIB has been changed and renamed   *
  118. *          NZCPRHDR.LIB.                            *
  119. *          Only this module shall be used to compile NZCPR202    *
  120. .
  121. 133,134c 41637
  122. ;  NZCPR207 -- CP/M Z80 Command Processor Replacement (ZCPR) Version 2.07
  123. .
  124. 202c 44423
  125.     MACLIB    NZCPRHDR
  126. .
  127. 206a 57200
  128. ff    equ    0ch            ;form feed
  129. .
  130. 694,717c 4264
  131. error:
  132.     call    prnnf        ;no file message
  133. curtok    equ    $+1        ;POINTER FOR IN-THE-CODE MODIFICATION
  134.     lxi    h,0        ;PT TO BEGINNING OF COMMAND LINE
  135. err1:
  136.     mov    a,m        ;GET CHAR from current token of cmd line
  137.     shld    nxtchr        ;set pointer
  138.  
  139.     if    multcmd
  140.     cpi    cmdsep        ;is a cmd separator ?
  141.     jrz    err3        ;yes , print abort msg
  142.     endif        ;multcmd
  143.  
  144.      cpi    ' '        ;is less than <sp> ?
  145.      jrc    err2         ;yes , is the end of cmd line
  146.     call    conout        ;PRINT COMMAND CHAR
  147.     inx    h        ;PT TO NEXT CHAR
  148.     jr    err1        ;CONTINUE
  149. err2:
  150.     if    subon
  151.     lda    rngsub        ;is a submit file active ?
  152.     ora    a
  153.     jrz    err5        ;if submit file active ( not zero ) 
  154.                 ;then print prompt, otherwise  restart cpr
  155.     else
  156.     jr    err5        ;if not submit facility restart cpr
  157.     endif        ;subon
  158. err3:
  159.     if    multcmd
  160.     call    printc        ;abort message
  161.     db    'Abort','?'+80H
  162.     call    askok        ;ask for ok
  163.     jrnz    rstcpr        ;if not, goto next cmd
  164.     endif        ;multcmd
  165.  
  166.     if    subon        ;IF SUBMIT FACILITY IS ON
  167.     call    subkil        ;TERMINATE ACTIVE $$$.SUB IF ANY
  168.     endif        ;subon
  169.     
  170.     jr    err5        ;abort command line
  171. err4:
  172.     if    multcmd
  173.     lhld    nxtchr        ;load next chr in command line
  174.     mov    a,m
  175.     cpi    ' '        ;is the end of it ?
  176.     jrnc    err3        ;no, then print abort prompt
  177.     endif        ;multcmd
  178. err5:
  179.     jmp    restrt        ;abort command line
  180. .
  181. 744a 4402
  182. ; Ask operator for OK
  183. ;
  184. askok:
  185.     exx            ;save regs
  186.     call    conin        ;input     
  187.     exx            ;restore regs
  188.     cpi    'Y'        ;is 'YES' ?
  189.     ret
  190.  
  191. ;
  192. .
  193. 759c 46295
  194.     DB    'No File',' '+80H
  195. .
  196. 777,778c 13982
  197.     MVI    C,1    ;INPUT CHAR
  198.     CALL    BDOS    ;GET INPUT CHAR WITH ^S PROCESSING AND ECHO
  199.     JMP    UCASE    ;CAPITALIZE
  200. .
  201. 782,784c 28036
  202.     EXX        ;SAVE CHAR
  203.     cpi    ff    ;is a form feed ?
  204.     jrz    skipff  ;skip char
  205.     MVI    C,2
  206. .
  207. 789,790c 19834
  208. skipff:
  209.     EXX
  210. .
  211. 804,806c 3257
  212.     EXX        ;SAVE REGS
  213.     MVI    C,5
  214. .
  215. 840c 2493
  216.     PUSH    B        ;SAVE REG
  217. .
  218. 844c 46076
  219.     JZ    err4        ;RESTART CPR
  220. .
  221. 1040,1042c 46281
  222.     RNZ            ;IF NO ^C, RETURN TO CALLER AND RUN
  223. ;     CALL    SUBKIL        ;KILL $$$.SUB IF ABORT
  224.     JMP    rstcpr        ;RESTART CPR
  225. .
  226. 1066c 52504
  227. ; CHECK FOR ANY CHAR FROM USER CONSOLE; RET W/ZERO SET IF ^C TYPED
  228. .
  229. 1069,1075c 59482
  230.     exx            ;save regs
  231.      mvi    c,11        ;check con status
  232.      call    bdos
  233.     ora    a        ;set flags
  234.     cnz    conin        ;input char
  235.     exx            ;restore regs
  236.     cpi    'C'-'@'        ;is ^C ?
  237.     ret
  238. .
  239. 1543,1546d 32370
  240. 1594,1595c 14611
  241.     MVI    E,nrcol-1    ;SET COLUMN COUNTER TO ZERO
  242.     PUSH    D        ;SAVE COLUMN COUNTER (E)
  243.     mvi    a,nlines
  244.     sta    pagcnt
  245. .
  246. 1600,1603c 7473
  247. ;    CALL    PRNNF        ;PRINT NO FILE MSG; REG A NOT CHANGED
  248. ;    XRA    A        ;SET ZERO FLAG
  249.     POP    D        ;RESTORE DE
  250.     jmp    error
  251.  
  252. ;    RET
  253. .
  254. 1614,1616c 33679
  255.     INR    a
  256.     cpi    nrcol
  257.     jrnz    dir3a
  258.     xra    a
  259. dir3a:
  260.     mov    e,a
  261.     PUSH    D        ;SAVE IT
  262. ;    ANI    03H        ;OUTPUT <CRLF> IF all  ENTRIES PRINTED IN LINE
  263. .
  264. 1623a 47498
  265.     push    b
  266.     call    pager
  267.     pop    b
  268. .
  269. 1652c 59046
  270.     JRZ    dir8
  271. .
  272. 1659a 64237
  273. dir8:
  274.     pop    d
  275.     jmp    err4        ;restart cpr 
  276. .
  277. 1737,1739c 45681
  278. ;        If ERAV is FALSE, verification is always requested, except when
  279. ;            V flag is present in the command line ,in wich case
  280. ;                the user will not be prompted.
  281. .
  282. 1753c 47198
  283.     IF    ERAOK        ;OK? ENABLED?
  284. .
  285. 1762,1764d 55375
  286. 1764,1768c 44133
  287. ;    RZ            ;ABORT IF NO FILES
  288. .
  289. 1769,1770c 17337
  290.  
  291.     IF    ERAV        ;if ERAV is true then
  292.     JRNZ    ERA2        ;do not skip prompt if ERDFLG prezent 
  293.     else            ;if ERAV is false then
  294.     jrz    era2        ;skip prompt if ERDFLG prezent 
  295. .
  296. 1777,1779c 40740
  297.     DB    'Erase','?'+80H
  298. ;    CALL    CONIN        ;GET REPLY
  299. ;    CPI    'Y'        ;YES?
  300.     call    askok        ;ask for ok
  301. .
  302. 1836c 31573
  303.     call    searf        ;search for first
  304.     jz      error        ;error if not found
  305. .
  306. 1845c 27577
  307. ;    JZ    ERROR        ;ABORT IF ERROR
  308. .
  309. 1878,1895c 54485
  310.     jrnz    type4        ;no
  311.     mvi    b,0        ;reset tab cnt
  312. type4:
  313.     cpi    ' '        ;is cntr char ?
  314.     jrc    type4a        ;yes do not incr pos chr
  315.     inr    b        ;incr pos count
  316. type4a:
  317.     cpi    tab
  318.     jrz    type5        ;yes expand
  319.     call    lcout        ;output
  320.     jr    type6        ;continue process
  321. .
  322. 1905,1913c 8868
  323.     CALL    BREAK        ;CHECK FOR ABORT
  324.     jz    err4        ;RESTART IF SO
  325.     JR      TYPE2
  326. .
  327. 2009,2012c 743
  328. ;    CALL    CONIN        ;GET RESPONSE
  329.     POP    D        ;GET PTR TO FCB
  330. ;    CPI    'Y'        ;KEY ON YES
  331.     call    askok        ;ask for ok    
  332.     JNZ    rstcpr        ;RESTART AS ERROR IF NO
  333. .
  334. 2071,2072c 36422
  335. ;REN3:
  336. ;    CALL    PRNNF        ;PRINT NO FILE MSG
  337. .
  338. $a 20089
  339. .
  340.