	.TITLE RFBOOT --DECDISK BOOTSTRAP

/

/COPYRIGHT (C) 1975

/DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

/

/THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY

/ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH

/THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS

/SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-

/VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

/EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO

/THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE

/SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

/

/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE

/WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-

/MITMENT BY DIGITAL EQUIPMENT CORPORATION.

/

/DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY

/OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

	.EJECT

/

/

/ EDIT# 011		DATE OF LAST EDIT 8.24.71

/ EDIT #012	1/23/74	SCR	CLEAR ROUTINE; TURN OFF VT

/      #013	3-JUL-74 BY ED GARDNER  ADD DELAY BETWEEN STPD (TO VT15)

/					AND CAF IN RIOCLR

/	#014	SCR	8/4/74	UC15 CONDITIONALIZATION ADDED. WHEN USING UC15

/				WITH RF SYSTEM, THE BOOTSTRAP MUST SEND A CLEAR

/				REQUEST TO PIREX.. OTHER EDITS ARE TO FREE SPACE.

/				IF UC15 IS NOT SPECIFIED 014 BIN MATCHES 013.

/	#015	SCR	8/29/75	PUT EBA AT .BOOT

/	#016	SCR	9/2/75	COPYRIGHT

/	#017	SCR	9/17/75	REMOVE ADSS ETC.

/

/SPECIAL VERSION TO CONVERT DECTAPE

/UNITS 0-7 TO DISK WORD ADDRESSES.

/DT0 = PLATTER 0, WORD 0.

/DT1 = PLATTER 0, WORD 400,000.

/DT2 = PLATTER 1, WORD 0.

/DT3 = PLATTER 1, WORD 400,000.

/DT4 = PLATTER 2, WORD 0.

/DT5 = PLATTER 2, WORD 400,000.

/DT6 = PLATTER 3, WORD 0.

/DT7 = PLATTER 3, WORD 400,000.

/

/IF ENTERED VIA .DTBEG OR .DTOUT, 5 CELLS MUST BE SET:

/	.DTBLK = LOGICAL DISK BL# (0-1077) WHERE 1 BL. = 256 WDS

/	.DTCA = CORE ADDRESS -1

/	.DTWC = -WC (2'S COMP) TO BE TRANSFERED

/	.SCOM+5 = START ADDR. WHEN LOAD COMPLETE

/	.DTSRC = UNIT #(0-2) *** IGNORED IN DOS ***

/

/

DSSF=707001	/SKIP IF DISK FLAG

DSCC=707021	/CLEAR DISK CONTROL, DISABLING "FREEZE".

DRAL=707022+10	/CLEAR AC, XOR AP0 INTO AC.

DRAH=707062+10	/CLEAR AC, XOR AP1 INTO AC.

DLAL=707024	/LOAD AC(0-17) INTO AP0.

DLAH=707064	/LOAD AC(15-17) INTO AP1.

DSCF=707041	/CLEAR FUNCTION REGISTER.

DSFX=707042	/XOR AC(15-17) INTO FUNCTION REGISTER.

DSCN=707044	/EXECUTE CONDITION IN FUNCTION REGISTER.

DSCD=707242	/CLEAR STATUS REGISTER AND DISK FLAG.

DSRS=707262+10	/CLEAR AC, XOR STATUS INTO AC.

EBA=707764

EEM=707702	/PDP-9 COMPATABILITY

LIOR=706006	/SEND REQ TO PDP-11

SIOA=706001	/SKIP IF PDP-11 CAN TAKE A REQ.

/

	.TITLE START-UP ROUTINE AND USER VARIABLES.

	.FULL

	.LOC 17637

/

/ CELLS .DTBLK THRU .BOOT MUST RETAIN PRESENT POSITION.

/NON RESIDENT CELLS

/

.DTBLK	0		/LOGICAL BL# (0-17777)

.DTCA	0		/CORE ADDR -1

.DTWC	0		/2'S COMP WC.

/

/PDP-15 REQUIRES HRM JMP IN SAME BANK (17777).

/FOLLOWING CELLS OVERLAYED AFTER 1ST TIME THRU.

/

DKWORD	105		/DISK ADDRESS.

ODDFLG	EBA

.DTSRC	LAC .-2		/VESTGIAL REG. (FROM DTA BOOTSTRAP)

.DTTR	DAC 17777	/READ OR WRITE STATUS BITS

/

/RESIDENT DISK BOOTSTRAP

/FOR KM-15 LOAD, START AT .BOOT

/ .BOOT MUST BE AT LOC 17646!!!

/

	.LOC 17646

.BOOT	EBA		/(015)FORCE BANK ADDR

	JMS RIOCLR	/CLEAR I/O SUB

	LAC .L077	/START TRANSFER AT LOC 100.

	DAC .DTCA

	LAW -17400	/WC = 17400

	DAC .DTWC

	DZM .DTBLK	/LOGICAL BL 0 = TRACK 0, SECOTR 0

	DZM .DTSRC	/UNIT 0

	JMP .DTBEG

.L5	5

.L400	400000		/ODD UNITS START AT WORD 400,000.

.L36	36		/CORE LOCATION 36 FOR WC.

.L37	37		/CORE LOCATION 37 FOR CA.

/

/

	.LOC 17663

.DTBEG	LAC .L3		/(3 = READ, GO

	SKP		/SET LINK FOR DISK SIDE INIT

/

/FOR OUTPUT, START AT .DTOUT (.DTOUT MUST BE AT LOC 17665!!!).

/

.DTOUT	LAC .L5		/(5 = WRITE, GO

	DAC .DTTR

	JMS RIOCLR	/CLEAR I/O SUB

	.TITLE COMPUTE PLATTER NUMBER.

/

/ IF DOS; DIVIDE THE ARGUMENT BLOCK NUMBER BY 2000(8)

/ TO GET THE RIGHT PLATTER NO.

/

/

/

	LAC .DTBLK	/REQUESTED BLOCK NUMBER.

	RTR		/DIVIDE BY 2000(8).

	RTR		/THE QUOTIENT = THE ARG PLATTER.

	RTR

	RTR

	RTR

	AND L7		/KEEP RIGHTMOST 3 BITS.

	JMP DSKOUT	/GO SELECT THIS PLATTER.

L7	7		/CONSTANT

MIN400	-400		/CONSTANT

	.IFUND	UC15

	XX		/FILLER

	XX		/FILLER

	.ENDC

	.IFDEF	UC15

TCB	65		/POINTER TO REQUEST BLOCK BUILT IN LOW CORE

	66

	.ENDC

/

/

/.DSTOP MUST BE AT LOC 17704!!!

/

	.LOC 17704

.DSTOP	HLT		/ERR. HLT

	JMP .BOOT	/RESTART

DSKOUT	DLAH		/LOAD DISK NUMBER

	LAC .DTWC

	DAC* .L36	/LOAD WC (CORE LOC 36)

	LAC .DTCA

	DAC* .L37		

	.TITLE COMPUTE THE WORD STARTING ADDRESS.

/

/

/

/

	LAC .DTBLK	/MULTIPLY ARGUMENT BLOCK

	RTL		/TO GET WORD.

	RTL

	RTL

	RTL

	AND MIN400	/ACCOUNT FOR PLATTER.

/

	.TITLE LOAD SECTOR AND TRACK AND DO THE I/O.

/

/

	DLAL		/LOAD SECTOR AND TRACK ADDR.

	LAC .DTTR	/LOAD STATUS (READ OR WRITE)

	DSCF!DSFX!DSCN

	DSSF		/SKIP ON FLAGS.

	JMP .-1

	DSRS		/READ STATUS.

	DSCD		/CLEAR DISK STATUS.

	SPA

	JMP .DSTOP	/ERROR FLAG UP

	.IFUND	UC15

	LAC* .L105	/DONE EXIT THROUGH BANK0, 105

	DAC RTEMP	/TEMP STORAGE.

	JMS	RIOCLR

	JMS* RTEMP

.L077	77		/KM-15 CA-1.

.L1	1

/SUBR TO CLEAR I/O FLAGS,ETC.

RIOCLR	0

	EBA		/ENTER BANK MODE ADDRESSING

STPD=703044		/IOT TO STOP VT-15 DISPLAY

	STPD		/STOP VT15 SO CAF WON'T CAUSE NXM REFERENCE

	LAW -40		/NEED DELAY TO ENSURE THAT IT REALLY DID STOP

	TAD .L1

	SZA

	JMP .-2

	CAF		/CLEAR ALL FLAGS,DISABLE API

	IOF		/PI OFF

	EEM		/ENTER EXT. MODE(PDP-9 COMPATIBILITY)

	JMP* RIOCLR

RTEMP	0		/TEMP CELL

.L3	3		/(015) DISPLACED LITERAL

	.ENDC

	.IFDEF	UC15

	JMS	RIOCLR	/MAKE SURE ALL CLEARED

	LAC*	.L105	/GET MONITOR STARTING ADDR

	DAC	RIOCLR	/USE AS TEMPORARY

	JMS*	RIOCLR	/SEND OUR BANK BITS WITH JMS

/

.L077	77

.L1	1

/

/SUBROUTINE TO CLEAR I/O, FLAGS, ETC.

/

RIOCLR	0

	EBA		/FORCE BANK MODE

STPD=703044		/STOP VT-15 IOT CODE

	STPD

	LAW	-100	/DELAY LOOP TO MAKE SURE STOPPED

	SZA!IAC

	JMP	.-1

	CAF

	IOF+10		/CAF DOESN'T TURN OFF PI!, CLEAR AC

	AAC	200	/CODE FOR CLEAR REQ. TO PDP-11

	DAC*	TCB+1	/BUILD TCB FOR REQ. IN LOW CORE SINCE PDP-11

	DZM*	TCB	/CAN'T ADDRESS ALL OF PDP-15 CORE

	DZM*	DEV

	LAC	TCB	/ADDRESS OF REQ FOR PDP-11

	SIOA		/SKIP IF PDP-11 CAN TAKE IT

	JMP	.-1	/NO

	LIOR		/JAM CONTENTS OF AC TO PDP-11

	LAC*	DEV	/PDP-11 SETS THIS LOC ON COMPLETION

	SNA!CLA!CLL	/SKIP IF HAPPENED

	JMP	.-2	/JUST HANG AND WAIT

	JMP*	RIOCLR	/THIS LEAVES AC AND LINK0

DEV	67		/POINTER TO EVENT VARIABLE IN TCB SET TO PDP-11

.L3	3		/(015) DISPLACED LITERAL

	.ENDC

/.L105 MUST BE LAST LOC IN UPPER 8K (17777)!!!

/

.L105=17777

	.END .BOOT-3	/PDP-15 ONLY.
