80-Bus News

  

Spring 1985, Volume 4, Issue 1











Page 22 of 31











weOOT EQU 0 CHKSH: INC HL :CHECK EACH SWITCH FDOS EQU 5 LD A, (HL) FCB EQU 5CH cP Bt CBUFF EQU 80H JR NZ, CHKC SET BSWTCH, (IX) :SET COUNT BLANK LINES RCONF EQU 1 JR NXTSH WCONBF EQU 9 CHKC: CP ‘c! DELF EQU 19 JR NZ, CHKF SET CSWICH,(IX) :SBT COMPLETE LINE BEL EQU 07H JR NXTSW LF EQU OAH CHKF: CP OF CR EQU ODH JR NZ, CHKL ES EQU 1BH SET FSWICH, (1X) ;SET FINISH OF LINE WILD = EQUS’?! JR NXTSW CHKL: CP ‘LI! LD (STK), SP SAVE CCP STACK POINTER JR NZ, CHKN LD SP, STK SET UP STACK LD A,B CHECK NO CHARS LEFT IN COMMAND LINE XOR A SINITIALISE SWITCHES cP 3 LD IX, SWICH JP C, REPORT :IF NOT ENOUGH FOR Lad LD (IX),A CALL DIGIT PICK UP MS DIGIT INC A ‘SET DEFAULT L SWITCH LINE NO LD CLA ‘C= A * 10 LD (LIN),A ADD A.A CALL GETCUR :GET CURRENT POSITION OF CURSOR ADD ALA LD (CURPOS),HL AND SAVE IT ADD A,C LD DE, CMDFAL :CHECK THAT A STRING HAS BEEN ADD A.A LD HL, CBUFF ; SUPPLIED LD OC.A LD B, {HL} NO. CHARS IN COMMAND LINE CALL DIGIT ‘PICK UP LS DIGIT LD A,B ADD A.C ADD IN MS DIGIT cp 2 “AT LEAST THE SEPARATING SPACE AND ‘ LD (LIN),A STORE LINE COUNT JP C,REPORT ‘IF TOO SHORT A STRING SUPPLIED JR NXTSW INC HL CHKN: CP ‘N! INC HL JR NZ, CHKS LDA, (HL) SET NSWICH, (IX) ;SET NOT CONTAINED IN cp orth JR NXTSW JP NZ,REPORT -IF NO LEADING ‘ CHKS: CP ‘St LD OL,B “PICK UP LAST CHAR IN COMMAND LINE JR NZ, CHKU LD H,0 SET SSWICH,(IX) ;SET START OP LINE LD BC, CBUFF JR NXTSW ADD HL,BC CHKU: cP ‘US CHKSTR: LD A,(HL) | :SEARCH BACK FOR TRAILING – JR NZ, CHKW DEC HL SET USWTCH, (IX) :SET CONVERT TO UPPER CASE 1 JR NXTSW JR NZ, CHKSTR LIF NOT | CHKW: CP ow INC HL ‘ JP NZ, REPORT LD A,L :CALCULATE LENGTH OF STRING SET WSWICH, (IX) ;SET ? AS WILD CARD SUB CBUFF+3 NXTSW: DJNZ CHKSW :IF MORE SWITCHES JP C,REPORT IF NO TRAILING ‘ RUN: LD HL,(CURPOS} CURSOR POSITION LD (STRLEN),A AND SAVE FOR MATCH COUNT DEC L . START PROM COMMAND LINE LD A, (CBUFF} CHECK SWITCHES BACK: DEC L BACK A LINE ADD A, CBUFF JP P, CHEK ‘IF NOT OFF TOP OF SCREEN SUB OL LD HL, (CURPOS) <RESTORE CURSOR TO ORIGINAL POSN JR Z,RUN LIF NO SWITCHES SUPPLIED CALL PUTCUR cp LD DE, TOPFAL JP C,REPORT IF COMMAND TOO SHORT JP REPORT LD BLA ‘SAVE NO. SWITCHES + 1 CHEK: CALL PUTCUR :ELSE POSITION CURSOR INC HL “PICK UP SWITCH SEPARATOR CALL GETLIN ‘GET LINE FROM SVC LDA, (HL) BIT BSWTCH, (IX) :CHECK COUNT BLANK LINE SWITCH cpt JR NZ,CLIN LIF YES COUNT LINE JP -NZ,REPORT LIF NOT / LD ALC <CHECK LENGTH OF LINE DEC B “NO. OF SWITCHES OR A

JR 2Z,BACK ;IF EMPTY LINE


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











Page 22 of 31