
**                                            **
***  FIND A STATEMENT'S SEQUENTIAL POSITION  ***
**                                            **
* 
*  UPON ENTRY (A) POINTS TO THE LAST WORD+1 OF THE PROGRAM
*  AND (B) HOLDS A SEQUENCE NUMBER.  IF (B) IS LARGER THAN
*  ANY SEQUENCE NUMBER IN THE PROGRAM, EXIT TO (P+1) WITH 
*  (B) POINTING TO THE LAST WORD+1 OF THE PROGRAM.  IF (B)
*  FALLS BETWEEN TWO SEQUENCE NUMBERS, EXIT TO (P+2) WITH 
*  (B) POINTING TO THE STATEMENT WITH A LARGER SEQUENCE 
*  NUMBER.  IF A STATEMENT IN THE PROGRAM HAS THE SEQUENCE
*  NUMBER IN (B), EXIT TO (P+3) WITH (B) POINTING TO THIS 
*  STATEMENT (IF IT IS AN EMBEDDED ERROR MESSAGE, STATEMENT 
*  TYPE = 0, DECREMENT THE ERROR COUNT). IN ALL CASES TEMP+1
*  = (B) UPON EXIT. 
* 
#FDPS STB TEMP+1    SAVE TEST SEQUENCE NUMBER 
      STA TEMP+3    SAVE TERMINATION POINTER
      LDB PBPTR 
      CPB PBUFF 
      JMP FNDP4 
      LDB SPROG     START WITH FIRST WORD OF PROGRAM
FNDP1 CPB TEMP+3    PROGRAM EXHAUSTED?
      JMP FNDP3+2   YES, EXIT TO (P+1)
      LDA 1,I       NO, IS
      CMA,INA         PROGRAM 
      ADA TEMP+1        SEQUENCE NUMBER 
      SZA,RSS             THE SAME? 
      JMP FNDP2     YES, EXIT TO (P+3)
      SSA           NO, GREATER?
      JMP FNDP3+1   YES, EXIT TO (P+2)
      LDA B         NO, CHECK 
      INA             STATEMENT 
      LDA A,I           LENGTH AND
      ADB A               SET (B) TO
      JSB STLCK             POINT TO NEXT 
      JMP FNDP1               STATEMENT 
FNDP2 LDA 1         LOAD
      ADA .+2         STATEMENT 
      LDA 0,I       ERROR 
      AND OPMSK 
      SZA             STATEMENT?
      JMP FNDP3     NO
      CCA           YES,
      ADA ERRCT       DECREMENT 
      STA ERRCT         ERROR COUNT 
      SZA           ONLY ERROR? 
      JMP FNDP3     NO
      CLF 0 
      LDA TERR      YES-- 
      CMA             SET FLAG
      AND MAIN,I        TO SAY
      STA MAIN,I          'NO EMBEDDED ERRORS'
      STF 0 
FNDP3 ISZ FNDPS 
      ISZ FNDPS 
FNDP4 STB TEMP+1    SAVE POINTER TO 
      JMP FNDPS,I     FINAL STATEMENT SEEN
**                                 ** 
***  FETCH PARENTHESIZED FORMULA  *** 
**                                 ** 
* 
*  AN END-OF-FORMULA OPERATOR FOLLOWS THE FORMULA 
* 
#GTPF LDB .+5       SAVE FSC
      JSB FRCUR       LOCAL VARIABLES 
      JSB SBPUD     UPDATE POINTER
      JSB GETCR     RECORD
      JSB SERRS+22,I  LEFT
      JSB LPCK          PARENTHESIS 
      JSB FSC       DEMAND FORMULA
      JSB SBPUD     RECORD END-OF-FORMULA OPERATOR
      JSB RPCK      RECORD RIGHT PARENTHESIS
      JSB FPOP      RESTORE FSC 
      JMP GETPF,I     LOCAL VARIABLES 
**                       ** 
***  RECORD AN INTEGER  *** 
**                       ** 
* 
*  PRGIN FLAGS THE PREVIOUS OPERATOR TO SAY 'INTEGER FOLLOWS'.
*  STORE THE INTEGER AND EXIT WITH IT IN (B) AND THE FOLLOWING
*  CHARACTER IN (A).
* 
#PGIN LDA SBPTR,I   SET 
      IOR INTFL       'INTEGER FOLLOWS' 
      STA SBPTR,I       FLAG
      JSB SBPUD     ADVANCE POINTER 
      JSB BLDIN     BUILD INTEGER 
      STB SBPTR,I   RECORD INTEGER
      JSB SBPUD     ADVANCE POINTER 
      JMP PRGIN,I 
      SKP 
**                      **
***  BUILD AN INTEGER  ***
**                      **
* 
*  MISSING OR ILLEGAL INTEGER EXITS TO (P+2) OF PRGIN IF GFLAG = -1,
*  ELSE TO ERROR.  A LEGAL INTEGER IS NON-ZERO AND LESS THAN 10000. 
* 
#BLDI CLA           INITIALIZE TO 
      STA PINTG      ZERO INTEGER.
      JSB GETCR 
      JMP BLDI2 
      JSB DIGCK     DIGIT?
      JMP BLDI2     NO
      STA PINTG+1   YES, SAVE IT
      LDA PINTG     MULTIPLY PREVIOUS 
      MPY .+10        INTEGER BY 10 
      CLE           ADD IN
      ADA PINTG+1     NEW DIGIT 
      SEZ,SZB,RSS   OVERFLOW? 
      JMP #BLDI+1   NO
BLDI1 ISZ GFLAG     YES, RETURN ON ERROR? 
      JSB SERRS+1,I NO
      ISZ PRGIN     YES, EXIT TO
      JMP PRGIN,I     (P+2) OF PRGIN
BLDI2 LDB PINTG     ZERO
      CLE,SZB,RSS     INTEGER?
      JMP BLDI1     YES 
      ADB MAXSN     NO, INTEGER 
      SEZ             TOO LARGE?
      JMP BLDI1     YES 
      LDB PINTG     NO
      JMP BLDIN,I 
**                           ** 
***  SEEK RECORD REFERENCE  *** 
**                           ** 
* 
*  IF THE NEXT CHARACTER IS NOT '#', RESTORE SBPTR AS UPON ENTRY
*  AND EXIT TO (P+1) WITH THE CHARACTER IN (A).  OTHERWISE CHECK
*  CHARACTER RETURNED IN (A) FROM FILRF.  IF IT IS A COMMA OR A 
*  SEMICOLON RECORD IT.  EXIT TO (P+2) WITH THE CHARACTER IN (A)
*  IF IT IS A SEMICOLON.  IF A COMMA, PROCESS THE FOLLOWING RECORD
*  REFERENCE AND EXIT TO (P+2) WITH CHARACTER FOLLOWING IT IN (A) 
*  (IF A SEMICOLON, RECORD IT BEFORE EXITING).
* 
#RECR JSB FILRF     SEEK FILE REFERENCE 
      JMP RECR1     NONE FOUND
      ISZ RECRF     FOUND 
      CPA .+54B     COMMA?
      RSS           YES 
      JMP RECR0     NO
      CCA           SET 'FILE'                   [B]
      STA FILRF       FLAG                       [B]
      LDB B2000     RECORD
      STB SBPTR,I     COMMA 
      JSB FSC       PROCESS RECORD REFERENCE
RECR0 LDB B3000 
      CPA B73       SEMICOLON?
      STB SBPTR,I   YES 
      JMP RECRF,I 
RECR1 CCB           RESTORE 
      ADB SBPTR 
      STB SBPTR       SBPTR 
      JMP RECRF,I 
**                         ** 
***  SEEK FILE REFERENCE  *** 
**                         ** 
* 
*  IF THE NEXT CHARACTER IS NOT A '#' RETURN TO (P+1) WITH IT IN
*  (A).  OTHERWISE RECORD THE FILE REFERENCE AND RETURN TO (P+2)
*  WITH THE FOLLOWING CHARACTER IN (A). 
* 
#FILR ISZ SBPTR 
      JSB GETCR     NEXT
      JMP FILRF,I 
      CCB             CHARACTER 
      JSB SYMCK 
      DEF HATCH-1       A '#' ? 
      JMP FILRF,I   NO
      JSB FSC       YES, PROCESS FILE REFERENCE 
      ISZ FILRF 
      JMP FILRF,I 
**                                            **
***  SEARCH TABLE FOR MULTICHARACTER SYMBOL  ***
**                                            **
* 
*  UPON ENTRY (A) POINTS TO THE TABLE OF ACCEPTABLE 
*  SYMBOLS, (B) CONTAINS THE NUMBER OF ENTRIES IN THE 
*  TABLE (IN 2'S COMPLEMENT), MAXCR CONTAINS THE MAXIMUM
*  ACCEPTABLE NUMBER OF CHARACTERS IN THE SYMBOL, AND 
*  SBPTR,I CONTAINS THE FIRST CHARACTER OF THE PROSPECTIVE
*  SYMBOL IN BITS 7-0 AND EITHER 0 OR THE SECOND CHARACTER
*  IN BITS 15-8.  IF NO ACCEPTABLE SYMBOL IS FOUND, EXIT TO 
*  (P+1) WITH THE HALVES OF SBPTR,I SWAPPED AND THE INPUT 
*  STRING AS UPON ENTRY.  ON SUCCESS EXIT TO (P+2) WITH 
*  THE OPERATOR CODE IN BOTH (A) AND SBPTR,I; THE NEW INPUT 
*  STRING BEGINS WITH THE CHARACTER FOLLOWING THE SYMBOL. 
* 
#TBSR STA TABLE     SAVE TABLE ADDRESS
      STB LNGTH     SAVE -(NUMBER OF ENTRIES) 
      LDA MAIN      SAVE
      INA 
      LDA 0,I         BUFFER
      IOR SBP 
      JSB S14SC,I       POINTER 
      LDA SBPTR     SAVE CURRENT
      STA SMBGN       SYNTAX BUFFER POINTER 
      CLA,INA       COUNT FIRST CHARACTER 
      STA SLENG       OF SYMBOL 
      LDA SBPTR,I   LEFT JUSTIFY
      ALF,ALF         FIRST 
      STA SBPTR,I       CHARACTER 
      AND B177      TWO 
      SZA,RSS         CHARACTERS? 
      JMP TSRC4     NO
TSRC1 ISZ SLENG     COUNT NEW CHARACTER 
      LDB LNGTH     SET COUNTER 
      STB COUNT       FOR TABLE ENTRIES 
      LDA TABLE     SET POINTER 
TSRC2 STA TBLPT       TO NEXT ENTRY 
      LDA TBLPT,I   TABLE ENTRY AND 
      AND .+7         CURRENT SYMBOL
      CPA SLENG         OF SAME LENGTH? 
      JMP TSRC6     YES 
TSRC3 ADA .+3       NO, UPDATE
      ARS             TABLE 
      ADA TBLPT         POINTER 
      ISZ COUNT     MORE ENTRIES? 
      JMP TSRC2     YES 
TSRC4 JSB GETCR     NO, FETCH NEXT CHARACTER
      JMP TSR10     NONE FOUND
      LDB SLENG     SYMBOL ALREADY
      CPB MAXCR       OF MAXIMUM LENGTH?
      JMP TSR10     YES 
      SLB,RSS       NO, EVEN-NUMBERED CHARACTER?
      JMP TSRC5     NO
      IOR SBPTR,I   YES, FILL LOWER HALF
      STA SBPTR,I     OF LAST WORD OF SYMBOL
      JMP TSRC1 
TSRC5 JSB SBPUD     ADVANCE SYMBOL POINTER
      ALF,ALF       STORE CHARACTER IN
      JMP *-4         UPPER HALF OF WORD
TSRC6 LDB TBLPT     SET POINTER TO
      STB TSPTR       SYMBOL IN TABLE 
      LDB SMBGN     SET (B) TO
      JMP *+4         INPUT SYMBOL
TSRC7 CPB SBPTR     ALL OF SYMBOL MATCHED?
      JMP TSRC8     YES 
      INB           NO, ADVANCE 
      ISZ TSPTR       POINTERS
      LDA TSPTR,I   COMPARE NEXT
      CPA 1,I         WORD OF SYMBOLS 
      JMP TSRC7     EQUAL 
      LDA SLENG     UNEQUAL, TRY
      JMP TSRC3       NEXT TABLE SYMBOL 
TSRC8 LDA MAIN      FREE
      INA 
      LDA 0,I         SAVED 
      IOR FBP 
      JSB S14SC,I       BUFFER SPACE
      LDA TBLPT,I   LOAD, ISOLATE 
      AND OPMSK       AND STORE 
      STA SMBGN,I       OPERATOR CODE 
      ISZ TBSRH     SET EXIT TO (P+2) 
TSRC9 LDB SMBGN     CORRECT SYNTAX
      STB SBPTR       BUFFER POINTER
      JMP TBSRH,I 
TSR10 LDA MAIN      RESTORE 
      INA 
      LDA 0,I         BUFFER
      IOR RBP 
      JSB S14SC,I       POINTER 
      JMP TSRC9 
**                    **
***  FETCH A LETTER  ***
**                    **
* 
*  EXITS TO (P+1) IF NEXT CHARACTER NOT A LETTER. 
*  OTHERWISE STORES IT IN TEMP+1, STORES FOLLOWING
*  CHARACTER IN TEMP+2, AND EXITS TO (P+2) WITH 
*  SECOND CHARACTER IN (B). 
* 
#LTR  JSB GETCR     FIRST 
      NOP             CHARACTER 
      JSB LETCK         A LETTER? 
      JMP LTR,I     NO, EXIT WITH CHARACTER IN (A)
      ISZ LTR       YES, SET RETURN ADDRESS TO (P+2)
      STA TEMP+1    SAVE CHARACTER
      JSB GETCR     SAVE
      NOP             SECOND
      STA TEMP+2        CHARACTER 
      JMP LTR,I 
      SKP 
**                           ** 
***  STORE AN OPERAND NAME  *** 
**                           ** 
* 
*  OPERANDS ARE STORED AS 9-BIT QUANTITIES.  BITS 8-4 
*  HOLD A LETTER (1-32 OCTAL FOR A-Z).  BITS 3-0 INDICATE 
*  THE TYPE OF OPERAND:  0 FOR A STRING, 1 AND 2 FOR
*  SINGLY AND DOUBLY SUBSCRIPTED VARIABLES, 3 FOR A 
*  SUBSCRIPTED VARIABLE WITH DIMENSIONALITY NOT DEFINED 
*  LOCALLY, 4 FOR A SINGLE-LETTER SIMPLE VARIABLE, 5-16 
*  OCTAL FOR A LETTER-DIGIT SINGLE VARIABLE, AND 17 OCTAL 
*  FOR A PROGRAMMER-DEFINED FUNCTION. 
* 
#STOP ADA D100      LETTER = ASCII CODE - 100 OCTAL 
      ADB D53       DIGIT = ASCII CODE - 53 OCTAL 
      ALF           COMPLETE
      IOR 1           OPERAND 
      IOR SBPTR,I   MERGE OPERATOR
      STA SBPTR,I     AND OPERAND 
      JSB SBPUD     SET POINTER TO
      JMP STROP,I     FRESH WORD
**                                **
***  DEMAND A RIGHT PARENTHESIS  ***
**                                **
* 
*  IF (A) HOLDS ')' OR ']' RECORD A ')' AND EXIT
*  WITH THE FOLLOWING CHARACTER IN (A), ELSE ERROR. 
* 
#RPCK LDB .-2       ')' 
      JSB SYMCK       OR
      DEF RPARN-1       ']' ? 
      JSB SERRS+23,I  NO
      LDA RPOP      YES, RECORD 
      STA SBPTR,I     A ')' 
      JSB SBPUD     RECORD A NULL OPERAND 
      JSB GETCR     FETCH 
      NOP             NEXT
      JMP RPCK,I        CHARACTER 
**                       ** 
***  CHECK FOR A DIGIT  *** 
**                       ** 
* 
*  ENTER WITH CHARACTER IN (A).  IF NOT A DIGIT, EXIT 
*  TO (P+1) WITH CHARACTER IN (A); ELSE EXIT TO (P+2) 
*  WITH DIGIT (BINARY) IN (A) AND (B).
* 
#DGCK LDB 0         ASCII 
      ADB D72         72B OR
      SSB,RSS           GREATER?
      JMP DIGCK,I   YES 
      ADB .+12B     NO, ASCII 57B 
      SSB             OR LESS?
      JMP DIGCK,I   YES 
      LDA 1         NO, LOAD
      ISZ DIGCK       DIGIT 
      JMP DIGCK,I       INTO (A)
**                        **
***  CHECK FOR A LETTER  ***
**                        **
* 
*  ENTER WITH CHARACTER IN (A).  EXIT TO (P+2) IF A 
*  LETTER, ELSE EXIT TO (P+1).  (A) IS NOT CHANGED. 
* 
#LTCK LDB 0         ASCII 
      ADB D133        133B OR 
      SSB,RSS           GREATER?
      JMP LETCK,I   YES 
      ADB .+32B     NO, ASCII 101B
      SSB,RSS         OR GREATER? 
      ISZ LETCK     YES 
      JMP LETCK,I   NO
**                                          **
***  CHECK FOR SINGLE-CHARACTER OPERATORS  ***
**                                          **
* 
*  ENTER WITH CHARACTER IN (A) AND NUMBER OF ACCEPTABLE 
*  OPERATORS IN (B) IN 2'S COMPLEMENT.  (P+1)+2 POINTS
*  TO THE LIST OF ACCEPTABLE OPERATORS.  ON A MATCH 
*  EXIT TO (P+3) AFTER RECORDING THE OPERATOR CODE, 
*  WHICH REMAINS IN (A).  ON NO MATCH EXIT TO (P+2) 
*  WITH THE CHARACTER IN (A). 
* 
#SYCK STB COUNT     SAVE COUNT OF POSSIBLE MATCHES
      ALF,ALF       POSITION
      IOR .+32        CHARACTER 
      LDB SYMCK,I   LOAD
      ISZ SYMCK       STARTING
SYMC1 ADB .+2           TABLE ENTRY 
      CPA 1,I       MATCH?
      JMP SYMC2     YES 
      ISZ COUNT     NO, POSSIBILITIES LEFT? 
      JMP SYMC1     YES 
      ALF,ALF       NO, 
      AND B177        RESTORE 
      JMP SYMCK,I       CHARACTER 
SYMC2 ADB .-1       FETCH 
      LDA 1,I         AND 
      AND OPMSK         STORE 
      STA SBPTR,I         OPERATOR
      ISZ SYMCK             CODE
      JMP SYMCK,I 
      SKP 
**                                **
***  SEARCH FOR PRINT FUNCTIONS  ***
**                                **
* 
*  SEARCH THE INPUT STRING FOR A 'TAB', 'LIN' OR 'SPA' FUNCTION.
*  IF FOUND, RECORD IT AND EXIT TO (P+1). OTHERWISE RESTORE THE 
*  INPUT STRING AND SYNTAX BUFFER POINTER AND EXIT TO (P+2).
* 
#PFSH LDB .-3       3 POSSIBLE FUNCTIONS
      LDA ATAB      SEARCH
      JSB TBSRH       FOR THEM
      JMP PFSH1     NONE FOUND
      CCB           BACKUP
      ADB SBPTR       BUFFER
      STB SBPTR         POINTER 
      ALF,ALF       CONSTRUCT 
      ALF,RAR 
      IOR B,I         FUNCTION
      IOR PDFFL 
      STA B,I           OPERAND 
      JSB GETPF     FETCH PARENTHESIZED FORMULA 
      JMP PFSRH,I 
PFSH1 JSB BCKSP     BACKUP
      CCB             TO POINT
      ADB SBPTR         FOLLOWING 
      STB SBPTR           LAST OPERATOR 
      ISZ PFSRH     EXIT TO 
      JMP PFSRH,I     (P+2) 
      SKP 
**                          **
***  ALLOCATE COM STORAGE  ***
**                          **
* 
* THE BEGINNING OF THE PROGRAM IS SCANNED FOR <COM STATEMENTS>. THE 
* AMOUNT OF COM STORAGE NEEDED IS COMPUTED. A POINTER (SPROG) TO
* THE START OF THE PROGRAM IS CREATED AND THE PROGRAM IS SHIFTED TO 
* HIGHER CORE TO ALLOW FOR THE COM STORAGE. 
* 
#ALCO CLB           SAY NO COMMON 
      STB DEST        ALLOCATED YET.
      LDB PBUFF 
      STB STPTR     POINTER TO FIRST STATEMENT
ALCO1 LDA STPTR,I   SAVE STATEMENT
      STA .LNUM       NUMBER
      ISZ STPTR 
      ADB STPTR,I 
      STB NSPTR     POINTER TO NEXT STATEMENT 
      ISZ STPTR 
      LDA STPTR,I   EXTRACT 
      AND OPMSK       OPERATOR
      CPA COMOP     COM STATEMENT?
      JMP ALCO2     YES 
ALCO6 LDA DEST      GET TOTAL COMMON ALLOCATED
      SZA,RSS       EXIT IF THERE WERE
      JMP ALCOM,I     NO COM STATEMENTS 
      ADA PBUFF     PROGRAM BEGINNING MOVES BY
      STA SPROG       AMOUNT OF COMMON ALLOCATED. 
      CCB           POINTER TO FIRST
      ADB PBPTR       WORD TO BE MOVED
      LDA 1         POINTER TO
      ADA DEST        FIRST DESTINATION 
      STA DEST          LOCATION
      INA           RESET END OF
      STA PBPTR       PROGRAM POINTER.
ALCO0 LDA 1,I       MOVE A
      STA DEST,I      WORD
      CPB PBUFF     DONE? 
      JMP ALCOM,I   EXIT
      ADB .-1       NO--BUMP
      CCA 
      ADA DEST        POINTERS
      STA DEST
      JMP ALCO0         AND LOOP
ALCO2 LDA STPTR,I   EXTRACT 
      AND .+17B       OPERAND 
      SZA           STRING? 
      JMP ALCO3     NO
      ISZ STPTR     YES-- 
      ISZ STPTR       EXTRACT 
      LDA STPTR,I       LENGTH
      INA           COMPUTE 
      ARS             STORAGE 
      INA               REQUIRED
      ISZ STPTR     BUMP PAST RIGHT BRACKET 
      JMP ALCO7+1 
ALCO3 ADA .-4 
      SSA           SIMPLE VARIABLE?
      JMP ALCO4     NO
      CLA,INA       YES-- ALLOW TWO WORDS 
      JMP ALCO7 
ALCO4 ISZ STPTR     MUST BE ARRAY 
      ISZ STPTR 
      LDB STPTR,I   EXTRACT LENGTH
      ISZ STPTR 
      LDA STPTR,I   GET NEXT
      AND OPMSK       OPERATOR
      CPA SCOMM     SUBSCRIPT COMMA?
      JMP *+3       YES 
      LDA 1         NO
      JMP ALCO5+1 
      LDA 1         COMPUTE 
      ISZ STPTR       ARRAY 
      MPY STPTR,I       SIZE
      SZB           TOO BIG?
      JMP CUS1A,I   YES 
ALCO5 ISZ STPTR     BUMP PAST 
      CLE,ELA 
      SEZ,SSA,RSS   TOO BIG?
      SLA,ERA       NO
      JMP CUS1A,I   YES 
      ADA .+2       ALLOW 4 WORDS FOR DIMENSIONS
ALCO7 ALS           DOUBLE EVERYTHING 
      ADA DEST      UPDATE
      STA DEST        POINTER 
      ADA .100
      JSB CUSP      CHECK FOR STORAGE OVERFLOW
      ISZ STPTR 
      LDB STPTR 
      CPB NSPTR     END OF STATEMENT
      RSS           YES 
      JMP ALCO2     NO
      CPB PBPTR     END OF PROGRAM? 
      JMP ALCO6     YES 
      JMP ALCO1     NO
* 
CUS1A DEF CUSP1 
**                                **
***  INSURE SPACE FOR NEW ENTRY  ***
**                                **
* 
*  A CHECK IS MADE THAT THE UNUSED USER SPACE IS AT 
*  LEAST AS LARGE AS THE NUMBER OF WORDS SPECIFIED BY 
*  (A).  EXIT TO ERROR IF NOT SO.  (B) IS NOT CHANGED.
*  ON NORMAL EXIT (A) CONTAINS ITS ENTRY VALUE + (PBPTR). 
* 
#CUSP ADA PBPTR     AT LEAST
      STA CU1         (A) WORDS 
      CMA               OF AVAILABLE
      ADA LWAUS           USER
      SSA,RSS               SPACE?
      JMP *+3       YES 
CUSP1 JSB DCMPL     NO, DECOMPILE 
      JSB RERRS+10,I  OUT OF STORAGE
      LDA CU1       RETURN WITH NEW 
      JMP CUSP,I      VALUE OF PBPTR
**                                   ** 
***  ADVANCE SYNTAX BUFFER POINTER  *** 
**                                   ** 
* 
*  (A) AND (B) REMAIN AS UPON ENTRY 
* 
#SBPU STA SBT0      SAVE (A)
      ISZ SBPTR     ADVANCE POINTER 
      LDA SBPTR     BUFFER
      CPA SYNTQ       OVERFLOW? 
      JSB SERRS+31,I  YES 
      LDA SBT0      NO, RETRIEVE (A)
      JMP SBPUD,I 
**                               ** 
***  DEMAND A LEFT PARENTHESIS  *** 
**                               ** 
* 
*  INSIST CHARACTER IN (A) BE '(' OR '['.  RECORD IT
*  AS A '('.
* 
#LPCK LDB .-2       '(' 
      JSB SYMCK       OR
      DEF LBRAC-1       '[' ? 
      JSB SERRS+22,I  NO
      LDA LPOP      YES, RECORD 
      STA SBPTR,I     A '(' 
      JMP LPCK,I
**                              **
***  STATEMENT LENGTH CHECKER  ***
**                              **
* 
*  CHECK THAT (A) (THE STATEMENT LENGTH) IS BETWEEN 3 AND 105.
*  IF NOT, EXIT TO ERROR. 
#SLCK ADA .-3 
      SSA 
      JSB RERRS+49,I  TOO SMALL 
      ADA M103
      SSA 
      JMP STLCK,I   OK
      JSB RERRS+49,I  TOO BIG 
