/EXTENDED MEMORY DEVICE HANDLER
/
/
/PSEUDO DEVICE SIMILAR TO DF32
/BUT IN RAM MEMORY USING FIELDS
/10 TO 17 FOR PLATTER 1
/20 TO 27 FOR PLATTER 2
/30 TO 37 FOR PLATTER 3
/
/
/	S.R.,J.R.,J.M.
/
/
/
/
/
/
/COPYRIGHT  (C)  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.
/
/
/
/
/
/
/
/
/
/
/
/BUILD DATA
	*0
/
/1	EXTENDED MEMORY HANDLER FOR OS/8


	SYS=1
	IFNDEF SYS <SYS=0>		/SET TO 1 TO GET SYSTEM HANDLER


	-1
	IFZERO SYS <DEVICE VXA0;DEVICE VXA0;4333;MEM&177;ZBLOCK 2>
	IFNZRO SYS <DEVICE VXA0;DEVICE SYS;4333;2007;0;200>
	VXVER="A&77

	IFNZRO SYS <

	7737	/MINUS LENGTH OF BOOT
	RELOC 0

	CLL CLA CMA	/CLEAR AC & SET TO 7777
	DCA X0
	TAD K7600
	DCA C1
	TAD K7600
	DCA C2
	TAD K7577
	DCA X1
	TAD K7577
	DCA X2
	JMP 20
X0,	0
X1,	0
X2,	0
C1,	0
C2,	0
	CDF 4
	TAD I X0
	CDF 10
	DCA I X1
	ISZ C1
	JMP 20
	CDF 4
	TAD I X0
	CDF 0
	DCA I X2
	ISZ C2
	JMP 26
	CDF CIF 0
	JMP I .+1
	7605
K7600,	7600
K7577,	7577
	RELOC
	>
        *200

        IFNZRO SYS <    RELOC 7600
                        ZBLOCK 7>

MEM,	VXVER
	CLA CLL CML RAR	/SET AC TO 4000
	TAD I MEM	/GET ARG 1 -- LINK WILL BE SET IF WRITE
	AND VX70	/MASK OFF FIELD
	TAD VCDF	/FORM A CDF N
	DCA FLD		/STORE AT INPUT
	TAD FLD
	DCA WR		/AND AT OUTPUT
	RAR		/GET WRITE BIT
	MQL		/SAVE IN MQ
	IFZERO SYS <
	TAD K7000
	6200		/SET MEM EXT BITS
	CLA CLL
	>
	TAD I MEM	/AGAIN GET ARG 1
	RAL		/MULT X 2 = PAGESX2=WORDS
	AND VX7600		/MASK OFF OTHER BITS
	CIA		/MAKE NEGATIVE
	DCA WDCNT	/STORE AT 7753
	CLL		/CLEAR LINK IF IT WAS WRITE
	ISZ MEM		/INCR POINTER
	TAD I MEM		/GET ARG 2
	DCA BUFADR	/STORE BUFFER POINTER IN 7750
	ISZ MEM		/INCR POINTER
	TAD I MEM	/GET ARG 3 -OS/8 BLOCK #
	DCA BLK		/STORE IN 7752
	TAD BLK
	AND VX17	/GET BITS 8 TO 11 TO MAKE INTO START ADDR
	BSW
	RTL
	DCA SA		/STORE START ADDR OF EXT MEM IN 7751
	TAD BLK
	RAR
	AND VX70
	TAD VCDF	/THIS GET BITS 5 TO 7 FOR EXT MEM BIT CDE
	DCA RD		/TEMP STORE UNTIL BITS A & B ARE EVALUATED
	RDF		/NOW GRAB SENDING FIELD IN AC
	TAD VXCDI	/FORM A CDI N OF SENDING FIELD
	DCA VXRET	/STORE AT RETURN ROUTINE
	ISZ MEM		/NOW RETURN POINTS TO ERROR
VXCDI,	CDF CIF 0	/PUT INTO CURRENT FIELD ALSO CONSTANT FOR CDI
	TAD BLK		/NOW WE NEED TO KNOW BITS A & B IN EXT MEM
	TAD M200	/IS OS/8 BLOCK 0-177
	SPA
	JMP DOB		/YES SO SET BIT B
	TAD M200	/IS OS/8 BLOCK 200-377
	SPA CLA
	JMP DOA		/YES SO SET BIT A
	TAD VX4		/NO SO SET BIT B
	TAD VX100	/AND BIT A
GO,	TAD RD		/PICK UP TEMP CDF
	DCA RD		/STORE IT AT INPUT
	TAD RD
	DCA FLD2	/AND AT OUTPUT
	MQA		/NOW GET WRITE BIT (IF ANY)
	SNA CLA
	JMP RD		/NO WRITE BIT SO GO TO READ ROUTINE
WR,	HLT		/WRITE ROUTINE - THIS BECOMES A CDF N
	TAD I BUFADR	/GET DATA FROM INPUT BUFFER
FLD2,	HLT		/THIS CHANGES TO CDF N (HIGH FIELDS)
	DCA I SA		/DUMP INTO EXTEND MEM
	JMS VCK		/CHECK FOR END OF ROUTINE & RESET FIELDS
	JMP WR		/NOT DONE YET SO CONTINUE
RD,	HLT		/READ ROUTINE - THIS BECOMES A CDF N (HIGH)
	TAD I SA	/GET DATA FROM EXTENDED MEM
FLD,	HLT		/CHANGES TO CDF N (LOW)

	DCA I BUFADR	/PUT INTO BUFFER IN LOWER MEMORY
	JMS VCK		/CHECK FOR END OF ROUTINE & RESET FIELDS
	JMP RD		/NOT DONE SO CONTINUE
M200,
VX7600,	7600		/K7600 & M200 & CLA ON EXIT
	ISZ MEM		/INCR POINTER TO GOOD EXIT
VXRET,	HLT		/CHANGES TO CDF CIF N OF SENDING FIELD
	JMP I MEM	/RETURN TO CALLING ROUNTINE
VCK,	0		/THIS CHECKS READ AND WRITE FOR DONE
        IFZERO SYS <JMS CTRLC>
	ISZ WDCNT	/AND FOR RESET OF FIELDS
	SKP		/NO OVERFLOW SO SKIP TO CONTINUE
	JMP VX7600	/OVERFLOW SO DONE - GO TO EXIT ROUTINE
	ISZ BUFADR	/INCR POINTER IF OVERFLOWS THEN WRAP MEMORY
VX70,	70		/CONSTANT THAT DOES A NOP HERE IF NO OVERFLOW
	ISZ SA		/INCR START ADDR IN EXT MEM

	JMP I VCK	/NO OVERFLOW SO COONTINUE
	TAD VX10	/EXTEND MEM NEEDS NEW FIELD
	TAD RD
	DCA RD		/PUT INCR FIELD AT INPUT
	TAD RD
	DCA FLD2	/AND WRITE
	JMP I VCK	/NOW GO BACK AND TRY TO FINISH 
DOB,	CLA		/CLEAR AC
	TAD VX4		/SET BIT A
	JMP GO		/GO TO ROUTINE TO UPDATE TEMP AND STORE
DOA,	TAD VX100	/SET BIT A
	JMP GO		/GO TO ROUTINE TO UPDATE TEMP AND STORE
VCDF,	CDF 0		/CONSTANT TO FORM CDF N
VX17,	17
VX10,	10
VX100,	100
VX4,	4
	IFNZRO SYS <

BUFADR=7750
SA=7751
BLK=7752
WDCNT=7753>
        IFZERO SYS <

BUFADR,	0
SA,	0
BLK,	0
WDCNT,	0
K7000,	7000
CTRLC,  0
        TAD (200
        KRS
        TAD (-203
        SNA CLA
        KSF
        JMP I CTRLC
        CIF CDF 0
	JMP I VX7600
        >


        IFNZRO SYS <
        RELOC
        >
$ $ $ $ $ $ $ $ 

