; TITLE "Z3PRS3A - Z3lib 4.0" NAME ('DNSCAN') ;================================================================ ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;---------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from Z3PRS3.Z80 Ver 1.1 by Richard Conn ; Date : 29 Jul 89 ; Version : 1.3 ; Module : Z3PRS3A ; Abstract: This module contains the routine DNSCAN which scans a ; token for a Disk Name, DU: form, or DIR form, respectively. ; Revision: ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC DNSCAN ; From Z3LIB Get.. EXT @SDELM, DIRSCAN, DUSCAN ; From SYSLIB Get.. EXT CAPS .Z80 CSEG ;=============================================================== ; NAME - DNSCAN ; Entry: HL - Points to Disk Name (8 chars max) ; A = Flag (0 = scan DU first, 0FFH = scan DIR first) ; Exit : BC = Disk/User, (B = Disk, C = User) if Valid ; A <> 0, Zero Flag Reset (NZ) if Valid ; A = 0, Zero Flag Set (Z) if NOT Valid ; Uses AF,BC ; Special Requirements: None ;=============================================================== DNSCAN: PUSH HL ; Save key regs PUSH DE PUSH AF ; Save DUfirst flag LD DE,DIRN ; Pt to DIR name buffer LD B,8 ; 8 chars max PUSH DE CALL SCANF ; Place DIR name into DIR name buffer POP HL ; HL pts to DIR name buffer POP AF ; Restore DU first flag OR A ; Do we check DU before DIR? JR Z,SCN1 ; ..jump if Not CALL DUSCAN ; Do we have DU: form? CALL Z,DIRSCAN ; ..check DIR: form if Not DU: JR SCN0 ; Jump ahead to check status & exit SCN1: CALL DIRSCAN ; Do we have DIR: form? CALL Z,DUSCAN ; ..check DU: form if Not DIR: SCN0: JR Z,ERROR ; Jump error if not found ; We have a valid DU or DIR - TEMPDR/TEMPUSR contain data DEFB 0F6H ; Set Ok flag with "OR 0AFH" ERROR: XOR A ; Set Error flag if entered here POP DE ; Restore regs POP HL RET ;..... ; Scan token pted to by HL for a max of B bytes and place in Buffer at DE SCANF: CALL @SDELM ; Done if delimiter encountered JR Z,SCANF1 ; Space fill CALL CAPS ; ..Insure it is capitalized LD (DE),A ; Store byte INC HL ; Pt to next INC DE DJNZ SCANF ; Count down RET SCANF1: LD A,' ' ; Fill buffer with spaces LD (DE),A INC DE ; Pt to next DJNZ SCANF1 ; Count down RET ;..... ; Data Storage/Buffers DSEG ; Put data in Data Segment DIRN: DEFS 8 ; Directory name buffer END