80-Bus News

  

Spring 1985, Volume 4, Issue 1











Page 23 of 31











CHKFIN:

CLIN: LD A, (LIN)

DEC A

LD (LIN),A JR NZ, BACK PUSH BC

LD HL, (CURPOS) CALL PUTCUR POP BC

LD DE, LINE LD HL, CBUFF+3 LDA, (STRLEN) LD BA

OR c

JP = Z,MATCH BIT CSWTCH, (IX) JR Z,CHKFIN LD A,B

cP OC

JR NZ,NOMTCH JR PRECMP

JR = Z, PRECMP LD A.C

cP OB

JR C,NOMTCH EX DE,HL PUSH BC

LD B,0

ADD HL,BC

POP BC

LD C,B

LD B,0

OR A

SBC HL,BC

LD B,C

EX DE,HL PRECMP: INC C BEGCMP: PUSH BC

PUSH DE

PUSH HL COMP: DEC C

JR 2, NOMTCH

BIT WSWTCH, (1X)

JR = Z, CHKUP

LD A, (HL)

CP WILD

JR 2, SKPCMP

CHKUP: BIT USWTCH, (1X)

JR NZ, USHIFT LDA, (DE) JR DOCOMP

USHIFT: LD A, (DE)

CP ota!

JR €,DOCOMP CP fat+l

JR NC, DOCOMP SUB 20H

DOCOMP: IF DEBUG

PUSH AF CALL PVID LD A, (HL)

;COUNT LINE BACK

;IF REACHED LINE

;SAVE LINE LENGTH

;RESTORE CURSOR TO ORIG POSN

;RESTORE LINE LENGTH ;DE = @ DISPLAYED STRING

; IGNORE INITIAL SPACE & LEADING ‘ >B = NO. CHARS IN STRING

;IF NULL STRING AND BLANK LINE

;CHECK COMPLETE LINE SWITCH ,IF NOT SET, ANY MATCH

; COMPARE LENGTHS

}IF DIFFERENT LENGTHS

BIT FSWTCH,(IX) ;CHECK FINISH OF LINE SWITCH

:IF NOT SET

:IF DISPLAYED LINE TOO SHORT

IL := @ LINE + (C) – (B), SAVE HL ;SAVE CHAR COUNTS

;RESTORE CHAR COUNTS

;MUST COMPARE SAME NO. CHARS AS STRING

;DE = @ OF END OF STRING, RESTORE HL ;C=COUNT CHARS IN DISPLAYED STRING+1

:SAVE START GF COMPARISON

;COUNT DISPLAYED CHARS TO BE COMPARED+1

:IF DISPLAYED LINE TOO SHORT :CHECK FOR WILD CARDS

:IF NOT SET

;CHECK FOR WILD CARD IN STRING

;IF WILD CARD SKIP COMPARISON ; CHECK CASE SHIFT SWITCH ;IF CONVERT TQ UPPER CASE ;PICK UP DISPLAYED CHAR

:PICK UP DISPLAYED CHAR ;ENSURE UPPER CASE

;CONVERT TO UPPER CASE

:IF IN DEBUG MODE

;SAVE LINE CHAR

;OUTPUT LINE CHAR

;AND STRING CHAR TO BE COMPARED

CHKNOT:

CALL PVID

POP AF

ENDIF

CP {HL}

JR NZ, NXTCMP

SKPCMP: INC DE

NONTCH: LD A,1 LD HL,SWTCH 7A := (A) XOR (NSWTCH)

XOR (HL)

AND 1

JR NZ, FAIL

LD DE, OKMSG

JR REPORT FAIL: LD DE, PROMSG

CALL MSG

LD C,RCONF

CALL FDOS

AND ODFH

cp oy?

JR 2, ABORT

CP o’N’

JR NZ,PAIL

LD DE, CONMSG

JR REPORT ABORT: LD DE, SUBFCB

LD C,DELF

CALL FDOS

LD DE, DELFAL

INC A

JR Z,REPORT

LD DE, ABONSG REPORT: CALL MSG

IF DEBUG

dP = WBOOT

ELSE

LD SP, (STK)

RET

ENDIF

DIGIT: INC HL

LDA, (HL) DEC B

CP ‘Gt+1

JR NC, REPORT SUB ‘0’

JR C,REPORT RET

;RESTORE LINE CHAR

; COMPARE CHARS :IF NO MATCH :BUMP DISPLAYED STRING @

ING HL ;BUMP CHECK STRING @ DJINZ COMP :IF MORE CHARS IN CHECK STRING JR MATCH ; STRING MATCHES NXTCMP: BIT SSWICH,(1X) ; CHECK START OF LINE SWITCH JR NZ, NOMTCH ,IF YES THEN NO MATCH POP HL ; RESTORE START OF COMPARISON POP DE POP BC INC DE ;STEP TO NEXT CHAR ON DISPLAY START COMPARE DEC c ;COUNT DISPLAYED CHARS FULLY CHECKED JR BEGCMP ;FOR NEXT ATTEMPT TO MATCH MATCH: XOR A ;A = 0 FOR MATCH JR CHKNOT

:A = 1 FOR NO MATCH

; IF SUBMIT DEEMED TO HAVE FAILED ;ELSE CONTINUE WITH SUBMIT

;PROMPT FOR ABORT

;READ CON:

;REMOVE CASE BIT

LIF YES

; IF NEITHER Y OR N ENTERED

;STILL CARRY ON

;DELETE SUBMIT FILE

:IF SUBMIT FILE NOT FOUND ;ABORTED SUBMIT

:REPORT OUTCOME

; WARM BOOT

:RETURN TO CCP

;PICK UP DIGIT FROM COMMAND LINE ; COUNT CHAR ; IF NOT DECIMAL DIGIT

/IF NOT DECIMAL DIGIT ;A = BINARY :


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 23 of 31