; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ; * * ; * FCB version 1.00 * ; * * ; * A Command Tail to File Control Block Demonstration Utility * ; * * ; * Terry Hazen * ; * Los Gatos, California * ; * 10/03/85 * ; * * ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ; ; ; INTRODUCTION... ; ; FCB is a demonstration utility that takes the command tail you ; type and shows how the operating system (CP/M or ZCPR) transfers ; it to the file control block. I wrote it as a quickie utility so ; I could see how CP/M and ZCPR handled things differently when you ; wanted to specify the DU: form. ; ; ; USEAGE... ; ; A0>FCB [du:]fn.typ anything.else ; ; ; EXAMPLE... ; ; A0>fcb a8:fn.ft anything.else ; ; FCB1......4FN FT ; FCB2......0ANYTHINGELS ; CMDTAIL...G D8:FN.FT ANYTHING.ELSE ; ; ; The display shown would be for ZCPR3. The drive codes are shown ; as ASCII numbers for printability, but are actually in hex. The ; standard CP/M code is used: 0 is the default drive, 1 is drive A, ; etc. The first postion in the command tail display is the number ; of characters in the command tail. This digit is actually hex, ; but to get it in printable form, I added 30H to it. This results ; in numbers starting with 0 and continuing up the ASCII chart ; (23D/17H prints as 'G'). ; ; ; OTHER USES... ; ; I've used FCB as a subroutine to test out routines that move ; things to the FCB as a quick way of testing how they worked out ; before incorporating them in larger programs. A nice "visual ; aid" that helps you see what you're doing with the FCB. ; ; - Terry Hazen ; ;................................................................ ; ; ORG 100H ; JMP START ; CR: EQU 0DH LF: EQU 0AH ; CONOUT: EQU 02H ; BDOS: EQU 005H FCB1DR: EQU 05CH FCB1: EQU 05DH FCB2DR: EQU 06CH FCB2: EQU 06DH CMDTAIL:EQU 080H ; START: LXI H,0 ;get ccp's stack DAD SP SHLD STACK ;save it for later LXI SP,STACK ;set up new stack ; CALL CRLF CALL CDISP DB 'FCB1......',0 LXI H,FCB1DR MVI B,1 CALL ILPRT ; MVI B,11 CALL ILPRT CALL CRLF ; CALL CDISP DB 'FCB2......',0 LXI H,FCB2DR MVI B,1 CALL ILPRT ; MVI B,11 CALL ILPRT CALL CRLF ; CALL CDISP DB 'CMDTAIL...',0 LXI H,CMDTAIL MOV B,M INR B ; INX H CALL ILPRT CALL CRLF ; JMP EXIT ; ; print whatever h points to for b characters ; and add 30h to any character 1fh and below. ; ILPRT: MOV A,B ;put b in a CPI 0 ; are any characters there? RZ ;if not, return ; MOV A,M CPI 20H ;printable character? JNC ILP1 ;yes, so print it ; FILTER: ADI 30H ;make it printable ; ILP1: CALL CRTOUT ; INX H DCR B RZ ;no more characters JMP ILPRT ; CRLF: CALL CDISP DB CR,LF,0 RET ; CRTOUT: PUSH H PUSH B PUSH PSW MVI C,CONOUT MOV E,A CALL BDOS POP PSW POP B POP H RET ; CDISP: XTHL ;exchange top of stack and hl ; CDIS1: MOV A,M ;hl points to db message ORA A ;see if 0 at end of message INX H ; JZ CDIS2 ;yes, restore stack and return CALL CRTOUT ;no, print the character JMP CDIS1 ;and return ; CDIS2: XTHL ;get return address on top of stack RET ;and return ; EXIT: LHLD STACK ;get old stack SPHL RET ;return to ccp ; DS 60 STACK: DS 2 ; END 100H