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 / ZCPR33 / A-R / RCPH-GKT.LZB / RCPH-GKT.LIB
Text File  |  2000-06-30  |  4KB  |  157 lines

  1.     page
  2.  
  3. ; RCP-H.Z80    'H' Command
  4.  
  5. ;=============================================================================
  6. ;
  7. ;    H E L P    C O M M A N D
  8. ;
  9. ;=============================================================================
  10.  
  11. ; This command displays a list of all resident commands that are supported,
  12. ; including those in the CPR (command processor), RCP, and FCP.
  13.  
  14. ; * * * * * * * * * * * * * *
  15. ; * 03 Aug 87 Graeme Toogood.
  16. ; *    c/o Eastwood RZ/SYS. Melbourne, Australia (613) 870-4623
  17. ; *    Examination of the CLIST: code will show that the address
  18. ; *    to locate the CPR command list is the CPR's absolute address.
  19. ; *    When the CPR is relocated this address changes, but unless
  20. ; *    Z33RCP is reassembled for the new CPR address, it will not 
  21. ; *    point to the correct address to find CPR commands. In this case
  22. ; *    the 'H' command will display garbage instead of CPR commands.
  23. ; *    The problem can be solved by using the Bios warm boot vector
  24. ; *    at (0001H) to calc. the start of CPR, which is always 1600H
  25. ; *    below bios. The modification adds 5 bytes to the code and
  26. ; *    allows Z33RCP to find the CPR command list for any size system.
  27. ; * * * * * * * * * * * * * *
  28. ;
  29.  
  30. clist:
  31.  
  32. ; Print the FCP-resident command names
  33.  
  34.      if    listfcp
  35.  
  36.     ld    hl,(z3env+12h)    ; Get FCP address
  37.     ld    a,h        ; See if implemented
  38.     or    l
  39.     jr    z,nofcp
  40.  
  41.     ld    de,5
  42.     add    hl,de
  43.  
  44.     call    print        ; Print header for FCP
  45.     db    lf
  46.     db    'FC','P'+80h
  47.     call    cmdlist        ; Display list of commands
  48.  
  49. nofcp:
  50.  
  51.      endif    ;listfcp
  52.  
  53. ; Print the CPR-resident command names
  54.  
  55.      if    listcpr
  56.  
  57.     call    print        ; Print "CPR"
  58.     db    lf
  59.     db    'CP','R'+80h
  60.  
  61. ; *
  62. ; * 03 Aug 87 - GKT.
  63. ; * Calculate correct address of CPR command list.
  64. ; *    ld    hl,ccp+offcmd    ; Point to command table in CPR
  65. ; *
  66.     LD    L,OFFCMD    ; * Load offset from CPR Base address
  67.     LD    A,(0002H)    ; * Load MSB of Bios Warm Boot Address
  68.     SUB    16H        ; * CPR is 1600H below BIOS
  69.     LD    H,A        ; * HL now points to CPR command list
  70. ; * End of modification
  71. ;
  72.  
  73.     call    cmdlist        ; Display the list of commands
  74.  
  75.      endif    ;listcpr
  76.  
  77. ; Print the RCP-resident command names
  78.  
  79.     call    crlf        ; Skip a line
  80.     ld    hl,rcpname    ; Print RCP name
  81.     call    printhl
  82.     ld    hl,rcp+5    ; Point to RCP command table
  83.                 ; Fall through to CMDLIST
  84.  
  85. ;----------------------------------------
  86.  
  87. ; Subroutine to display list of commands in a command table (code above
  88. ; falls through to this routine -- do not move it).  The commands are
  89. ; displayed 5 per line with 8 character spaces allowed for each command
  90. ; (subject to equates below).
  91.  
  92. cmdlist:
  93.     call    crlf        ; Start with new line
  94.     ld    e,(hl)        ; Get size of each command name into DE
  95.     ld    d,0
  96.     inc    hl        ; Point to name of first command
  97.     ld    c,cmdsline    ; Set names-per-line value
  98.  
  99. cmdlist1:
  100.     ld    a,(hl)        ; Get first character of the command name
  101.     or    a        ; See if it is null
  102.     jr    nz,cmdlist1a    ; If not, continue
  103.     ld    a,cmdsline    ; See if we are already on a new line
  104.     cp    c
  105.     call    nz,crlf        ; If not, skip a line
  106.     ret
  107.  
  108. cmdlist1a:
  109.      if    noshow        ; Option to suppress wheel-limited cmds
  110.     rla            ; Shift high bit of name into carry bit
  111.     jr    nc,cmdlist2    ; If not restricted, go on
  112.     ld    a,(z3whl)    ; Otherwise, check wheel byte
  113.     or    a
  114.     jr    nz,cmdlist2    ; If wheel set, continue as usual
  115.     add    hl,de        ; Otherwise skip this command
  116.     jr    cmdlist5
  117.      endif
  118.  
  119. ; Print leading spaces between names
  120.  
  121. cmdlist2:
  122.     ld    a,cmdspace    ; Spacing between command names
  123.     sub    e        ; Less length of each command name
  124.     ld    b,a
  125.     ld    a,' '
  126. cmdlist3:
  127.     call    conout
  128.     djnz    cmdlist3
  129.  
  130. ; Print name of command
  131.  
  132.     ld    b,e        ; Length of each name into B
  133. cmdlist4:
  134.     ld    a,(hl)        ; Get command name character
  135.     call    conout
  136.     inc    hl        ; Point to next
  137.     djnz    cmdlist4
  138.  
  139.     dec    c        ; Decrement count of names on this line
  140.     jr    nz,cmdlist5    ; Branch if room for more names
  141.     call    crlf        ; Otherwise, end this line and
  142.     ld    c,cmdsline    ; ..reset count for another line of commands
  143.  
  144. ; Skip to next command name
  145.  
  146. cmdlist5:
  147.     inc    hl        ; Skip jump vector
  148.     inc    hl
  149.     jr    cmdlist1    ; Back to process next name
  150.  
  151. ; End RCP-H.Z80
  152.  
  153. ommand name
  154.  
  155. cmdlist5:
  156.     inc    hl        ; Skip jump vector
  157.