/11 OS8 CAMP

/
/S.R.
/
/
/CASSETTE & MAGTAPE POSITIONER		(CAMP)
/
/
/
/
/
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE VITHOUT NOTICE
/AND SHOULD NOT BE CONTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
/CORPORATION. DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/FOR ANY ERRORS THAT MAY APPEAR IN THIS DOCUMENT.
/
/THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FURNISHED TO THE PURCHASER
/UNDER A LICENSE FOR USE ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED
/(WITH INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH
/SYSTEM, EXCEPT AS MAY OTHERWISE BE PROVIDED IN WRITING BY DIGITAL.
/
/DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR THE USE
/OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY
/DIGITAL.
/
/
/	COPYRIGHT (C) 1973,1975,1977 BY DIGITAL EQUIPMENT CORPORATION.
/
/
/
/

/	MUST SKIP LOCS 1000-1377

	LINBUF=1000

	XR1=11
	XR2=12
	XR3=13

	*20

TEMP,	0
T,	0
T2,	0
LINPTR,	0
T3,	0
FLAG,	0
SPKNT,	0
DEVTYP,	0		/DEVICE TYPE (BITS 6-11)
ENTRY,	0		/HANDLER ENTRY POINT
NUM,	0
TYP,	0		/0 MEANS 'F', 1 MEANS 'R'
T4,	0
DEVNUM,	0
DCW,	0		/DEVICE CONTROL WORD
DCWPTR,	0
USR,	200		/POINTS TO USR ENTRY POINT
ESCBIT,	0		/1 MEANS USER TYPED ALTMODE
CNT,	0
CTOFLG,	0		/-1 MEANS SAW ^O
COUNT,	0
PTR,	0
DHIT,	0		/DEVICE HANDLER INFO TABLE - 1
DHI,	0		/DEVICE HANDLER INFO
DBLK,	0		/DEVICE HANDLER BLOCK
VNOPTR,	0		/PTS TO VERSION # IN HANDLER
VNO,	0		/CURRENT HANDLER VERSION NUMBER
SAVPTR,	0
NO,	0		/1 MEANS 'NO'
FLG,	1		/1 MEANS SAW NO DIGITS
P,	0
RR,	0
NUCODE,	0

/	MAGTAPE SPECIAL CODES

	REWKOD=1
	SKFKOD=3	/SKIP FORWARD FILE
	UNLKOD=4
	EOFKOD=5
	SKPKOD=2	/FORWARD RECORD
	BAKKOD=SKPKOD+4000
	BKFKOD=SKFKOD+4000

	DTLA=6766

/0000-0777	/CAMP
/1000-1377	/OS/8 LINE BUFFER
/1400-1777	/PS/8 LINE BUFFER
/2000-		/CAMP
/7000-7177	/I/O BUFFER
/7200-7577	/OS/8 HANDLER
/7600-7777	/OS/8

	DLDC=6746
	DLAG=6743
	PAGE
	*200

START,	SKP
	JMP CHN
	TAD ("#
	JMS I [TYPE
	JMS I [READ	/READ A LINE INTO OS/8 LINE BUFFER
CHN,	TAD [LINBUF	/CHAIN ENTRY ADDRESS
	DCA LINPTR	/INITIALIZE POINTER TO LINE BUFFER
	STA
	JMS I [SPACE	/IGNORE LEADING SPACES
	JMS GETTWO	/GET TWO CHARS
	DCA TEMP
	JMS I [SCAN	/SCAN PAST EXTRA LETTERS OR DIGITS
	TAD TEMP
	JMS I [BRANCH	/GO TO APPROPRIATE ROUTINE
	-2313;SKIP	/SK
	-0517;EOF	/EO
	-0201;BACK	/BA
	-2205;REWIND	/RE
	-2516;UNLOAD	/UN
	-2605;VERSION	/VE
	-1005;HELP	/HE
	-2664;V4	/V4
	-2305;SYNTAX	/SE
	SETLOC=.-1
	0
	SNA CLA
	JMP I [GOAWAY
	JMP I [SYNTAX	/NONE OF THESE

/V1 FEATURES:
/FIXES SINCE FIELD TEST RELEASE:

/1.	ADDED CASSETTE SUPPORT
/2.	FIXED BUG RE IMMEDIATE ALTMOD
/3.	CHANGED SPECIAL CODES TO AGREE WITH NEW MAGTAPE HANDLER
/4.	IGNORE NULLS ON INPUT
/5.	ALLOW UNLOADING AN RK8E

/CHANGES MADE TO V3:

/1.	SET COMMAND IMPLEMENTED

/MAINTENANCE RELEASE CHANGES:

/1.	TOOK OUT 'SET' SINCE WE DON'T WANT TO SUPPORT IT 
/	UNTIL OS/8 V4
/2.	FIXED BUG RE AT EOF AND BOF MESSAGES
/3.	CHANGED CAMP TO USE NEW TM8E HANDLER
/	NOTE: CAMP WILL NOT WORK PROPERLY WITH
/	TM8E HANDLERS PRIOR TO VERSION F
/4.	PROPERLY FIND EOT EVEN IF WE'RE JUST
/	BEFORE A FILE MARK.
/5.	GIVE AT BOT OR EOT MESSAGE IF SEE REFLECTIVE SPOT
/6.	CHANGED VERSION NUMBER TO V4
/7.	ENSURE THAT USER CAN'T PASS OVER EOD

/V3D CHANGES:

/1.	FIXED BUG WITH UNLOADING RKS
/	GETTWO

/GET TWO LETTERS OR DIGITS FROM INPUT LINE, PACK IN SIXBIT
/ADVANCE PAST THEM. SUBSTITUTE NULL IF NOT FOUND.

GETTWO,	0
	JMS GETSIX
	CLL RTL
	RTL
	RTL
	DCA T2
	JMS GETSIX
	TAD T2		/COMBINE
	JMP I GETTWO

GETSIX,	0		/GET A SIXBIT LETTER OR DIGIT (OR NULL)
	JMS ALPHA	/IS IT ALPHANUMERIC?
	JMP NOTALPH	/NO
	AND [77		/YES
	JMP I GETSIX	/TRUNCATE TO SIXBIT
NOTALPH,CLA
	JMS BACKC
	JMP I GETSIX	/RETURN NULL

GETC,	0		/GET A CHARACTER, ADVANCE POINTER
	TAD I LINPTR
	AND [177	/ALWAYS RETURN 8-BIT
	SZA
	TAD [200	/WITH HIGH ORDER BIT ON
	ISZ LINPTR	/ADVANCE SCAN
	JMP I GETC	/RETURN

BACKC,	0		/MOVE SCAN POINTER BACK ONE
	STA
	TAD LINPTR
	DCA LINPTR
	JMP I BACKC	/RETURN
/RETURN 1	NOT OF TYPE DESIRED
/RETURN 2	DESIRED TYPE
/IN BOTH CASES, CHAR IS LEFT IN AC

ALPHA,	0		/LOOK FOR ALPHANUMERIC
	JMS I [GETC
	JMS LETTER	/IS IT A LETTER?
	JMP TRYDIG	/NO, TRY DIGIT
	JMP GOTAL	/YES
TRYDIG,	JMS DIGIT	/IS IT A DIGIT?
	JMP I ALPHA	/NO, AINT LETTER OR DIGIT
GOTAL,	ISZ ALPHA	/YES, EITHER LETTER OR DIGIT
	JMP I ALPHA	/RETURN WITH IT IN AC

LETTER,	0		/LOOK FOR LETTER
	TAD (-"A
	CLL
	TAD ("A-"Z-1
	SNL
	ISZ LETTER
	TAD ("Z+1	/RESTORE CHAR
	JMP I LETTER

DIGIT,	0		/LOOK FOR DIGIT
	TAD (-"0
	CLL
	TAD ("0-"9-1	/(DECIMAL)
	SNL
	ISZ DIGIT
	TAD ("9+1	/RESTORE DIGIT TO CHARACTER FORM
	JMP I DIGIT	/AND RETURN WITH IT IN AC
	PAGE
SYNTAX,	CLA
	JMS PRINT
	TEXT	/? SYNTAX ERROR/
GOAWAY,	TAD ESCBIT
	SZA CLA
	JMP I [7605	/LINE ENDED WITH ESCAPE
	TAD I [READ	/WAS 'READ' EVER CALLED?
	SZA CLA
	JMP I [START	/YES, GET A NEW LINE
	JMP I [7605	/NO, WE MUST'VE BEEN CHAINED TO, RECALL KBM

PRINT,	0
	TAD I PRINT
	RTR
	RTR
	RTR
	JMS PRIN
	TAD I PRINT
	JMS PRIN
	ISZ PRINT
	JMP PRINT+1
LV,	JMS I [CRLF
	ISZ PRINT
	JMP I PRINT

PRIN,	0
	AND [77
	SNA
	JMP LV
	TAD [240
	AND [77
	TAD [240
	DCA T3
	TAD [200
	KRS
	TAD (-203
	SNA
	JMP CTRLC
	TAD (203-217	/^O
	SNA CLA
	JMS CTRLO
	TAD T3
	JMS I [TYPE
	JMP I PRIN
CTRLC,	TAD ["^
	JMS I [TYPE
	TAD ("C
	JMS I [TYPE	/ECHO "^C"
	JMS I [DELAYY
	JMP I [7600	/THEN GO AWAY
CTRLO,	0
	KCC		/CLEAR OUT ^O
	TAD ["^
	JMS I [TYPE
	TAD ("O
	JMS I [TYPE
	JMS I [CRLF
	STA
	DCA CTOFLG	/STOP ECHOING
	JMP I CTRLO

VERSION,JMS PRINT
	TEXT	\OS/8 CAMP V5A\
	JMP I [START
NUMBIG,	JMS PRINT
	TEXT	/? NUMBER TOO BIG/
	JMP I [GOAWAY
NONEX,	JMS PRINT
	TEXT	/? CAN'T - DEVICE DOESN'T EXIST/
	JMP I [GOAWAY

SYSERR,	JMS PRINT
	TEXT	\? I/O ERROR ON SYS:\
	JMP I [GOAWAY
	PAGE
HELP,	JMS I [PRINT
	TEXT	/BACKSPACE DEV: N FILES/
	JMS I [PRINT
	TEXT	/BACKSPACE DEV: N RECORDS/
	JMS I [PRINT
	TEXT	/EOF DEV:/
H2,	JMP H1	/	JMS I [PRINT
	TEXT	/SET DEV: [NO] ATTRIB [N]/
H1,	JMS I [PRINT
	TEXT	/SKIP DEV: N FILES/
	JMS I [PRINT
	TEXT	/SKIP DEV: N RECORDS/
	JMS I [PRINT
	TEXT	/SKIP DEV: EOD/
	JMS I [PRINT
	TEXT	/REWIND DEV:/
	JMS I [PRINT
	TEXT	/UNLOAD DEV:/
	JMS I [PRINT
	TEXT	/VERSION/
	JMS I [PRINT
	TEXT	/HELP/
	JMP I [START
BADEV,	CLA
	JMS I [PRINT
	TEXT	/? CAN'T FOR THIS DEVICE/
	JMP I [GOAWAY

V4,	TAD (SET
	DCA I (SETLOC
	TAD H1
	DCA H2
	JMP I [START
	PAGE
	*2000

/ORIGIN PAST OS/8 LINE BUFFER AT 1000.
/SKIP PAST PS/8 LINE BUFFER (AT 1400) JUST IN CASE
/PS/8 USERS WISH TO PATCH THIS PROGRAM

/SCAN PAST EXTRA LETTERS OR DIGITS

SCAN,	0
	JMS I [ALPHA
	JMP NOPE
	CLA
	JMP SCAN+1
NOPE,	CLA
	JMS I [BACKC
	JMP I SCAN

/SCAN PAST SPACES; GIVE ERROR IF NO SPACES FOUND UNLESS AC=-1

SPACE,	0
	DCA FLAG	/SET AC=-1 TO PREVENT ERROR ON NO SPACES FOUND
	DCA SPKNT	/INITIALIZE SPACE COUNTER
	SKP		/JUMP INTO LOOP
GOTSP,	ISZ SPKNT
	JMS I [GETC	/GET NEXT CHAR
	TAD (-240
	SNA CLA		/IS IT A SPACE?
	JMP GOTSP	/YES, COUNT IT
	JMS I [BACKC	/NO, PUT IT BACK
	ISZ FLAG	/CHECK FLAG
	SKP		/USER DIDN'T SPECIFY FLAG
	JMP I SPACE	/-0 MEANT DON'T CHECK IF FOUND SPACE
	TAD SPKNT	/HOW MANY SPACES DID WE FIND?
	SZA CLA
	JMP I SPACE	/SOME.  OK
	JMP I [SYNTAX	/NONE.  TSK. TSK.
BRANCH,	0
	DCA T
BR2,	TAD I BRANCH
	ISZ BRANCH
	SNA
	JMP NOTFND
	TAD T
	SNA CLA
	JMP FOUND
	ISZ BRANCH
	JMP BR2

FOUND,	TAD I BRANCH
	DCA T
	JMP I T		/FOUND ITEM IN COLUMN 1, JUMP TO ADDRESS IN COL 2

NOTFND,	TAD T
	JMP I BRANCH	/IF NOT FOUND IN COL 1, RETURN WITH AC INTACT
CHECKR,	0
	TAD DCW
	RAL
	SMA CLA
	JMP I CHECKR
RONLY,	JMS I [PRINT
	TEXT	/? CAN'T - DEVICE IS READ-ONLY/
	JMP I [GOAWAY
CHECKW,	0
	TAD DCW
	RTL
	SMA CLA
	JMP I CHECKW
WONLY,	JMS I [PRINT
	TEXT	/? CAN'T - DEVICE IS WRITE-ONLY/
	JMP I [GOAWAY
ONUM,	0
	DCA NUM
	CLA IAC
	DCA FLG
ONM1,	JMS I [GETC
	TAD (-"0-10	/CONVERT TO DIGIT
	CLL
	TAD (10
	SNL
	JMP OEON
	DCA T4
	DCA FLG
	TAD NUM
	AND [7000
	SZA CLA
	JMP I [NUMBIG
	TAD NUM
	CLL RTL
	RAL
	TAD T4
	DCA NUM
	JMP ONM1
OEON,	CLA
	JMS I [BACKC
	TAD NUM
	JMP I ONUM
	PAGE
/READ A LINE INTO OS/8 LINE BUFFER

READ,	0
	DCA CTOFLG	/ALLOW ECHOING
RD1,	TAD [LINBUF
	DCA LINPTR
	DCA ESCBIT
GT,	JMS GET
LOOK,	JMS I [BRANCH
	-377;RUBOUT
	-217;GT		/^O
	-203;CTRLC	/^C
	-212;LF		/LINE FEED
	-215;CR		/CARRIAGE RETURN
	-375;ESCAPE	/ALTMODE
	-376;ESCAPE	/ALTMODE (2ND FLAVOR)
	-233;ESCAPE	/ESCAPE
	-225;CTRLU	/^U
	-200;GT		/IGNORE NULLS
	0
	DCA TEMP	/NONE OF THESE
	TAD LINPTR
	TAD (-LINBUF-377
	SNA CLA		/AT END OF LINE BUFFER?
	JMP GT		/YES, DON'T ACCEPT CHAR
	TAD TEMP	/NO, RETRIEVE CHAR
	JMS TYPE	/ECHO IT
	TAD TEMP	/INSERT IN BUFFER
	DCA I LINPTR
	ISZ LINPTR	/BUMP POINTER
	JMP GT		/NEXT

CTRLU,	TAD ["^
	JMS TYPE
	TAD ("U
	JMS TYPE	/ECHO "^U" <CR><LF>
	JMS I [CRLF
	JMP RD1
RUBOUT,	TAD LINPTR
	TAD [-LINBUF
	SNA
	JMP BOL		/AT BEGIN OF LINE
	TAD [LINBUF-1
	DCA LINPTR	/MOVE POINTER BACK ONE
	TAD ["\
	JMS TYPE	/ECHO "\"
RUB3,	TAD I LINPTR
	JMS TYPE	/ECHO RUBBED-OUT CHARACTER
GT2,	JMS GET
	JMS I [BRANCH
	-377;RUB2
	-216;GT2	/IGNORE ^O
	-203;CTRLC	/^C
	0
	DCA TEMP	/A NEW CHAR
	TAD ["\
	JMS TYPE	/ENCLOSE RUBBED-OUT CHARS IN \'S
	TAD TEMP
	JMP LOOK

RUB2,	TAD LINPTR
	TAD [-LINBUF
	SNA
	JMP BOL2
	TAD [LINBUF-1
	DCA LINPTR
	JMP RUB3

BOL2,	TAD ["\
	JMS TYPE
BOL,	JMS I [CRLF
	JMP RD1

ESCAPE,	TAD ("$		/ECHO ESCAPE AS DOLLAR SIGN
	JMS TYPE
	ISZ ESCBIT	/NOTE ESCAPE
CR,	DCA I LINPTR	/INSERT 0 AT END
	JMS I [CRLF
	JMP I READ	/RETURN, WE GOT LINE
GET,	0
	KSF
	JMP .-1
	KRB
	AND [177
	TAD [200	/FORCE TO 8-BIT
	JMP I GET

TYPE,	0
	DCA TYPEM
	JMS I [DELAYY
	DCA .-1		/DELAY FIRST TIME THRU TO LET THINGS QUIET DOWN
	TAD CTOFLG
	SZA CLA
	JMP I TYPE	/NO ECHOING
	TAD TYPEM
	TLS
	TSF
	JMP .-1
	CLA
	JMP I TYPE

TYPEM,	0

LF,	DCA I LINPTR	/TEMPORARILY INSERT A 0 SENTINEL
	TAD [LINBUF-1
	DCA XR1
	JMS I [CRLF
	TAD ["#
	JMS I [TYPE
LFLP,	TAD I XR1
	SNA
	JMP I [GT	/FINHSHED, GET SOME MORE CHARS
	JMS I [TYPE	/ECHO CURRENT CHARS
	JMP LFLP
	PAGE
EOF,	JMS I [SPACE	/SPAN OVER SPACES
	JMS I [GETDEV	/GET DEVICE
	JMS I [CHECKR
	TAD DEVTYP
	JMS I [BRANCH
	-20;MAGEOF
	-27;CASEOF
	ZBLOCK 2
	0
	JMP I [BADEV

SKIP,	JMS I [SPACE
	JMS I [GETDEV
	JMS I [CHECKW
	JMS GETNUM
	TAD DEVTYP
	JMS I [BRANCH
	-20;MAGSKP
	-27;CASSKP
	0
	JMP I [BADEV

REWIND,	JMS I [SPACE
	JMS I [GETDEV
	JMS I [CHECKW
	TAD DEVTYP
	JMS I [BRANCH
	-20;MAGREW
	-27;CASREW
	-16;TCREW
/	-17;LTREW
	ZBLOCK 4	/PATCH SPACE
	0
	TAD DCW
	SMA CLA
	JMP I [BADEV	/NOT FILE STRUCTURED
	CLA IAC		/READ BLOCK 0 TO REWIND
	DCA I [BLK
	TAD (100
	JMS I [GO
	JMP I [GOAWAY
UNLOAD,	JMS I [SPACE
	JMS I [GETDEV
	JMS I [CHECKW
	TAD DEVTYP
	JMS I [BRANCH
	-20;MAGUNL
/	-27;CASUNL
	-16;TCUNL
	-21;TDUNL
/	-17;LTUNL
	-23;RKEUNL
	ZBLOCK 2
	0
	JMP I [BADEV

BACK,	JMS I [SPACE
	JMS I [GETDEV
	JMS I [CHECKW
	JMS GETNUM
	TAD TYP
	SPA CLA
	JMP I [SYNTAX	/CAN'T BACKSPACE TO EOD
	TAD DEVTYP
	JMS I [BRANCH
	-20;MAGBAK
	-27;CASBAK
	0
	JMP I [BADEV
GETNUM,	0		/PARSE OFF :NNNN [F ! R]  OR EOD
	CLA IAC
	DCA NUM
	DCA TYP
	JMS I [GETC
	SNA
	JMP I GETNUM	/EOL
	TAD (-":
	SZA CLA
	JMP I [SYNTAX
	STA
	JMS I [SPACE	/OPTIONAL SPACES
	TAD I LINPTR
	SNA
	JMP I GETNUM	/EOL
	TAD (-"E
	SNA CLA
	JMP EO
	JMS I [NUMBER
	DCA NUM
	STA
	JMS I [SPACE	/MORE OPTIONAL SPACES
	DCA TYP
	JMS I [GETC
	SNA
	JMP I GETNUM	/NO F OR R.  F ASSUMED
	TAD (-"F
	SNA
	JMP R		/0 MEANS 'F'
	TAD ("F-"R
	SZA CLA
	JMP I [SYNTAX
	CLA IAC		/1 MEANS 'R'
R,	DCA TYP
	JMP I GETNUM
EO,	STA		/-1 MEANS 'E'
	JMP R
	PAGE
/GET A DECIMAL NUMBER, RETURN IT IN AC

NUMBER,	0
	DCA NUM
	CLA IAC
	DCA FLG
NM1,	JMS I [GETC
	JMS I [DIGIT
	JMP EON
	TAD (-"0	/CONVERT TO DIGIT
	DCA T4
	DCA FLG		/NOTE PASSAGE OF A DIGIT
	TAD NUM
	AND [7000
	SZA CLA
	JMP I [NUMBIG
	TAD NUM
	CLL RTL
	TAD NUM
	CLL RAL
	TAD T4
	SZL
	JMP I [NUMBIG
	DCA NUM
	JMP NM1

EON,	CLA
	JMS I [BACKC
	TAD FLG
	SZA
	DCA NUM		/IF NO DIGITS, RETURN A 1
	TAD NUM
	JMP I NUMBER
/	GETDEV

/PARSES OFF A DEVICE NAME (1-4 CHARS)
/DETERMINES IF IT EXISTS
/LOADS HANDLER INTO 7200-7577 IF NOT ALREADY IN CORE
/SETS ENTRY POINT ADDRESS AT 'ENTRY'
/SETS DEVICE NUMBER AT 'DEVNUM'
/SETS DEVICE CONTROL WORD AT 'DCW'
/SETS 'DEVTYP'

GETDEV,	0
	JMS I [GETTWO
	DCA WD1
	JMS I [GETTWO
	DCA WD2
	TAD WD1
	TAD WD2
	DCA WD1		/COMBINE TWO WORDS INTO 1 (IN WD1)
	TAD WD2
	SNA CLA
	JMP INQ
	TAD WD1		/OS/8 KLUDGE FOR UNIQUENESS
	CLL RAL
	STL RAR		/FORCE BIT 0 ON IF 2ND WORD WAS NON-ZERO
	DCA WD1
INQ,	DCA WD2
	CIF 10
	JMS I USR
	12		/INQUIRE
WD1,	0		/DEVICE NAME
WD2,	0		/GETS DEVICE NUMBER
WD3,	0		/GETS ENTRY POINT
	JMP I [NONEX	/DEVICE DOESN'T EXIST
	TAD WD3
	SZA		/IS HANDLER ALREADY IN CORE?
	JMP INCORE	/YES
	TAD WD1
	DCA DW1
	TAD (7201	/ALLOW TWO PAGE HANDLER IN 7200
	DCA DW3
	DCA DW2
	CIF 10
	JMS I USR
	1		/FETCH
DW1,	0		/DEVICE NAME
DW2,	0		/GETS DEVICE NUMBER
DW3,	0		/GETS ENTRY POINT
	JMP I [NONEX	/DOESN'T EXIST
	TAD DW2
	DCA DEVNUM
	TAD DW3
	DCA ENTRY
	JMP GETYP
INCORE,	DCA ENTRY
	TAD WD2
	DCA DEVNUM
GETYP,	TAD DEVNUM
	TAD (7757
	DCA DCWPTR	/POILT INTO DEVICE CONTROL WGRD TABLE
	CDF 10
	TAD I DCWPTR	/GET DCW
	DCA DCW
	TAD DCW
	RTR
	RAR
	AND [77
	DCA DEVTYP
	STA
	TAD I (37	/GET ADDRESS OF DHIT
	DCA DHIT
	TAD DHIT
	TAD DEVNUM
	DCA DHI
	TAD I DHI
	CDF 0
	DCA DHI
	TAD DHI
	RTL
	RTL
	RTL
	AND (17
	SZA
	TAD (15
	DCA DBLK
	JMP I GETDEV

DELAYY,	0
	TAD (-10
	DCA OUTER
	ISZ ZER
	JMP .-1
	ISZ OUTER
	JMP .-3
	JMP I DELAYY
ZER,	0
OUTER,	-10
	PAGE
LOADPT,	TAD I (FUNCT
	TAD (-REWKOD
	SNA CLA
	JMP I [GOAWAY	/LOAD POINT ON A REWIND IS NOT AN ERROR
READBT,	JMS I [PRINT
	TEXT	/? CAN'T - AT BOT OR EOT/
	JMP I [GOAWAY
READEOF,JMS I [PRINT
	TEXT	/% CAN'T - AT EOF/
	JMP I [GOAWAY

READBOF,JMS I [PRINT
	TEXT	/% CAN'T - AT BOF/
	JMP I [GOAWAY

CASSKP,	DCA I (DIR
	TAD TYP
	SNA CLA
	JMP CSKPF
	JMP I (NOTIMPL

CGO,	0
	DCA CFUNCT
	JMS I ENTRY
CFUNCT,	0
CBUFR,	7000
CBLK,	-1
	SKP
	JMP I CGO
	DCA TEMP
	TAD TEMP
	SMA CLA
	JMP I (END	/SOFT ERROR
	JMS I [PRINT
	TEXT	\? CAN'T - I/O ERROR\
	JMP I [GOAWAY

CASEOF,	JMS CGO
	JMP I [GOAWAY

CASREW,	TAD (REWKOD
	JMS CGO
	JMP I [GOAWAY
CSKPF,	TAD NUM
	SNA
	IAC
	CIA
	DCA COUNT
	TAD (SKFKOD
	JMS CGO
	ISZ COUNT
	JMP .-3
	JMP I [GOAWAY

CASBAK,	CLA IAC
	DCA I (DIR
	TAD TYP
	SZA CLA
	JMP CBAKBLK
	TAD NUM
	CMA
	DCA COUNT
	TAD (BKFKOD
	JMS CGO
	ISZ COUNT
	JMP .-3
	JMP I [GOAWAY

CBAKBLK,TAD NUM
	SNA
	IAC
	CIA
	DCA COUNT
	TAD (BAKKOD
	JMS CGO
	ISZ COUNT
	JMP .-3
	JMP I [GOAWAY
	PAGE
TCREW,	JMS TCR
	JMP I [GOAWAY

TCUNL,	JMS TCR
	TAD ENTRY
	IAC
	RTR
	RTR
	AND [7000
	DTLA		/SELECT ANOTHER UNIT
	JMP I [GOAWAY

TCR,	0
	TAD ENTRY
	TAD (-7607
	SZA CLA		/SYSTEM TC08 DECTAPE MUST BE UNIT 0
	TAD ENTRY
	RTR
	RTR
	AND [7000	/ISOLATE UNIT # IN BITS 0-2
	TAD (600	/GO REVERSE
	DTLA
	JMP I TCR
TDUNL,	TAD (-7607
	SZA CLA
	TAD ENTRY
	DCA TEMP
	TAD TEMP
	RTR
	RAR
	CLA RAR
	DCA UNIT
	TAD TEMP
	AND [3
	CIA
	TAD [77		/GET DEV CODE
	CLL RTL
	RAL
	TAD (6004	/BUILD 'SDLC'
	DCA BSDLC
	TAD UNIT
	TAD (3000	/GO, REVERSE
BSDLC,	HLT
	CLA
	JMP I [GOAWAY
UNIT,	0
TTCODE,	0
	TAD NO
	SZA CLA
	JMP I [SYNTAX
	JMS I [ONUM
	SNA
	JMP I [SYNTAX
	DCA NUCODE
	TAD NUCODE
	AND [7700
	SZA CLA
	JMP I [NUMBIG
	JMS I [TTST1
	TAD (7200
	DCA RR
	JMS GETIOT
	JMP I [OLDERR
	CIA
	DCA T2
TTLP,	JMS GETIOT
	JMP I [OLDERR
	CIA
	DCA T3
	TAD T3
	CIA
	TAD T2
	SNA
	JMP TTLP
	SMA CLA
	JMP .+3
	TAD T3
	DCA T2		/T2 CONTAINS NEG OF SMALLER IOT
	TAD (7200
	DCA RR
TTLP2,	JMS GETIOT
	JMP I TTCODE
	TAD T2
	SZA CLA
	CLA IAC
	TAD NUCODE
	CLL RTL
	RAL
	DCA T3
	TAD I RR
	AND (7007
	TAD T3
	DCA I RR
	JMP TTLP2
GETIOT,	0
	ISZ RR
	TAD RR
	TAD (-7600
	SNA CLA
	JMP I GETIOT
	TAD I RR
	AND [7000
	TAD [-6000
	SZA CLA
	JMP GETIOT+1
	TAD I RR
	RTR
	RAR
	AND [77
	TAD (-20
	CLL RAR
	SNA
	JMP GETIOT+1
	RAL
	TAD (20
	ISZ GETIOT
	JMP I GETIOT
	PAGE
MAGSKP,	DCA DIR
	TAD TYP
	SNA
	JMP SKPF
	SPA CLA
	JMP SKPEOD
	TAD NUM
	SNA
	CLA IAC
	CIA
	DCA WC
	TAD (SKPKOD
	JMS GO
	JMP I [GOAWAY

MAGEOF,	TAD (EOFKOD
	JMS GO
	JMP I [GOAWAY

SKPF,	TAD NUM
	SNA
	JMP SKP0
	CIA
	DCA WC
	JMS I (FUDGE	/DON'T LET GUY TRICK US INTO GOING PAST EOD
	TAD (SKFKOD
	JMS GO
	JMP I [GOAWAY

SKPEOD,	JMS I (FUDGE	/DON'T LET GUY TRICK US INTO GOING PAST EOD
	JMS I ENTRY
	SKFKOD
	0
	0		/SKIP 4096 FILES
	SMA
	SKP CLA
	JMP CHKBOT
	JMP I [GOAWAY

MAGBAK,	CLA IAC
	DCA DIR
	TAD TYP
	SNA CLA
	JMP BAKF
	TAD NUM
	SNA
	CLA IAC
	CIA
	DCA WC
	TAD (BAKKOD
	JMS GO
	JMP I [GOAWAY
BAKF,	TAD NUM
	CMA
	DCA WC2
	JMS I ENTRY
	BKFKOD
	0
WC2,	-1		/
	SMA
	SKP CLA
	JMP CHKBOT
	TAD (SKPKOD	/SKIP 1 RECORD FORWARD
	JMP SKY

CHKBOT,	DCA TEMP
	TAD TEMP
	AND (1000
	SNA CLA
	JMP IOE
	JMP I (READBT
MAGUNL,	TAD (UNLKOD
	JMS GO
	JMP I [GOAWAY

MAGREW,	TAD (REWKOD
	JMS GO
	JMP I [GOAWAY

GO,	0
	DCA FUNCT
	JMS I ENTRY
FUNCT,	0
BUFR,	7000
WC,
BLK,	-1
	SKP		/I/O ERROR
	JMP I GO
	DCA TEMP
	TAD TEMP
	SMA CLA
	JMP END		/SOFT ERROR
	TAD TEMP
	AND (1000
	SZA CLA
	JMP I [LOADPT
IOE,	TAD TEMP
	JMP I [IOERR

DIR,	0		/0- FORWARD ;  1- BACKWARDS

END,	TAD TYP
	SNA CLA
	JMP I (EODERR	/V3C NEW HANDLER CALL
	TAD DIR		/SAW FILE MARK
	SNA CLA		/V3C
	JMP I [READEOF	/AT END OF FILE
	JMP I [READBOF	/AT BEGIN OF FILE
SKP0,	JMS I ENTRY
	SKFKOD
	0		/IRRELEVANT
	-1		/ADVANCE 1 FILE
	SMA
	SKP CLA
	JMP I [IOERR	/HARD ERROR
	TAD (BAKKOD
SKY,	DCA SKX		/V3C
	JMS I ENTRY
SKX,	BAKKOD
	0		/IRREL
	-1		/BACK OVER FILE MARK
	SMA
	SKP CLA
	JMP I [IOERR
	JMP I [GOAWAY
	PAGE
IOERR,	AND (3777
	CLL RAL
	DCA TEMP
	JMS I [PRINT
	TEXT	\? CAN'T - I/O ERROR\
	TAD (-13	/11 BITS TO LOOK AT
	DCA CNT
	TAD (JLIST
	DCA JM
IOLUP,	TAD TEMP
	RAL
	DCA TEMP
	SZL
	JMP I JM
IOCONT,	ISZ JM
	ISZ CNT
	JMP IOLUP
	JMP I [GOAWAY

JM,	0

JLIST,	JMP BIT1
	JMP BIT2
	JMP BIT3
	JMP BIT4
	JMP BIT5
	JMP BIT6
	JMP BIT7
	JMP BIT8
	JMP I (BIT9
	JMP I (BIT10
	JMP I (BIT11
BIT1,	JMS I [PRINT
	TEXT	/(REWINDING)/
	JMP IOCONT
BIT2,	JMS I [PRINT
	TEXT	/(BOT)/
	JMP IOCONT
BIT3,	JMS I [PRINT
	TEXT	/(SELECT ERROR)/
	JMP IOCONT
BIT4,	JMS I [PRINT
	TEXT	/(PARITY ERROR)/
	JMP IOCONT
BIT5,	JMS I [PRINT
	TEXT	/(EOF)/
	JMP IOCONT
BIT6,	JMS I [PRINT
	TEXT	/(RECORD LENGTH INCORRECT)/
	JMP IOCONT
BIT7,	JMS I [PRINT
	TEXT	/(TIMING ERROR)/
	JMP IOCONT
BIT8,	JMS I [PRINT
	TEXT	/(EOT)/
	JMP IOCONT
RKEUNL,	CLL
	TAD ENTRY
	TAD (200
	SNL CLA
	TAD ENTRY
	AND (6		/ISOLATE UNIT
	TAD (2000	/WRITE PROTECT DISK
	DLDC		/LOAD COMMAND REGISTER
	DLAG
	JMP I [GOAWAY
	PAGE
BIT9,	JMS I [PRINT
	TEXT	/(WRITE LOCK-OUT)/
	JMP I (IOCONT
BIT10,	JMS I [PRINT
	TEXT	/(READ COMPARE ERROR)/
	JMP I (IOCONT
BIT11,	JMS I [PRINT
	TEXT	/(ILLEGAL FUNCTION)/
	JMP I (IOCONT
NOTIMPL,JMS I [PRINT
	TEXT	/% OPERATION NOT YET IMPLEMENTED/
	JMP I [GOAWAY
EODERR,	JMS I [PRINT
	TEXT	/? CAN'T - AT EOD/
	JMP I [GOAWAY
/THIS ROUTINE PREVENTS US FROM GOING PAST EOD WHEN
/SKIPPING FORWARD FILES.
/IT DOES THIS BY THE FOLLOWING ALGORITHM:
/FIRST WE BACKSPACE A RECORD.
/IF WE SAW DATA, THEN OK, WE RETURN TO THE USER;
/THIS WILL NOT AFFECT HIS SKIP FILE COUNT.
/IF WE SAW A FILE MARK, THEN WE SKIP FORWARD
/BACK OVER THAT FILE, IGNORING THE FILE MARK ERROR.
/IF WE SAW BOT, THEN, OK NO ERROR.

FUDGE,	0
	JMS I ENTRY	/V3C ALL NEW
	BAKKOD
TM,	0
	-1
	SKP
	JMP I FUDGE
	SPA
	JMS BER
	SZA CLA
	JMS FRWD
	JMP I FUDGE

/IF ERROR WAS BOT, OK

BER,	0
	DCA TM
	TAD TM
	AND (1000
	SZA CLA
	JMP I BER	/BOT OK, NO FRWD
	TAD TM
	JMP I [IOERR

FRWD,	0
	JMS I ENTRY
	SKPKOD
	0
	-1
	SMA
	SKP CLA
	JMP I [IOERR
	JMP I FRWD
	PAGE
SET,	JMS I [SPACE
	DCA VNO		/V3C
	JMS I [GETDEV
	JMS I [GETC
	JMS I [BRANCH
	-":;COLN
	-" ;COLN
	-"-;HYPH
	0
	JMP I [SYNTAX	/NO : OR BLANK AFTER NAME
COLN,	STA
	JMS I [SPACE	/IGNORE OPTIONAL SPACES
	JMS I [GETC
	SNA
	JMP I [SYNTAX
	TAD (-"-
	SNA CLA
	JMP HYPH
	JMS I [BACKC
COLN2,	DCA NAM1
	DCA NAM2
	TAD (MAIN-1	/LOOK FOR DEVICE TYPE IN MAIN TABLE
MNLUP,	DCA XR1
	TAD I XR1
	SMA SZA
	JMP NOTYP	/NOT FOUND
	TAD DEVTYP
	SNA CLA
	JMP FNDTYP
	TAD XR1
	TAD (3		/POINT TO NEXT ENTRY
	JMP MNLUP
FNDTYP,	TAD I XR1	/GET GENERIC NAME
	DCA NAM1
	TAD I XR1
	DCA NAM2
	DCA AUXFLG
	TAD I XR1	/GET PTR TO DEVICE TABLE
INTO,	DCA PTR
	DCA NO
	TAD LINPTR
	DCA SAVPTR	/SAVE SCAN POINTER
	JMS I [GETTWO
	TAD (-1617
	SNA CLA		/ARE NEXT TWO CHARS 'NO'?
	JMS SAWNO	/YES
	TAD SAVPTR	/NO
	DCA LINPTR	/RESTORE PTR
SCNLUP,	TAD I PTR
	SNA		/GET NEXT KEYWORD POINTER
	JMP NOKEY
	ISZ PTR		/POINT TO PTR TO ROUTINE
	JMS I [KEYSRCH
	JMP NOF		/NOT FOUND
	TAD I PTR	/FOUND
	DCA PTR		/GET PTR TO ROUTINE
	JMS I (HREAD	/READ HANDLER
	JMS I PTR	/CALL ROUTINE
	JMS I (HWRITE	/REWRITE HANDLER
	JMP I [GOAWAY
HYPH,	JMS I [ALPHA
	JMP I [BADV
	DCA VNO
	TAD VNO
	SNA
	JMP I [BADV
	AND [17
	DCA VNO
	JMS I [SPACE	/IGNORE SPACE
	JMP COLN2
NOKEY,	TAD AUXFLG
	SNA CLA
	JMP NOO
	JMS I [PRINT
	TEXT	\? UNKNOWN ATTRIBUTE FOR DEVICE  \
	*.-1
NAM1,	0
NAM2,	0
	0
	JMP I [GOAWAY

SAWNO,	0
	ISZ NO
	STA
	JMS I [SPACE
	TAD LINPTR
	DCA SAVPTR
	JMP I SAWNO

NOTYP,	CLA
	ISZ AUXFLG
	TAD (AUX	/SEARCH AUXILIARY TABLE
	JMP INTO
NOF,	ISZ PTR
	TAD SAVPTR
	DCA LINPTR
	JMP SCNLUP

AUXFLG,	0

NOO,	ISZ AUXFLG
	TAD (AUX
	DCA PTR
	JMP SCNLUP
	PAGE
HREAD,	0
	TAD DBLK
	SNA
	JMP RESERR
	DCA BLOCK
	JMS I (7607
	200		/READ 2 PAGES
L7200,	7200		/INTO 7200-7577
BLOCK,	0		/FROM THIS BLOCK ON SYSTEM DEVICE
	JMP I [SYSERR
	TAD DHI
	AND (177	/GET RELATIVE ENTRY PT
	TAD L7200
	DCA ENTRY
	TAD VNO
	SZA CLA		/V3C
	JMP I HREAD	/VNO ALREADY SET BY - COMMAND
	TAD ENTRY
VLOOP,	DCA VNOPTR
	TAD I VNOPTR
	CLL
	TAD (-33
	SZL CLA
	JMP BACKV
	TAD I VNOPTR
	SNA
	JMP OLDERR
	DCA VNO
	JMP I HREAD
BACKV,	STA
	TAD VNOPTR
	JMP VLOOP

RESERR,	JMS I [PRINT
	TEXT	/? CAN'T - DEVICE IS RESIDENT/
	JMP I [GOAWAY
OLDERR,	CLA
	JMS I [PRINT
	TEXT	/? CAN'T - OBSOLETE HANDLER/
	JMP I [GOAWAY

HWRITE,	0
	TAD BLOCK
	DCA BLKTWO
	JMS I (7607
	4200
	7200
BLKTWO,	0
	JMP I [SYSERR
	JMP I HWRITE
NEWERR,	CLA
	JMS I [PRINT
	TEXT	/? CAN'T - UNKNOWN VERSION OF THIS HANDLER/
	JMP I [GOAWAY
	PAGE
MAIN,	-0;	DEVICE TTY;	TTYTBL
	-1;	DEVICE PTR;	PTRTBL
	-2;	DEVICE PTP;	PTPTBL
	-3;	DEVICE CDR;	CDRTBL
	-4;	DEVICE LPT;	LPTTBL
	-20;	DEVICE MTA;	MTATBL
	1
	ZBLOCK 20
/TABLE ENDS WITH A POSITIVE NON-ZERO NUMBER
CDRTBL,	CODE;CDCODE
	ZBLOCK 4
	0

LPTTBL,	WIDTH;LPWDTH
	LC;LPLC
	LV8E;LPLV
	ZBLOCK 4
	0

MTATBL,	PARITY;MTAPAR
	DENSITY;MTADEN
	FILES;MTAFIL
	ZBLOCK 4
	0
TTYTBL,	WIDTH;TTWIDTH
	CODE;TTCODE
	ALT;TTALT
	ECHO;TTECHO
	LC;TTLC
	PAYGE;TTPAGE
	TAB;TTTAB
	FILL;TTFILL
	FLAGG;TTFLAG
	CTRL;TTCTRL
	GAG;TTGAG
	DELAY;TTDELAY
	ZBLOCK 10
	0

AUX,	LOC;GENLOC
	FILES;GENFIL
	READO;GENREA
	VERS;GENVER
	ZBLOCK 10
	0
	PAGE
WIDTH,	"W;"I;"D;"T;"H;0
LC,	"L;"C;0
LV8E,	"L;"V;4000+"8;4000+"E;0
CODE,	"C;"O;"D;"E;0
ALT,	"A;"L;"T;4000+"M;4000+"O;4000+"D;4000+"E;0
ECHO,	"E;"C;"H;"O;0
PAYGE,	"P;"A;"G;"E;0
TAB,	"T;"A;"B;0
LOC,	"L;"O;"C;4000+"A;4000+"T;4000+"I;4000+"O;4000+"N;0
FILES,	"F;"I;"L;"E;4000+"S;0
READO,	"R;"E;"A;"D;4000+"O;4000+"N;4000+"L;4000+"Y;0
VERS,	"V;"E;"R;4000+"S;4000+"I;4000+"O;4000+"N;0
PARITY,	"P;"A;"R;4000+"I;4000+"T;4000+"Y;0
DENSITY,"D;"E;"N;4000+"S;4000+"I;4000+"T;4000+"Y;0
FILL,	"F;"I;"L;"L;0
FLAGG,	"F;"L;"A;"G;0
CTRL,	"C;"T;"R;"L;0
EVEN,	"E;4000+"V;4000+"E;4000+"N;0
ODD,	"O;4000+"D;4000+"D;0
DELAY,	"D;"E;"L;"A;"Y;0
GAG,	"G;"A;"G;0
	PAGE
LPWDTH,	0
	JMS I (GETWID
	JMS LPTST1
	TAD NUM
	CMA
	DCA I (7200
	JMP I LPWDTH

LPTST1,	0
	TAD I (7201
	SPA CLA
	JMP L645
	TAD VNO
	JMS I [BRANCH
	-1;OLDERR
	-2;LPTOK
	ZBLOCK 4
	0
	JMP I [NEWERR
LPTOK,	JMP I LPTST1

L645,	JMS I [PRINT
	TEXT	/? CAN'T AFFECT ANNALEX LPT/
	JMP I [GOAWAY
ASRTST,	0
	TAD DHI
	SPA CLA
	JMP I ASRTST
	JMS I [PRINT
	TEXT	/? CAN'T - NOT KL8E HANDLER/
	JMP I [GOAWAY
GENVER,	0
	TAD NO
	SZA CLA
	JMP I [SYNTAX
	JMS I [ALPHA
	JMP BADV
	DCA NUM
	TAD NUM
	AND (40
	SZA CLA
	JMP BADV
	TAD NUM
	AND (37
	DCA I VNOPTR
	JMP I GENVER

GENREA,	0
	CDF 10
	TAD I DCWPTR
	CLL RTL
	CLL RAL
	TAD NO
	RAR
	CML RAR
	RAR
	DCA I DCWPTR
	CDF 0
	JMP I GENREA

GENFIL,	0
	CDF 10
	TAD I DCWPTR
	CLL RAL
	CLL RAL		/ZERO LINK
	TAD NO
	RAR
	CML RAR
	DCA I DCWPTR
	CDF 0
	JMP I GENFIL
BADV,	CLA
	JMS I [PRINT
	TEXT	/? BAD VERSION LETTER/
	JMP I [GOAWAY

CRLF,	0
	TAD [215
	JMS I (TYPE
	TAD [212
	JMS I (TYPE
	JMP I CRLF
	PAGE
LPLV,	0
	JMS I (LPTST1
	TAD NO
	CLL RTL
	RTL
	TAD (4
	DCA I (7201
	JMP I LPLV

LPLC,	0
	JMS I (LPTST1
	TAD NO
	CLL RTL
	RTL
	RAL
	CIA
	DCA I (7202
	JMP I LPLC

TTALT,	0
	JMS I [TTST1
	JMP I [NOTIMPL
	JMP I TTALT

TTECHO,	0
	JMS I [TTST1
	TAD NO
	SZA CLA
	TAD (SKP CLA-SZA
	TAD (SZA
	DCA I (7200+120
	JMP I TTECHO

TTPAGE,	0
	JMS I (ASRTST
	TAD VNO
	JMS I [BRANCH
	-1;OLDERR
	-2;OLDERR
	-3;OLDERR
	-4;PAGOK
	ZBLOCK 2
	0
	JMP I [NEWERR
PAGOK,	TAD I (7200+216
	TAD (-SNA
	SZA CLA
	JMP I [REASEM
	TAD NO
	SNA CLA
	TAD (SZA CLA-CLA
	TAD (CLA
	DCA I (7200+216
	JMP I TTPAGE
TTTAB,	0
	JMS I [TTST1
	JMS I [GETC
	SNA
	JMP TTEO
	TAD (-"/
	SNA CLA
	JMS I [GETC
	TAD (-"N
	SZA CLA
	JMP I [SYNTAX
	JMP NOTEC
TTEO,	TAD NO
	SNA CLA
	TAD (5000
	TAD L200
	JMS I (TECO
NOTEC,	JMS I [SRCH
L200,	200;100;7
	JMP I [REASEM
	DCA TEMP
	STA CLL RAL	/-2
	TAD TEMP
	DCA T2
	TAD TEMP
	TAD (3
	DCA T3
	TAD NO
	SNA CLA
	JMP SETAB
	TAD TEMP
	TAD (-4
	DCA T4
	TAD T4
	AND (77
	TAD (1200	/TAD TTY240
	DCA I T2
	TAD (SZA CLA
	DCA I T3
	JMP I TTTAB
SETAB,	TAD TEMP
	TAD (-12
	DCA T4
	TAD I T4
	DCA I T2
	TAD (SKP CLA
	DCA I T3
	JMP I TTTAB
	PAGE
TTFILL,	0
	JMS I [TTST1
	JMS I [SRCH
	200;100;1377
	JMP I [REASEM
	TAD (-1
	DCA TEMP
	TAD NO
	CLL RAL
	TAD (2
	TAD TEMP
	DCA T2
	TAD I T2
	DCA I TEMP
	JMP I TTFILL

REASEM,	JMS I [PRINT
	TEXT	/? CAN'T - MUST REASSEMBLE KL8E SOURCE/
	JMP I [GOAWAY

TTDELAY,0
	JMS I [TTST1
	JMP I [NOTIMPL
	JMP I TTDELAY
/ENTER WITH PTR TO POSSIBLE KEYWORD IN AC

KEYSRCH,0
	DCA KPTR
KL,	TAD I KPTR
	ISZ KPTR
	SNA
	JMP GOTKEY
	CIA
	DCA TEMP
	JMS I [ALPHA	/IS IT ALPHANUMERIC?
	JMP EOK		/NO
	TAD TEMP	/COMPARE
	CLL RAL		/LOW ORDER 11 BITS
	SNA CLA
	JMP KL		/MATCHED, KEEP LOOKING
	JMP I KEYSRCH	/DIDN'T MATCH
EOK,	JMS I [BACKC
	TAD TEMP
	CIA		/INPUT STREAM RAN OUT OR HIT SPACE
	SPA CLA
	JMP GOTKEY	/SPACE OR EOL MATCH FLAGGED CHARACTER
	JMP I KEYSRCH

KPTR,	0

GOTKEY,	JMS I [SCAN
	STA		/SKIP EXTRA STUFF
	JMS I [SPACE
	ISZ KEYSRCH	/TAKE GOOD RETURN 2
	JMP I KEYSRCH

PTRTBL,	ZBLOCK 4
	0

PTPTBL,	ZBLOCK 4
	0
	PAGE
TTGAG,	0
	JMS TTST1
	JMP I [NOTIMPL
	JMP I TTGAG

TTFLAG,	0
	JMS TTST1
	JMS I [SRCH
	200;200;247
	JMP I [REASEM
	TAD (-2
	DCA TEMP
	TAD NO
	SNA CLA
	TAD (SZA CLA-CLA
	TAD (CLA
	DCA I TEMP
	JMP I TTFLAG

TTLC,	0
	JMS TTST1
	JMS I [SRCH
	200;200;377
	JMP I [REASEM
	TAD (5
	DCA TEMP
	TAD I TEMP
	CLL
	TAD [200
	SNL CLA
	JMP I [REASEM
	TAD NO
	SNA CLA
	TAD [40		/SNA CLA
	TAD (7610	/SKP CLA
	DCA I TEMP
	JMP I TTLC

TTCTRL,	0
	JMS TTST1
	JMP I [NOTIMPL
	JMP I TTCTRL
TTWIDTH,0
	JMS GETWID
	JMS TTST1
	TAD NUM
	AND [7
	SZA CLA
	JMP I [BADWID
	TAD NUM
	TAD [-200
	SNA CLA
	JMP I [BADWID
	JMS I [SRCH
	200;200;7600
	JMP I [REASEM
	IAC
	DCA TEMP
	TAD I TEMP
	AND [177
	TAD (177+7200
	DCA T2
	TAD TEMP
	IAC
	DCA T3
	TAD NUM
	CIA
	DCA I T3
	TAD I T3
	DCA I T2
	JMP I TTWIDTH
GETWID,	0
	TAD NO
	SZA CLA
	JMP I [SYNTAX
	JMS OPTEQ
	JMS I [NUMBER
	SNA
	JMP I (BADWID
	DCA NUM
	TAD FLG
	SZA CLA
	JMP I [SYNTAX	/NO DIGITS
	TAD NUM
	AND [7400
	SZA CLA
	JMP I [NUMBIG
	JMP I GETWID

TTST1,	0
	JMS I (ASRTST
	TAD VNO
	JMS I [BRANCH
	-1;OLDERR
	-2;OLDERR
	-3;TTOK
	-4;TTOK		/V3C
	ZBLOCK 4
	0
	JMP I [NEWERR
TTOK,	JMP I TTST1
OPTEQ,	0
	JMS I [GETC
	TAD (-"=
	SZA CLA
	JMP NOE
	JMS I [SPACE
	JMP I OPTEQ
NOE,	JMS I [BACKC
	JMP I OPTEQ
	PAGE
BADWID,	JMS I [PRINT
	TEXT	/? ILLEGAL WIDTH/
	JMP I [GOAWAY

OPRIN,	0
	DCA N3
	TAD (-4
	DCA OKNT
OPLP,	TAD N3
	JMS DGP
	TAD N3
	RTL
	RAL
	DCA N3
	ISZ OKNT
	JMP OPLP
	JMP I OPRIN

DGP,	0
	RTL
	RTL
	AND [7
	TAD [60
	JMS I [TYPE
	JMP I DGP

OKNT,	0
N3,	0
NUM2,	0
GTEM,	0
SRCH,	0
	TAD I SRCH
	ISZ SRCH
	TAD (7200-1
	DCA XR1
	TAD I SRCH
	ISZ SRCH
	CIA
	DCA CNT
	TAD I SRCH
	CIA
	DCA TEMP
	ISZ SRCH
SRLUP,	TAD I XR1
	TAD TEMP
	SNA CLA
	JMP SRFND
	ISZ CNT
	JMP SRLUP
	JMP I SRCH
SRFND,	ISZ SRCH
	TAD XR1
	JMP I SRCH
GENLOC,	0
	TAD NO
	SZA CLA
	JMP I [SYNTAX
	JMS I [ONUM
	DCA NUM2
	TAD FLG
	SZA CLA
	JMP I [SYNTAX
	JMS I [GETC
	DCA TEMP
	TAD TEMP
	SNA
	JMP ENOL
	TAD (-"=
	SZA CLA
	JMP I [SYNTAX
ENOL,	TAD DHI
	SPA CLA
	TAD (-200
	TAD (-200
	CLL
	TAD NUM2
	SZL CLA
	JMP I [NUMBIG
	TAD NUM2
	TAD (7200	/BASE OF HANDLER
	DCA NUM2
	TAD TEMP
	SNA CLA
	JMP ODT
GETNEW,	JMS I [ONUM
	DCA NUM
	TAD FLG
	SZA CLA
	JMP I GENLOC
	JMS I [GETC
	SZA CLA
	JMP I [SYNTAX
	TAD NUM
	DCA I NUM2
	JMP I GENLOC
ODT,	TAD I NUM2
	JMS OPRIN
	TAD ("/
	JMS I [TYPE
	TAD I [READ
	DCA GTEM	/SAVE CHAIN STATUS
	JMS I [READ
	TAD [LINBUF
	DCA LINPTR
	TAD GTEM
	DCA I [READ
	JMP GETNEW
	PAGE
MTAPAR,	0
	TAD NO
	SZA CLA
	JMP I [SYNTAX
	JMS MTST1
	TAD LINPTR
	DCA SAVPTR
	TAD (EVEN
	JMS I [KEYSRCH
	SKP
	JMP SETE
	TAD SAVPTR
	DCA LINPTR
	TAD (ODD
	JMS I [KEYSRCH
	JMP I [SYNTAX
	TAD (400
SETE,	TAD (2
	DCA I (7200
	JMP I MTAPAR

MTST1,	0
	TAD VNO
	JMS I [BRANCH
	-1;OLDERR
	-2;OLDERR
	-3;OLDERR
	-4;MTOK
	-5;MTOK
	-6;MTOK
	ZBLOCK 4
	0
	JMP I [NEWERR
MTOK,	JMP I MTST1

MTADEN,	0
	JMS MTST1
	TAD NO
	SZA CLA
	JMP I [SYNTAX
	JMP I [NOTIMP
	JMP I MTADEN
MTAFIL,	0
	JMS MTST1
	TAD NO
	DCA I (7201
	JMP I MTAFIL

BADCOD,	JMS I [PRINT
	TEXT	/? UNKNOWN CARD CODE/
	JMP I [GOAWAY

/SUPPOSED TO WORK ON ALL VERSIONS

CDCODE,	0
	TAD NO
	SZA CLA
	JMP I [SYNTAX
	JMS I (OPTEQ
	JMS I [NUMBER
	TAD (-32	/026
	SNA
	JMP C026
	TAD (32-35	/029
	SZA CLA
	JMP BADCOD
	JMS CHANGE
	LIST1;LIST2
	JMP I CDCODE
C026,	JMS CHANGE
	LIST1;LIST3
	JMP I CDCODE
CHANGE,	0
	TAD I CHANGE
	DCA P1
	ISZ CHANGE
	TAD I CHANGE
	DCA P2
	ISZ CHANGE
CHLUP,	TAD I P1
	SNA
	JMP I CHANGE
	TAD (7200	/BASE OF HANDLER
	DCA P3
	TAD I P2
	DCA I P3
	ISZ P1
	ISZ P2
	JMP CHLUP

P1,	0
P2,	0
P3,	0
	PAGE
LIST1,	304;305;306
	314;315;316
	324;325;326;327
	334;335;336
	0

LIST2,	3203;4007;3502
	7514;0577;3637
	0104;1211;3374;0641
	7316;3410;1376

LIST3,	7735;4076;0774
	3314;1002;0305
	3204;1273;3606;1341
	3716;1175;3401
TECNAM,	FILENAME TECO.SV

TECO,	0
	DCA SA
	TAD (TECNAM
	DCA ARG1
	CLA IAC		/LOOKUP ON SYS
	CIF 10
	JMS I USR
	2
ARG1,	TECNAM		/STARTING BLOCK
	0
	JMP I TECO	/NOT FOUND
	TAD ARG1
	DCA BLKN
	JMS I (7607
	100		/READ 1 PAGE FROM TECO
	7000		/BUFFER
BLKN,	0
	JMP I [SYSERR
	TAD BLKN
	DCA BLKN2
	TAD SA
	DCA I (7002	/REL LOC 2 IS S.A.
	JMS I (7607
	4100
	7000
BLKN2,	0
	JMP I [SYSERR
	JMP I TECO

SA,	0
	PAGE

/7000-7177 BUFFER FOR TECO CCB
/7200-7577 BUFFER FOR HANDLER
	FIELD 0
	*200
	$
