; Patch: LFINDPAT ; Author: Bruce Morgen ; Date: 4/23/91 ; ; For: LFIND, Version 1.13 by Martin (NULU) Murray ; ; Purpose: Extract maximum drive and user from environment ; if running under Z33+, including NZCOM, Z3PLUS, ; BGii, etc. LFIND runs as before under vanilla ; CP/M. Sorry, no room for Drive Vector support. ; Also allows LFIND to respond to "//" help queries ; under Z. ; ; Production: The usual -- assemble with ZMAC, ZAS, or an ; SLR Zilog-convention assembler, overlay with ; MLOAD or equivalent (MYLOAD or a debugger and ; the SAVE command). ; Comment: LFIND is a copyrighted program -- please do NOT ; distribute patched versions! fcb equ 5ch tbuff equ 80h startlf equ 147h maxdsk equ 2ch lfinddu equ 157h lfhelp equ 50ah stkpoke equ 0ce8h org 100h jp start db 'Z3ENV',1 z3eadr: dw 00 start: ld de,(z3eadr) ld a,e or d jr z,startlf ; First test sbc hl,de ; Carry is clear! jr nz,startlf ; Second test ld hl,maxdsk ; Offset into ENV add hl,de ; Add it in ld e,(hl) ; MAXDRV in E inc hl ld d,(hl) ; MAXUSR in D inc d ; LFIND needs 1-based user! ld (lfinddu),de ; Poke to LFIND patch points ld a,(fcb+1) sub '/' ; Check for help query jr nz,startlf ; If none, go start LFIND ld (tbuff+1),a ; Otherwise fake empty tail first jr startlf banner: db 13,'LFIND, Version 1.13z',0 ; Shorter banner org 238h ld hl,banner ; Tell LFIND to use our banner end