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. ; * * * * * * * * * * * * * * ; * 03 Aug 87 Graeme Toogood. ; * c/o Eastwood RZ/SYS. Melbourne, Australia (613) 870-4623 ; * Examination of the CLIST: code will show that the address ; * to locate the CPR command list is the CPR's absolute address. ; * When the CPR is relocated this address changes, but unless ; * Z33RCP is reassembled for the new CPR address, it will not ; * point to the correct address to find CPR commands. In this case ; * the 'H' command will display garbage instead of CPR commands. ; * The problem can be solved by using the Bios warm boot vector ; * at (0001H) to calc. the start of CPR, which is always 1600H ; * below bios. The modification adds 5 bytes to the code and ; * allows Z33RCP to find the CPR command list for any size system. ; * * * * * * * * * * * * * * ; 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 ; * ; * 03 Aug 87 - GKT. ; * Calculate correct address of CPR command list. ; * ld hl,ccp+offcmd ; Point to command table in CPR ; * LD L,OFFCMD ; * Load offset from CPR Base address LD A,(0002H) ; * Load MSB of Bios Warm Boot Address SUB 16H ; * CPR is 1600H below BIOS LD H,A ; * HL now points to CPR command list ; * End of modification ; 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 ommand name cmdlist5: inc hl ; Skip jump vector