/15 OS/8 RESOURCES PROGRAM
/
/
/
/
/
/
/
/
/
/COPYRIGHT  (C)  1974,1975,1977,1978 BY DIGITAL EQUIPMENT CORPORATION
/
/
/
/
/
/
/
/
/
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE
/AND SHOULD NOT BE CONSTRUED 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.
/
/
/
/
/
/
/
/
/
/


/	J.M.

/SAVE INFO:

/INSTRUCTIONS FOR CREATING RESORC.SV V5A

/	.MAC RESORC
/	.MAC RESOV0
/	.MAC RESOV1
/	.MAC RESOV2
/	.MAC RESOVD
/	.LINK RESORC,RESOV0,RESOV1,RESOV2,RESOVD/9/S=12000



/CORE MAP:

/0000-1777	C.D.
/2000-2377	DEVICE NAME AND LENGTH TABLE
/2400-2777	OUTPUT BUFFER (DOESN'T OVERLAP BETA REGISTER)
/3000-3377	INPUT HANDLER
/3400-3777	OUTPUT HANDLER
/4000-7377	INPUT DIRECTORY
/4000-7577	INPUT HANDLERS (LOSE 2ND HALF OF LAST ONE)

/FIELD 1

/10000-11777	USR
/11400-11777	INPUT KBM
/12000-15577	PROGRAM
/15600-16177	INPUT BLOCK 0
/16200-17577	INPUT USR

	INPBL0=5600
	INPKBM=1400
	INPUSR=6200
	INPHND=4000

	FAST=20
	DIG=21
	EXTEN=22

	DEVNUM=23	/DEVICE NUMBER OF HANDLER
	CNT=24
	PDNT=25		/PTS TO DEVICE NAME TABLE
	TEMP=26
	PUDNT=27	/PTS TO USER DEVICE NAME TABLE
	PDHIT=30	/PTS TO DEVICE HANDLER INFO TABLE
	PDCWT=31	/PTS TO DEVICE CONTROL WORD TABLE
	PTYP=32
	LFT=33
	RT=LFT+1
	DVNO=35
	BLOC=36
	PDHRT=37	/POINTS TO DEVICE HANDLER RESIDENCY TABLE
	UN=6
	X0=10
	XR1=11

	RESVERSION="A

/FIXES SINCE FIELD TEST RELEASE:

/1.	'INPUT ERROR' MESSAGE NO LONGER GARBLED
/2.	'%NON SYSTEM DEVICE' NEVER PRINTS HANDLERS

/FIXES FOR MAINTENANCE RELEASE (V3C):

/3.	INCORPORATED  PATCH SEQ NO 1 ALLOWS DISTINGUISHING BETWEEN
/	HIGH AND LOW SPEED PTR'S AND ADDITIONAL CASSETTES
/	[DSN FEB 1975]

/4.	FIXED LENGTHS OF DF32'S AND RF08'S [SUPERSEDES PATCH SEQ #2
/	DSN APR 1975]

/5.	CHANGED VERSION NUMBER TO V3, UPDATED COPYRIGHT
/6.	ADDED DUMP, LST, AND RX-- TO INTERNAL NAME TABLES

/7.	ADDED DETAILS ABOUT DUMP AND FLOPPIES TO TABLES

/V3D CHANGES:

/8.	ADDED NAMES SLU AND LQP TO TABLES
/9.	CAN DISTINGUISH LQP KIND OF LPTR
/10.	FIXED BUG ABOUT DUMPING BUFFER FULL OF NULLS
/11.	REMOVED LITTLE-USED 'OUT', 'DEV' FROM NAME TABLES

/VERSION 5

/12.	ADDED RL01 SUPPORT
/13.	CONVERTED TO MACREL
/14.	ADDED LINKER OVERLAYS
/15.	ADDED RX02 SUPPORT
/16.	ADDED VXA0 SUPPORT
	.EXTERNAL VERSN,SIZE,BLOCK,MODE, ENTRY	/IN OV3
	.EXTERNAL DIRT,KIND,CNTSLT,ZEROSL
	.EXTERNAL TYPTBL
	.GLOBAL GETTYP,PUTNAM,PUTO,PUTSP,CRLF,DPRINT
	.GLOBAL FREEDV,OPRINT,READI,SLOTAB,PRINT
	FIELD 1

	*2000

START,	SKP
	JMP NOCD	/CHAIN ENTRY POINT
/	JMS I (7700	/WE ASSUME THE USR IS IN CORE
/	10		/DON'T HAVE TO LOCK USR IN CORE IF JSW SET RIGHT
CD,	JMS I (200
	5		/COMMAND DECODE
	2331		/DEFAULT INPUT EXTENSION = 'SY'
NOCD,	DCA CTRLO
	JMS OPENO	/OPEN OUTPUT FILE
	DCA FILENO
	TAD (7617
	DCA INPTR	/POINT TO FIRST INPUT FILE
	TAD I (7644
	AND (4		/ V OPTION?
	SZA CLA
	JMS TYPEV	/OUTPUT VERSION #
	JMS SETSW
	DCA FLAG
	TAD I (7617
	SNA CLA
	JMS SPCASE	/NO FIRST ARG MEANS USE SYS: IN SPECIAL SENSE
	JMP INL2
INLOOP,	TAD I INPTR	/GET INPUT FILE # AND LENGTH
	SNA CLA
	JMP FINI	/NO MORE INPUT
	JMS PRDASH
INL2,	TAD I INPTR
	AND (17
	DCA DVNO	/GET 4-BIT DEVICE #
	ISZ FILENO
	TAD I INPTR
	AND (7760	/GET NEGATIVE OF FILE LENGTH
	DCA FILEN
	ISZ INPTR
	TAD I INPTR	/GET STARTING BLOCK OF FILE
	DCA SBLOCK
	ISZ INPTR
	TAD DVNO
	JMS GETDCW
	SMA CLA
	JMP NOFLST	/DEVICE IS NOT FILE STRUCTURED
	JMS OPENI	/GET INPUT HANDLER
	JMS DIRECT	/ASCERTAIN DIRECTORY INFO
	JMS HNDLRS	/ASCERTAIN HANDLERS
	TAD EXTEN
	SZA CLA
	JMS I (CNTSLT
	JMS MONVER	/ASCERTAIN MONITOR VERSION #
NEXT,	JMS CRLF
	DCA FLAG
	JMP INLOOP
NOFLST,	JMS PRINT
	TEXT	/%DEV IS NOT FILE STRUCTURED/
	JMP NEXT

FINI,	JMS CLOSEO	/CLOSE OUTPUT FILE
FINIS,	TAD I (7642
	SMA CLA
	JMP CD		/COMMAND LINE ENDED WITH CR
	CIF CDF 0	/COMMAND LINE ENDED WITH ALTMODE
	JMP I (7605	/GO BACK TO MONITOR

/CURRENT PIP /Y FILES ARE 50 (DEC) = 62 (OCTAL) BLOCKS LONG

GETDCW,	0
	AND (17
	TAD (7757	/GET PTR INTO DEVICE CONTROL WORD TABLE
	DCA DCW
	TAD I DCW	/GET D.C.W.
	DCA DCW		/SAVE (WHY?)
	TAD DCW
	JMP I GETDCW

SETSW,	0
	DCA FAST
	DCA EXTEN
	CLA IAC
	AND I (7643
	SNA CLA
	JMP NOTF
	ISZ FAST
	JMP I SETSW
NOTF,	TAD I (7643
	AND (200
	SNA CLA
	JMP I SETSW
	ISZ EXTEN
	ISZ FAST
	JMP I SETSW

/FAST GT 0 IF /L OR /E SWITCH SET
/EXTEN=1 IF /E SWITCH SET AND /L NOT SET
INPTR,	0		/POINTS TO INPUT FILE LIST
FILEN,	0		/INPUT FILE LENGTH (NEG IN BITS 0-7)
DCW,	0		/INPUT DEVICE CONTROL WORD
FILENO,	0		/INPUT FILE NUMBER IN INPUT LIST
SBLOCK,	0		/STARTING BLOCK # OF INPUT FILE
FLAG,	0		/NON-ZERO MEANS SPECIAL CASE OF NO FIRST ARG

SPCASE,	0
	ISZ FLAG	/NOTE SPECIAL CASE
	CLA IAC
	DCA I (7617	/FORCE FIRST INPUT TO BE SYS:
	JMP I SPCASE
	PAGE
PRINT,	0
	TAD I PRINT
	DCA PRT
	ISZ PRINT
	TAD PRT
	JMS RTR6
	JMS PR
	JMP I PRINT
	TAD PRT
	JMS PR
	JMP I PRINT
	JMP PRINT+1
PRT,	0
RTR6,	0
TTY212,	RTR
	RTR
	RTR
	JMP I RTR6

PR,	0
	AND (77
	SNA
	JMP I PR
	TAD (240
	AND (77
	TAD (240
	JMS PUTO
	ISZ PR
	JMP I PR

TPRINT,	0		/PRINT TO TELETYPE
	CLA
	TAD I TPRINT
	DCA PRT
	ISZ TPRINT
	TAD PRT
	JMS RTR6
	JMS TPUT
	TAD PRT
	JMS TPUT
	JMP TPRINT+1

TPUT,	0
	AND (77
	SNA
	JMP PUTCR
	TAD (240
	AND (77
	TAD (240
	JMS TYPE
	JMP I TPUT

PUTCR,	JMS TCRLF
	JMP I TPRINT
TYPE,	0
	DCA TYTEM
	TAD CTRLO
	SZA CLA
	JMP I TYPE	/DON'T TYPE IF CONTROL/O FLAG SET
	KSF
	SKP
	JMS LOOKC
	TAD TYTEM
A,	JMS TYPE2
	JMP I TYPE

TYTEM,	0
CTRLO,	0		/NON-ZERO MEANS CTRLO/O WAS STRUCK

TYPE2,	0
	TLS
	TSF
	JMP .-1
	CLA
	JMP I TYPE2

LOOKC,	0
	KRB
	AND (177
	TAD (-17
	SNA		/IS IT ^O?
	JMP CTROLO	/YES
	TAD (17-3	/NO
	SZA CLA		/IS IT ^C?
	JMP I LOOKC	/NO
	CIF CDF 0	/YES
	JMP I (7605
CTROLO,	TAD ("^
	JMS TYPE2
	TAD ("O
	JMS TYPE2
	ISZ CTRLO
	TAD (215
	JMS TYPE2
	TAD TTY212
	JMP A

/*** NEEDS CTRL/S CTRL/Q SUPPORT
TYPEV,	0
	JMS PRINT
	TEXT	/RESORC V5 /
	*.-2
	RESVERSION&77+6500	/THIS OVERLAYS ABOVE VERSION NO
				/AND THE 6500 INCREASES TO 6600
				/FOR THE NEXT RELEASE
	*.+1
	JMS CRLF
	JMP I TYPEV

CRLF,	0
	TAD (215
	JMS PUTO
	TAD TTY212
	JMS PUTO
	JMP I CRLF

TCRLF,	0
	TAD (215
	JMS TYPE
	TAD TTY212
	JMS TYPE
	JMP I TCRLF

DLST,	-1750	/1000
	-144	/100
	-12	/10
	-1	/1
	0	/END
	PAGE
CLOSEO,	0		/CLOSE OUTPUT FILE
	TAD (232	/PUT ^Z IN BUFFER
	JMS PUTO
	TAD (-577	/V3D
	DCA KNT		/SEND 577 NULLS TO OUTPUT BUFFER
	JMS PUTO	/THIS GUARANTEES TO PURGE IT
	ISZ KNT
	JMP .-2
	TAD I (7600
	JMS I (200
	4		/CLOSE
L7601,	7601		/POINTER TO OUTPUT FILE NAME
OUTLEN,	0		/LENGTH OF OUTPUT FILE
	HLT		/SYSTEM ERROR, CANNOT OCCUR
	JMP I CLOSEO
OPENO,	0
	JMS OINIT
	DCA OUTLEN
	TAD (3401
	DCA OENTRY
	TAD I (7600
	SNA CLA
	JMP DEFALT
	TAD I (7600
	JMS GETDCW
	RAL
	SPA CLA
	JMP NOWR	/READ ONLY
	TAD I (7600
	JMS I (200
	1		/FETCH DEVICE HANDLER (POSSIBLY 2-PAGE)
OENTRY,	3401		/INTO PAGE 3400
	HLT		/SYSTEM ERROR CANNOT OCCUR
O2,	TAD L7601
	DCA SBLKO
	TAD I L7601
	SNA
	TAD (2205	/RE
	DCA I L7601	/DEFAULT OUTPUT NAME IS RE
	DCA OLEN
	TAD I (7604
	SNA
	TAD (1423	/LS
	DCA I (7604	/ .LS IS DEFAULT OUTPUT EXTENSION
	TAD I (7600
	JMS I (200
	3		/ENTER OUTPUT FILE
SBLKO,	7601		/POINTS TO OUTPUT FILE NAME
OLEN,	0		/COMPLEMENT OF ACTUAL OUTPUT FILE LENGTH
	JMP DEVFUL	/OUTPUT DEVICE FULL
	TAD SBLKO
	DCA OBLOCK
	TAD OLEN
	SZA
	TAD (-1
	DCA OLEN
	JMP I OPENO

KNT,	0
DEFALT,	TAD (3100	/SET TTY: AS DEFAULT OUTPUT DEVICE
	DCA DVN
	TAD (3401
	DCA OENT
	JMS I (200
	1		/FETCH HANDLER BY NAME
	2424		/TT
DVN,	3100		/DEVICE TTY:
OENT,	3401		/INTO 3400
	JMP NOTTY	/NO TTY: ON SYS:
	TAD OENT
	DCA OENTRY
	TAD DVN
	DCA I (7600
	JMP O2

OUTERR,	JMS TPRINT
	TEXT	/?OUTPUT ERROR/
	JMS CRLF
	JMP FINIS
TRY09,	0
	TAD (60
	CIA
	TAD NAM
	DCA DIG
	TAD DIG
	CLL
	TAD (-10	/TRY DIGITS 0-7
	SZL CLA
	JMP I TRY09
	TAD DIG
	TAD (60
	TAD RT
	DCA RT
	JMP GOTIT

PUTSP,	0
	TAD (40
	JMS PUTO
	JMP I PUTSP
	PAGE
PUTO,	0
	AND (377
	CDF 0
	JMP I PUTJMP
PUTJMP,	X1
X1,	DCA I PUTPT1
	TAD (X2
	DCA PUTJMP
PUTLV,	CDF 10
	JMP I PUTO	/RETURN

X2,	DCA I PUTPT2
	TAD (X3
	DCA PUTJMP
	JMP PUTLV

X3,	DCA TMP
	TAD TMP
	CLL RTL
	RTL
	AND (7400
	TAD I PUTPT1
	DCA I PUTPT1
	TAD TMP
	CLL RTR
	RTR
	RAR
	AND (7400
	TAD I PUTPT2
	DCA I PUTPT2
	ISZ PUTPT1
	ISZ PUTPT1
	ISZ PUTPT2
	ISZ PUTPT2
	TAD (X1
	DCA PUTJMP
	ISZ PUTKNT
	JMP PUTLV
	CDF 10		/BUFFER FILLED
	ISZ OLEN
	SKP
	JMP DEVFUL	/CAN'T WRITE ANYMORE
	CIF 0
	TAD OENTRY
	DCA OENTR	/GET ON SAME PAGE
	JMS I OENTR
	4200		/WRITE 1 BLOCK
	2400		/FIELD 0, LOC 2400
OBLOCK,	0		/OUTPUT BLOCK #
	JMP OUTERR
	ISZ OUTLEN
	ISZ OBLOCK	/POINT TO NEXT BLOCK
	JMS OINIT
	JMP I PUTO	/RETURN
OENTR,	0
PUTPT1,	0
PUTPT2,	0
PUTKNT,	0

TMP,	0
DIRECT,	0
	TAD SBLOCK
	SZA CLA
	JMP I DIRECT	/NO DIRECTORY INFO FOR FILES
	JMS I (DIRT
	JMP I DIRECT

SLOTAB,	ZBLOCK 10	/KEEPS TRACK OF USED SLOTS

GETTYP,	0
	CDF 0
	TAD I PTYP
	CDF 10
	JMP I GETTYP
PUTNAM,	0
	DCA PUTNMT
	TAD I PUTNMT
	JMS PUTPAK
	ISZ PUTNMT
	TAD I PUTNMT
	JMS PUTPAK
	JMP I PUTNAM
PUTNMT,	0
/THIS PRINTS A 4 CHAR NAME, ARG IN AC.

COMB,	0		/TEMP
	TAD LFT
	TAD RT
	SMA
	TAD (4000
	JMP I COMB
	PAGE
NAME,	0
	DCA NAM
	TAD FAST
	SZA CLA
	JMP TRY1
	STA
	TAD DEVNUM
	SNA CLA
	JMP TRY1
	TAD (",
	JMS PUTO
TRY1,	TAD (LIST1
	DCA NM1
LP1,	TAD I NM1
	SNA
	JMP TRY2
	DCA LFT
	ISZ NM1		/TRY A-B
	TAD (-2		/CHANGE TO -4 TO TRY A-D
	DCA TEMP
	DCA RT
LP1X,	TAD RT
	TAD (100
	DCA RT
	JMS COMB
	JMS TRY09
	ISZ TEMP
	JMP LP1X
	JMP LP1

NAM,	0		/SPECIFIED NAME
NM1,	0

TRY2,	TAD (LIST2
	DCA NM1
LP2,	TAD I NM1
	SNA
	JMP TRY3
	DCA LFT
	ISZ NM1
	TAD I NM1
	ISZ NM1
	DCA RT
	JMS COMB
	DCA TEMP
	TAD TEMP
	CIA
	TAD NAM
	SNA CLA
	JMP GOTIT
	TAD TEMP
	JMS TRY09
	JMP LP2
/TRY0 SHOULD BE SPECIAL CASE TESTS

TRY3,	TAD NAM
	JMS RTR6
	AND (37
	SNA
	JMP TRY4
	JMS SETIFA
	CLL RAR
	JMS RTR6
	DCA LFT
	TAD NAM
	AND (77
	JMS SETIFA
	TAD LFT
	DCA LFT
	DCA RT
	JMP GOTIT

SETIFA,	0
	SNA
	JMP I SETIFA
	TAD (-33
	SPA
	JMP LETR
	TAD (33-60
	CLL
	TAD (-12
	SZL
	JMP NODI
	TAD (12+60-33
LETR,	TAD (33
	JMP I SETIFA
NODI,	CLA
TRY4,	TAD NAM
	JMS NNAME
NAMLV,	JMP I NAME
CMFLG,	0

/COMB,	0
/	TAD RT
/	SZA CLA
/	STA
/	DCA CMFLG
/	TAD LFT
/	TAD RT
/	ISZ CMFLG
/	JMP I COMB
/	CLL RAL
/	STL RAR
/	JMP I COMB	/TURN ON BIT 0 OF 1 WORD NAME

LIST1,		TEXT	/DTMTLTTDCSRKRFRXVX/

PRDASH,	0
	JMS PRINT
	TEXT	/----/
	JMS CRLF
	JMS CRLF
	JMP I PRDASH
RTL6,	0
	RTL
	RTL
	RTL
	JMP I RTL6
	PAGE
DEVFUL,	JMS TPRINT
	TEXT	/?OUTPUT DEV FULL/
	JMP FINIS

NOWR,	JMS TPRINT
	TEXT	/?OUTPUT DEV IS READ-ONLY/
	JMP FINIS
NOTTY,	JMS TPRINT
	TEXT	/?TTY DOES NOT EXIST/
	JMP FINIS
OINIT,	0
	TAD (-200
	DCA PUTKNT
	TAD (2400
	DCA PUTPT1
	TAD (2401
	DCA PUTPT2
	TAD (X1
	DCA PUTJMP
	JMP I OINIT
READI,	0
	TAD I READI
	DCA ARG1
	ISZ READI
	TAD I READI
	DCA ARG2
	ISZ READI
	TAD I READI
	DCA ARG3
	ISZ READI
	CIF 0
	JMS I IENTRY
ARG1,	0
ARG2,	0
ARG3,	0
	JMP INERR
	JMP I READI	/REURN

INERR,	JMS TPRINT
	TEXT	/?INPUT ERROR/
	JMP FINIS

OPENI,	0		/FECTH INPUT HANDLER
	TAD (3001	/INTO PAGES 3000, 3200
	DCA IENTRY
	TAD DVNO
	JMS I (200
	1		/FETCH HANDLER
IENTRY,	3001
	HLT		/SYSTEM ERROR, CAN'T OCCUR
	JMP I OPENI
	PAGE
/DECIMAL PRINT
/LINK OFF MEANS PRINT LEADING SPACES
/LINK ON MEANS DON'T PRINT LEADING SPACES OR ZEROS

DPRINT,	0
	DCA DTM
	RAR
	DCA LNK
	DCA ZFLG
	TAD (DLST
	DCA PLST
DPL2,	DCA DYG
DPLUP,	TAD I PLST
	SNA
	JMP I DPRINT
	CLL
	TAD DTM
	SNL
	JMP NEGG
	ISZ DYG
	DCA DTM
	JMP DPLUP

NEGG,	CLA
	TAD DYG
	TAD ZFLG
	SNA
	JMP PRBLNK
	TAD (60
	JMS PUTO
	STL CLA RAR	/4000
	DCA ZFLG
ISZZ,	ISZ PLST
	JMP DPL2

PRBLNK,	TAD LNK
	CLL RAL
	TAD L40
	SNL
	JMS PUTO
	CLA
	JMP ISZZ
DYG,	0
PLST,	0
ZFLG,	0		/4000 MEANS PASSED LEADING ZEROES
LNK,	0
/PRINTS A 2-DIGIT OCTAL NUMBER WITH LEADING 0'S

OPRINT,	0
	DCA OTEM
	TAD OTEM
	RTR
	RAR
	JMS OPRI
	TAD OTEM
	JMS OPRI
	JMP I OPRINT

OPRI,	0
	AND (7
	TAD (260
	JMS PUTO
	JMP I OPRI

PRINT4,	0
	DCA DTM
	TAD DTM
	JMS RTR6
	JMS OPRINT
	TAD DTM
	JMS OPRINT
	JMP I PRINT4

DTM,	0

PUTPAK,	0
	DCA DTM
	TAD DTM
	JMS RTR6
	JMS PR
	JMS BLNKIT
	TAD DTM
	JMS PR
	JMS BLNKIT
	JMP I PUTPAK

BLNKIT,	0
	TAD FAST
	SZA CLA
	TAD L40
	JMS PR
L40,	40		/CAN'T HURT TO CALL PR WITH A 0
	JMP I BLNKIT
OTEM,	0
/DIR DID NOT GET IN CORE ON /F?

DEV,	DCA BLCK0
	TAD (66
	DCA BLCK66
	TAD (7
	DCA KBM
	TAD (13
	DCA USRBLK
	CDF 0
	TAD I (4001	/GET STARTING BLOCK # OF FILES
	CDF 10
	TAD (-7
	SNA CLA
	JMP NONSYS	/FILES START AT BLOCK 7 OF DEVICE
	TAD (16
/CHECK TO SEE THAT DEVICE HAS SYSTEM ON IT
	JMP RD

NONSYS,	JMS PRINT
	TEXT	/%NON SYSTEM DEVICE/
	JMP NEXT
	PAGE
MONVER,	0
	TAD FAST
	SNA CLA
	JMP I MONVER
	TAD I (1400
	TAD (-7607
	SNA
	JMP NOTV3
	TAD (7607+60
	DCA TEMPX
	TAD I (1400+31
	DCA TMPTWO
OS8,	TAD ("O
	JMS PUTO
MONV2,	JMS PRINT
	TEXT	\S/8 V\
	TAD TEMPX
	JMS PUTO
	TAD TMPTWO
	JMS PUTO
	JMS CRLF
	JMP I MONVER

TMPTWO,	0
TEMPX,	0

NOTV3,	TAD (40
	DCA TMPTWO
/CHECK FOR PS/8 AND COS
	JMP OS8
LIST2,	DEVICE LPT
	DEVICE TTY
	DEVICE PTR
	DEVICE PTP
	DEVICE CDR
	DEVICE SYS
	DEVICE DSK
	DEVICE CDP
/	DEVICE DEV
/	DEVICE OUT
/	DEVICE INP
	DEVICE BAT
	DEVICE NULL	/SHOULD BE IN NEXT TABLE
	DEVICE LST	/V3C
	DEVICE DUMP
	DEVICE SLU
	DEVICE LQP
	DEVICE RL0A
	DEVICE RL0B
	DEVICE RL0C
	DEVICE RL1A
	DEVICE RL1B
	DEVICE RL1C
	DEVICE RL2A
	DEVICE RL2B
	DEVICE RL2C
	DEVICE RL3A
	DEVICE RL3B
	DEVICE RL3C
	DEVICE VXA0
	0

/LIST3,	DEVICE NULL
/	DEVICE TEST
/	DEVICE LIST
/	DEVICE DUMP	/V3C
/	ZBLOCK 2	/PATCH SPACE
/	0

/INTERESTING NOTE: 'BAT', 'FOO2' AND 'RKC6' ALL HASH OUT TO 6601
/** WANT TO CHANGE AIW PRINTER TO SAY 'NO' ADDITIONAL INFO WORDS
/IF THERE ARE NONE.
/DTN
/DKN
GOTIT,	TAD FAST
	SZA CLA
	JMS PUTSP
	TAD (LFT
	JMS PUTNAM
	TAD FAST
	SZA CLA
	JMS PUTSP
	JMP NAMLV
BADFIL,	JMS PRINT
	TEXT	/%NOT A SYSTEM HEAD/
	JMP NEXT
	PAGE
/FORMAT OF SYSTEM HEAD FILE

/REL BLK	CONTENTS	ABS BLK ON DEV

/0	BOOTSTRAP & PAGE 0'S	0
/1-4	KEYBOARD MONITOR	7-12
/5-7	USR			13-15
/10-17	DEVICE HANDLERS		16-25
/20	ENTER			26
/21-42	SCRATCH BLOCKS		27-50
/43-45	COMMAND DECODER		51-53
/46-47	SAVE,DATE		54-55
/50	ERROR OVERLAY		56
/51	CHAIN OVERLAY		57
/52-55	ODT			60-63
/56	RESERVED FOR EXPN	64
/57	CCL SCRATCH		65
/60	12K TD8E HANDLER	66
/61	CCL OVERLAY		67
HNDLRS,	0
	TAD SBLOCK
	SNA		/IS IT A FILE?
	JMP DEV		/NO
	DCA BLCK0	/YES
	TAD BLCK0
	TAD (60
	DCA BLCK66
	TAD FILEN
	TAD (-6340
	SZA CLA
	JMP BADFIL	/FILE DOESN'T HAVE LENGTH 50 (DECIMAL)
	TAD BLCK0
	IAC
	DCA KBM
	TAD BLCK0
	TAD (5
	DCA USRBLK
	TAD BLCK0
	TAD (10
RD,	DCA HNDBLK
	JMS READI	/READ IN BLOCK 0
	210		/2 PAGES
	INPBL0
FREEDV,		/# OF FREE DEVICE NUMBERS
BLCK0,	0
	TAD I (INPBL0+212	/** DEPENDS ON TD8E HANDLER
	TAD (-3
	SZA CLA		/IS IT 12K TD8E?
	JMP NOTD8E	/NO
	JMS READI	/YES
	110		/1 PAGE
	INPBL0
BLCK66,	66
NOTD8E,	TAD I (INPBL0+200
	TAD (-4207
	SZA CLA
	JMP BADMON	/BAD MONITOR ON DEVICE
	DCA 7		/DELETE CURRENT USR DIRECTORY SEGMENT
			/SINCE KBM READS OVER IT
	JMS READI	/READ IN KEYBOARD MONITOR
	211		/ONLY FIRST 2 PAGES
	INPKBM
KBM,	7
	JMS READI	/READ IN USR
	611		/6 PAGES
	INPUSR
USRBLK,	13
	JMS READI	/READ IN ALL HANDLERS (EXCEPT 2ND PAGE OF LAST ONE)
	1700		/17 PAGES
	INPHND
HNDBLK,	16
	TAD (-17
	DCA CNT
	DCA FREEDV
	JMS ZEROSL
	DCA DEVNUM
	JMS SETPTS
	JMS HEADING
LOOP,	ISZ DEVNUM	/PT TO NEXT HANDLER
	TAD I PDNT	/LOOK AT DEVICE NAME
	SNA CLA
	JMP NOXXT
	TAD EXTEN
	SNA CLA
	JMP NONUM
	TAD DEVNUM
	JMS OPRINT
NONUM,	TAD I PDNT
	JMS NAME	/PRINT NAME
	TAD FAST
	SNA CLA
	JMP NEXXT
	JMS TIPE	/PRINT TYPE
	TAD EXTEN
	SNA CLA
	JMP PUSER
	JMS MODE	/PRINT MODE
	JMS SIZE	/PRINT SIZE
	JMS BLOCK	/PRINT BLOCK # OF LOC OF HANDLER
	STA
	DCA UN
	JMS KIND	/PRINT KIND
	JMS VERSN	/PRINT HANDLER VERSION #
	JMS ENTRY
PUSER,	TAD I PUDNT
	SNA CLA
	JMP EOL
	TAD I PUDNT
	JMS NAME	/PRINT USER NAME
EOL,	JMS CRLF
NEXXT,	ISZ PDNT
	ISZ PUDNT
	ISZ PDHIT
	ISZ PDCWT
	ISZ PDHRT
	ISZ CNT
	JMP LOOP
	JMS CRLF
	JMP I HNDLRS

NOXXT,	ISZ FREEDV
	JMP NEXXT
	PAGE
HEADING,0
	TAD FAST
	SNA CLA
	JMP I HEADING
	TAD EXTEN
	SNA CLA
	JMP REGLR
	JMS PRINT
	TEXT	/#  NAME TYPE MODE SIZ BLK KIND U V ENT USER/
	JMP HDLV
REGLR,	JMS PRINT
	TEXT	/ NAME TYPE USER/
HDLV,	JMS CRLF
	JMP I HEADING
SETPTS,	0
	TAD I (INPUSR+36
	TAD (INPUSR
	DCA PDNT
	TAD FLAG
	SZA CLA
	TAD (7741-141-INPBL0
	TAD (INPBL0+141
	DCA PUDNT
/CHANGE FOR FLAG?
	TAD I (INPUSR+37
	TAD (INPUSR
	DCA PDHIT
/FLAG?
	TAD (INPBL0+160
	DCA PDCWT
	TAD (INPBL0+47
	DCA PDHRT	/DEVICE HANDLER RESIDENCY TABLE
	JMP I SETPTS
CODE,	0		/DEVICE CODE

NNAME,	0
	DCA TIPE
	TAD ("(
	JMS PUTO
	TAD TIPE
	JMS PRINT4
	TAD (")
	JMS PUTO
	JMP I NNAME

TIPE,	0
	TAD I PDCWT
	RTR
	RAR
	AND (77
	DCA CODE
	TAD CODE
	CLL RTL
	TAD (TYPTBL
	DCA PTYP
	JMS GETTYP
	ISZ PTYP
	SNA
	JMP UNKN
	JMS PUTPAK
	JMS GETTYP
	JMS PUTPAK
	ISZ PTYP	/POINT TO SIZE
	JMP I TIPE
UNKN,	JMS PUTSP
	TAD CODE
	JMS OPRINT
	JMS PUTSP
	ISZ PTYP
	JMP I TIPE
BADMON,	JMS PRINT
	TEXT	/%BAD MONITOR/
	JMP NEXT
	PAGE
	PAGE

