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
Wrap
Text File
|
2000-06-30
|
3KB
|
125 lines
page
; RCP-H.Z80 'H' Command
;=============================================================================
;
; H E L P C O M M A N D
;
;=============================================================================
; This command displays a list of all resident commands that are supported,
; including those in the CPR (command processor), RCP, and FCP.
clist:
; Print the FCP-resident command names
if listfcp
ld hl,(z3env+12h) ; Get FCP address
ld a,h ; See if implemented
or l
jr z,nofcp
ld de,5
add hl,de
call print ; Print header for FCP
db lf
db 'FC','P'+80h
call cmdlist ; Display list of commands
nofcp:
endif ;listfcp
; Print the CPR-resident command names
if listcpr
call print ; Print "CPR"
db lf
db 'CP','R'+80h
ld hl,ccp+offcmd ; Point to command table in CPR
call cmdlist ; Display the list of commands
endif ;listcpr
; Print the RCP-resident command names
call crlf ; Skip a line
ld hl,rcpname ; Print RCP name
call printhl
ld hl,rcp+5 ; Point to RCP command table
; Fall through to CMDLIST
;----------------------------------------
; Subroutine to display list of commands in a command table (code above
; falls through to this routine -- do not move it). The commands are
; displayed 5 per line with 8 character spaces allowed for each command
; (subject to equates below).
cmdlist:
call crlf ; Start with new line
ld e,(hl) ; Get size of each command name into DE
ld d,0
inc hl ; Point to name of first command
ld c,cmdsline ; Set names-per-line value
cmdlist1:
ld a,(hl) ; Get first character of the command name
or a ; See if it is null
jr nz,cmdlist1a ; If not, continue
ld a,cmdsline ; See if we are already on a new line
cp c
call nz,crlf ; If not, skip a line
ret
cmdlist1a:
if noshow ; Option to suppress wheel-limited cmds
rla ; Shift high bit of name into carry bit
jr nc,cmdlist2 ; If not restricted, go on
ld a,(z3whl) ; Otherwise, check wheel byte
or a
jr nz,cmdlist2 ; If wheel set, continue as usual
add hl,de ; Otherwise skip this command
jr cmdlist5
endif
; Print leading spaces between names
cmdlist2:
ld a,cmdspace ; Spacing between command names
sub e ; Less length of each command name
ld b,a
ld a,' '
cmdlist3:
call conout
djnz cmdlist3
; Print name of command
ld b,e ; Length of each name into B
cmdlist4:
ld a,(hl) ; Get command name character
call conout
inc hl ; Point to next
djnz cmdlist4
dec c ; Decrement count of names on this line
jr nz,cmdlist5 ; Branch if room for more names
call crlf ; Otherwise, end this line and
ld c,cmdsline ; ..reset count for another line of commands
; Skip to next command name
cmdlist5:
inc hl ; Skip jump vector
inc hl
jr cmdlist1 ; Back to process next name
; End RCP-H.Z80