; Version 0.1, February 15, 1988, now properly processes ; the DIR form. Thanks to Rick Charnes for the bug ; report. Now does Z80 test itself (didn't want to do ; the command tail manipulation without good old CPIR ; and LDIR). Bruce Morgen ; ZCPR3 compatibility patch for SETD (v2.2), allows the ; SETD to respond to DU:/DIR: references and the standard ; ZCPR3.x "//" help query syntax. Uses 8080 instructions ; only because it preceeds SETD's Z80-compatibilty test. ; February 11, 1988 Bruce Morgen ; Assemble with ZAS, Z80ASM or equivalent, install with ; Ron Fowler's MLOAD: ; MLOAD SETD.COM,SETDZ3 ORG 100H JP 996H ; Jump to patch code ORG 996H SUB A JP PE,94BH ; SETD error routine if not Z80 LD HL,(5CH) ; Get FCB & FCB+1 LD A,H ; Test for help query SUB '/' JR Z,PLANT ; Proceed with SETDZ3 if not LD A,H SUB ' ' JR NZ,ADJCL PLANT: LD (80H),A ; Otherwise set the char. count ; JPSETD: JR 951H ; and then proceed with SETD.... ADJCL: LD A,L ; Get drive spec. DEC A ; Adjust drive code LD E,A ; Into E for BDOS LD C,14 ; Log in drive CALL P,005H ; (only if not default) XOR A ; Init. FCB drive to default LD (5CH),A ; to fool SETD parsing NODLOG: LD A,(69H) ; Get ZCPR3-parsed user code LD E,A ; Into E for BDOS LD C,32 ; Log in user code CALL 005H LD B,0 ; Set up BC for 8-bit value LD HL,080H ; Point command tail char. count LD C,(HL) ; It's in BC now INC HL ; Bump pointer by one LD A,':' ; Look for first colon CPIR ; Search JR NZ,JPSETD ; If none found, rejoin SETD LD DE,82H ; Otherwise point to tail start PUSH DE ; Save pointer LD C,125 ; Count to (B)C LDIR ; Move tail sans any "du:/dir:" POP HL ; Tail pointer to HL XOR A ; Search for terminating null LD C,125 ; Full buffer range CPIR JR NZ,JPSETD ; Not bloody likely.... LD A,L ; Into A (must be 8-bit value) SUB 82H ; Compute like BDOS would have JR PLANT ; Plant as new char. count and ; start SETD main code. END