2 TITLE SQUOZE TABLE HANDLER FOR MUDDLE
12 .GLOBAL SQUPNT,ATOSQ,SQUTOA,GETSQU,CSQUTA,MPOPJ,SAT,SQUKIL,SQKIL
15 ; ROUTINE TO KILL FIXUP TABLE SOMETIMES
17 SQUKIL: PUSH P,0 ; SAVE ACS
18 HRRZ 0,SQUPNT ; SEE IF IN INTERPRETER
26 PUSHJ P,SQKIL ; KILL THE BUFFER AND RESTORE INTERPRETER
29 POP P,C ; RESTORE AC'S
36 ; POINTER TO TABLE FILLED IN BY INITM
38 ; SUBR TO INTERFACE TO MUDDLE SQUOZE TABLE.
39 ; IT TAKES AN ARGUMENT OF PRIMTYPE WORD AND RETURNS A FIX GIVING THE
40 ; LOCATION IF IT IS IN THE SQUOZE TABLE AND OTHERWISE RETURNS FALSE
46 PUSHJ P,SAT ; GET SAT OF ARGUMENT
47 CAIE A,S1WORD ; BETTER BE OF PRIMTYPE WORD
49 MOVE A,1(AB) ; GET ARGUMENT INTO A
55 ; COMPILER ENTRY TAKES ARGUMENT IN A
57 CSQUTA: SUBM M,(P) ; RELATAVIZE P
58 MOVE E,A ; ARG TO SQUOTA
59 TLZ E,740000 ; FLUSH EXTRA BITS FOR LOOKUP
62 SOS (P) ; AND SKIP RETURN
64 MOVSI A,TFIX ; RETURN FIX
67 GTFALS: PUSHJ P,SQUKIL
70 JRST MPOPJ ; RETURN A FALSE
73 ; GIVEN LOCN OF SUBR RET SQUO NAME ARG AND VAL IN E
80 PUSHJ P,@[.+1] ; RUN IN 0
81 MOVE A,SQUPNT ; GET TABLE POINTER
87 POPABJ: PUSH P,E ; SAVE RESULT
95 HRRI B,GOON ; RUN IN CALLERS SECTIO
114 ; BINARY SEARCH FOR SQUOZE SYMBOL ARG IN E
125 PUSHJ P,@[.+1] ; RUN IN SEC 0
127 MOVE A,SQUPNT ; POINTER TO TABLE
130 HRLI B,(B) ; B IS CURRENT OFFSET
132 UP: ASH B,-1 ; HALVE TABLE
133 AND B,[-2,,-2] ; FORCE DIVIS BY 2
134 MOVE C,A ; COPY POINTER
135 JUMPLE B,LSTHLV ; CANT GET SMALLER
137 CAMLE E,(C) ; SKIP IF EITHER FOUND OR IN TOP
138 MOVE A,C ; POINT TO SECOND HALF
139 CAMN E,(C) ; SKIP IF NOT FOUND
141 CAML E,(C) ; SKIP IF IN TOP HALF
143 HLLZS C ; FIX UP OINTER
147 WON: MOVE E,1(C) ; RET VAL IN E
154 IFN ITS, AOS -3(P) ; SKIP RET
161 HRRI B,GOON1 ; RUN IN CALLERS SECTIO
169 LSTHLV: CAMN E,(C) ; LINEAR SERCH REST
173 JRST WON1 ; ALL GONE, LOSE