TITLE "Z33SCAN - Z3lib 4.0" ;================================================================= ; Copyright (C) 1989 by Jay Sage. Permission granted to ; Alpha Systems Corp. to distribute with The Libraries, Version 4 ;----------------------------------------------------------------- ; Author : Jay Sage modified by Harold F. Bower ; Date : ; Version : 1.0 ; Module : Z33SCAN ; Abstract: This module contains the routine SCAN which calls the ; SCAN entry point in the Command Processor to parse a single ; token addressed by HL into the FCB addressed by DE. It is ; the user's responsibility to be sure that the Command Pro- ; cessor has not been overwritten in memory. ; Revision: 4/28/88 - Set return addr by CALLing around code. HFB ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC SCAN ; External References EXT GETCCP, INITFCB, SETEPB, RESEPB ; Definitions OFFSCAN EQU 22 ; Offset to entry point for SCAN .Z80 CSEG ;=============================================================== ; NAME - SCAN ; Entry: DE - Points to an FCB to received the parsed token ; HL - Points to Command Line to scan ; Exit : - None ; Uses : - None ; Special Requirements : Command Processor must not have been ; overwritten. ;=============================================================== SCAN: PUSH AF ; Preserve registers PUSH BC PUSH DE PUSH HL CALL SETEPB ; Set external program bit CALL INITFCB LD B,8+3 ; Prepare to init FCB name & type fields LD A,' ' PUSH DE SCAN1: INC DE LD (DE),A DJNZ SCAN1 POP DE ; Restore pointer to FCB CALL SCAN2 ; Establish return address by CALLing around ; Return here from the Scanner Routine CALL RESEPB ; Reset external program bit POP HL ; Restore regs POP DE POP BC POP AF RET SCAN2: PUSH HL ; Save pointer to token CALL GETCCP ; Get ptr to Command Processor LD BC,OFFSCAN ; ..offset to scanner entry point ADD HL,BC EX (SP),HL ; SCANNER addr on stack, HL = ptr to token RET ; ..and "call" the Scanner by returning END