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 / Z3-33 / Z33RCP02.LBR / RCPH.LZB / RCPH.LIB
Text File  |  2000-06-30  |  3KB  |  125 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. clist:
  15.  
  16. ; Print the FCP-resident command names
  17.  
  18.      if    listfcp
  19.  
  20.     ld    hl,(z3env+12h)    ; Get FCP address
  21.     ld    a,h        ; See if implemented
  22.     or    l
  23.     jr    z,nofcp
  24.  
  25.     ld    de,5
  26.     add    hl,de
  27.  
  28.     call    print        ; Print header for FCP
  29.     db    lf
  30.     db    'FC','P'+80h
  31.     call    cmdlist        ; Display list of commands
  32.  
  33. nofcp:
  34.  
  35.      endif    ;listfcp
  36.  
  37. ; Print the CPR-resident command names
  38.  
  39.      if    listcpr
  40.  
  41.     call    print        ; Print "CPR"
  42.     db    lf
  43.     db    'CP','R'+80h
  44.     ld    hl,ccp+offcmd    ; Point to command table in CPR
  45.     call    cmdlist        ; Display the list of commands
  46.  
  47.      endif    ;listcpr
  48.  
  49. ; Print the RCP-resident command names
  50.  
  51.     call    crlf        ; Skip a line
  52.     ld    hl,rcpname    ; Print RCP name
  53.     call    printhl
  54.     ld    hl,rcp+5    ; Point to RCP command table
  55.                 ; Fall through to CMDLIST
  56.  
  57. ;----------------------------------------
  58.  
  59. ; Subroutine to display list of commands in a command table (code above
  60. ; falls through to this routine -- do not move it).  The commands are
  61. ; displayed 5 per line with 8 character spaces allowed for each command
  62. ; (subject to equates below).
  63.  
  64. cmdlist:
  65.     call    crlf        ; Start with new line
  66.     ld    e,(hl)        ; Get size of each command name into DE
  67.     ld    d,0
  68.     inc    hl        ; Point to name of first command
  69.     ld    c,cmdsline    ; Set names-per-line value
  70.  
  71. cmdlist1:
  72.     ld    a,(hl)        ; Get first character of the command name
  73.     or    a        ; See if it is null
  74.     jr    nz,cmdlist1a    ; If not, continue
  75.     ld    a,cmdsline    ; See if we are already on a new line
  76.     cp    c
  77.     call    nz,crlf        ; If not, skip a line
  78.     ret
  79.  
  80. cmdlist1a:
  81.      if    noshow        ; Option to suppress wheel-limited cmds
  82.     rla            ; Shift high bit of name into carry bit
  83.     jr    nc,cmdlist2    ; If not restricted, go on
  84.     ld    a,(z3whl)    ; Otherwise, check wheel byte
  85.     or    a
  86.     jr    nz,cmdlist2    ; If wheel set, continue as usual
  87.     add    hl,de        ; Otherwise skip this command
  88.     jr    cmdlist5
  89.      endif
  90.  
  91. ; Print leading spaces between names
  92.  
  93. cmdlist2:
  94.     ld    a,cmdspace    ; Spacing between command names
  95.     sub    e        ; Less length of each command name
  96.     ld    b,a
  97.     ld    a,' '
  98. cmdlist3:
  99.     call    conout
  100.     djnz    cmdlist3
  101.  
  102. ; Print name of command
  103.  
  104.     ld    b,e        ; Length of each name into B
  105. cmdlist4:
  106.     ld    a,(hl)        ; Get command name character
  107.     call    conout
  108.     inc    hl        ; Point to next
  109.     djnz    cmdlist4
  110.  
  111.     dec    c        ; Decrement count of names on this line
  112.     jr    nz,cmdlist5    ; Branch if room for more names
  113.     call    crlf        ; Otherwise, end this line and
  114.     ld    c,cmdsline    ; ..reset count for another line of commands
  115.  
  116. ; Skip to next command name
  117.  
  118. cmdlist5:
  119.     inc    hl        ; Skip jump vector
  120.     inc    hl
  121.     jr    cmdlist1    ; Back to process next name
  122.  
  123. ; End RCP-H.Z80
  124.  
  125.