	.TITLE	DOS-15 RP02 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 #003	DATE OF LAST EDIT 5.18.71

/EDIT #004	SCR	1/23/74	CLEAR ROUTINE, TURN OFF VT'S

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

/					AND CAF IN RIOCLR

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

/				WITH RP SYSTEM, THE BOOTSTRAP MUST SEND A CLEAR

/				REQUEST TO PIREX. ALL THE OTHER EDITS ARE TO

/				FREE UP ENOUGH SPACE FOR CLEAR REQ.

/				IF UC15 IS NOT SPECIFIED 006 BIN MATCHES 005.

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

/	#008	SCR	9/2/75	COPYRIGHT

/	#009	SCR	9/17/75	CLEANUP

/

/

/IF ENTERED VIA PAKIN OR PAKOUT, 5 WORDS MUST BE SET:

/BLOCK = LOGICAL DISK BL#

/CHADDR = CORE ADDRESS -1

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

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

/UNIT = DISK PACK UNIT #

/

/

DPCS=706324	/CLEAR STATUS  (BITS 13,17,18 OF ST.A)

		/(BITS 9-15 OF ST.B)

DPSJ=706341	/SKIP ON JOB DONE FLAG

DPSE=706361	/SKIP ON ERROR FLAG

DPLF=706464	/LOAD ST.A (BITS 0-8)

DPLA=706304	/LOAD CYA,HA,SA FROM AC.

DPCA=706344	/LOAD CA REGISTER FROM AC (3-17)

DPWC=706364	/LOAD WC REGISTER FROM AC

DPRSA=706312	/READ ST. A INTO AC

DPRU=706412	/READ CA INTO AC (10-17)

DPCN=706454	/EXECUTE FUNC. REG.-AC CLEARED

DPRA=706432	/READ CYA,HA,SA INTO AC

DPRC=706452	/READ CA REGISTER INTO AC (3-17)

DPRW=706472	/READ WC REGISTER INTO AC

DPRSB=706332	/READ STATUS B INTO AC

DPLO=706444	/LOAD AC ONES INTO ST. A (BITS 0-8)

DPSA=706321	/SKIP ON ATTENTION FLAG

/

EBA=707764

EEM=707702

.SCOM=100

LIOR=706006		/SEND REQ TO PDP-11

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

/

	.TITLE	LOAD DOS-15

/

	.FULL

	.LOC 17637

/

/ WORDS BLOCK THRU .BOOT MUST RETAIN PRESENT POSITION.

/NON RESIDENT CELLS

/

BLOCK	0		/LOGICAL BL# 

CHADDR	0		/CORE ADDR -1

WRDCNT	0		/2'S COMP WC.

/

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

/FOLLOWING WORDS OVERLAYED AFTER 1ST TIME THRU.

/

TEMP1	105		/TEMP. LOC.

TEMP2	EBA		/TEMP. LOC

UNIT	LAC TEMP1	/DISK PACK UNIT #.

IN.OUT	DAC 17777	/READ OR WRITE STATUS BITS

/

/RESIDENT DISK BOOTSTRAP

/FOR DOS-15 LOAD, START AT .BOOT

/ .BOOT MUST BE AT LOC 17646!!!

/

	.LOC 17646

/

.BOOT	EBA		/(007)FORCE BANK ADDR

	LAC .L77	/START TRANSFER AT LOC 100.

/

/CA WILL BE BUMPED IN I/O ROUTINE FOR RP

/

	DAC CHADDR

	LAW -17400	/WC = 17400

	DAC WRDCNT

	DZM BLOCK	/LOGICAL BL 0 = TRACK 0, SECOTR 0

	DZM UNIT	/UNIT 0

	JMP PAKIN

/

/

.TL2	20000		/20000 IS WRITE;RAR TO GET 10000 READ

.DSELT	700000		/DESELECT UNIT CONSTANT

	.IFUND	UC15

.L2000	2000		/FOR BUMPING CYL. ADDR

.L40	40		/FOR BUMPING HEAD ADDR

.LGO	1000		/GO BIT FOR DISK

	.ENDC

	.IFDEF	UC15

TCB	65		/POINTER TO TCB BUILT IN LOW CORE

	66

DEV	67		/EVENT VARIABLE FOR REQ

	.ENDC

	.TITLE	START AT PAKIN FOR INPUT PAKOUT FOR OUTPUT.

/

/FOR NON DOS LOAD, START AT PAKIN

/PAKIN MUST BE AT LOC 17663!!!

/

	.LOC 17663

/

PAKIN	LAC	.TL2	/READ, PICK UP 20000 WRITE CODE

	SKP!CLL!RAR	/MAKE READ CODE!!

/FOR OUTPUT, START AT PAKOUT

/PAKOUT MUST BE AT LOC 17665!!!

/

	.LOC 17665

/

PAKOUT	LAC	.TL2	/WRITE, GET WRITE CODE

	DAC	IN.OUT	/SAVE FUNCTION CODE

	JMS RIOCLR	/CLEAR I/O SUB

	.IFUND	UC15

	DZM TEMP2	/BASE CYL ADDR. ALWAYS = 0

	LAC BLOCK	/DP BLK #

	DAC TEMP1	/SAVE THE ARGUMENT BLK NUMBER

FNDCYL	LAW	-310	/CHECK IF LESS THAN 310(8)

	TAD	TEMP1

	SPA

	JMP	FNDHED	/YES

	DAC	TEMP1	/NO, STORE REMAINDER

	LAC	TEMP2

	TAD	.L2000	/ADD ONE TO CYL ADDR.

	DAC	TEMP2

	JMP	FNDCYL	/KEEP SUBTRACTING

/

/.DSTOP MUST BE AT LOC 17704!!!

/

	.LOC 17704

/

.DSTOP	HLT		/ERR. HLT

	JMP .BOOT	/RESTART

FNDHED	LAW	-12	/LESS THAN 12(8)

	TAD	TEMP1

	SPA!STL		/SET LINK FOR GLK IN FNDSEC

	JMP FNDSEC	/YES

	DAC TEMP1	/NO  STORE REMAINDER

	LAC TEMP2	/ADD ONE TO HEAD ADDR

	TAD .L40

	DAC TEMP2

	JMP FNDHED	/RECYCLE

	.EJECT

FNDSEC	LAC TEMP2	/ADD RESIDUE TO RP ADDRESS

	TAD TEMP1

	DPLA		/LOAD RP ADDRESS

	LAC WRDCNT

	DPWC		/LOAD WC 

	GLK		/GET ONE INTO AC FOR CA-1 BUMP

	.ENDC

	.IFDEF	UC15

	LAC	BLOCK	/USE EAE TO SAVE SPACE FOR DISK CALC.

	IDIV		/RIORCLR LEFT LINK 0!

	12		/LEAVES SECTOR REMAINDER IN AC

	DAC	TEMP1	/SAVE THAT

	LLS	27	/QUOTIENT IN MQ TO AC BUT TIMES 32

	IDIV

	1200		/DIVISOR OF 20, BUT ALSO TIMES 32

	DAC	TEMP2	/WHICH LEAVE REMAINDER OF HEAD IN PROPER PLACE

	LLS	34	/QUOTIENT OF CYL. SHIFTED TO PROPER PLACE IN AC

	XOR	TEMP1

	XOR	TEMP2	/BRING BACK OTHER TWO PIECES

	JMP	AROUND	/GO AROUND FIXED CODE

.DSTOP	HLT		/THIS CODE MUST EXIST AT 17704!!!!

	JMP	.BOOT

AROUND	DPLA		/LOAD ADDRESS

	LAC	WRDCNT

	DPWC		/LOAD WORD COUNT

	CLA!IAC		/A 1 TO KICK CA-1 TO CA

	.ENDC

	TAD CHADDR	/BUMP CA-1

	DPCA		/LOAD CA-1+1=CA

	LAC UNIT	/GET UNIT #-MUST MASK OFF LOW BITS

	AND .DSELT	/MASK (700000)

	DAC TEMP1	/SAVE DISKPACK UNIT #

	TAD .DSELT	/MINUS 1 FROM BITS 0-2 FOR DESELECT OF

/

/CURRENTLY SELECTED UNIT FOR DRIVE SWITCHES TO ACTIVATE

/

	DPLF		/ AND DO AN IDLE

	LAC	IN.OUT	/RETREIVE FUNCTION CODE

	XOR TEMP1	/UNIT #

	DPLF		/LOAD STATUS REGISTER A.

	DPRSB		/READ STATUS B

	RAR		/IF L=1, SELECTED UNIT OFF LINE

	.IFUND	UC15

	SZL

	JMP .DSTOP

	LAC .LGO	/1000 -- JAM GO BIT

	.ENDC

	.IFDEF	UC15

	SZL!CLA!IAC	/SKIP IF ON LINE, START MAKING A 1000

	JMP	.DSTOP	/OFF LINE, JUST HALT OUT

	SWHA		/1000 WHICH IS THE GO BIT

	.ENDC

	DPLO

	.TITLE	WAIT FOR THE I/O TO FINISH, CHECK FOR ERRORS

/

/

.BTFLG	DPSE		/SKIP ON ERR FLAG

	SKP

	JMP .DSTOP	/ERROR

	DPSJ		/SKIP ON JOB DONE

	JMP .BTFLG	/NOT DONE--GO CHECK AGAIN

/

/THE CONTENT OF LOCATION 17777 IN THIS BANK IS

/POINTING TO ABSOLUTE LOCATION 105. LOC 105 OF

/BANK 0 HAS THE STARTING ADDRESS LIVING IN

/IT. GET THAT ADDRESS AND JMS* TO IT SO THAT

/THE MULTICORE FEATURE WILL WORK.

	JMS	RIOCLR	/CLEAR OUT BEFORE GOING TO MONITOR

/

	LAC* 17777	/DONE EXIT 

	DAC	RIOCLR	/USE RIOCLR AS CONVENIENT TEMPORARY

	JMS*	RIOCLR	/EXIT TO MONITOR, GIVE IT OUR BANK BITS!

/

/SUBR TO CLEAR I/O FLAGS,ETC.

/

	.IFUND	UC15

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*40	/NEED DELAY TO ENSURE THAT IT REALLY DID STOP

	TAD .L40

	SZA

	JMP .-2

	CAF		/CLEAR ALL FLAGS,DISABLE API

	IOF+10		/PI OFF AND CLEAR AC

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

	JMP* RIOCLR

	.ENDC

	.IFDEF	UC15

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

	.ENDC

/

.L77	77		/(007)DISPLACED BY EBA

/

	.END	TEMP2	/FIRST TIME

/
