Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50212/dioseq.mac
There are no other files named dioseq.mac in the archive.
	TITLE DIOSEQ
;INPUT ONLY. ALWAYS DOES AN INPUT ON EACH CALL TO GET LAST DISK
;CHANGES MADE BY DIO(IF ANY)
;SAME AS DIO EXECPT OPEN IS NOT CALLED SO MUST NOT USE
;BEFORE DIO IS CALLED.
; USED WHEN SEQUENTIALLY COPYING RECORDS FROM ONE PART OF
;PACK TO ANOTHER . IT SPEEDS THINGS UP BY HAVING ESSENTIALLY
; SEPERATE BUFFERS FOR INPUT AS WELL AS OUTPUT.
	ENTRY DIOSEQ
	EXTERN MAX,FLAG,NO.CHN
	NO.PKS=4
	MASK=7
	BLOCK=10
	WORD=11
	LR=12
	IO=13
	ARRAY=14
	NS=15
	SEC=17
	D=4
	OPDEF TTCALL [51B8]
	DEFINE TTYOUT (ADR) <TTCALL 3, ADR>
	DEFINE SETCHN (ADR) <DPB D, [POINT 4, ADR, 12]>
ACSAVE:	BLOCK 17
DIOSEQ:	0
	MOVSI 1
	HRRI ACSAVE
	BLT ACSAVE+16
	MOVE LR, @(16)
	JUMPLE LR, LRERR
	MOVE IO, @1(16)
	MOVEI ARRAY, @2(16)
	MOVE NS, @3(16)
	CAIN IO,2
	JSR EMPTY
	CAIN IO,2
	JRST EXIT
	MOVE MASK, LR
	IDIV MASK, MIL
	MOVE MASK
	IMUL MIL
	SUB LR,
	MOVEI D, 17
	SUB D, MASK
	SETCHN INPUT+1
	SETCHN INPUT+2
	SETCHN INPUT+3
	SETCHN OUTPUT+1
	SETCHN OUTPUT+2
	SETCHN OUTPUT+3
	JUMPLE NS, NSERR
	MOVE SEC, LR
	ADDI LR, -1(NS)
	MOVEI NO.PKS
	MOVEM MAX
	MOVE MASK
	CAML NO.CHN
	JRST MSKERR
	IMULI 200
	ADDI BUF-1
	HRRM LIST
	AOJ
	MOVEM BUFPNT#
	ADDI 176
	MOVEM LB#
	AOJ
	MOVEM SIZE#
	SETOM FIRST#
;LOOP:	CAMLE SEC, @SIZE
;	JRST OVFL
LOOP:	JSR ALG
	CAIE IO, 1
	JRST OUT
	SKIPN FIRST
	JRST .+3
	SKIPN ROW(MASK)
	JSR EMPTY
;	CAME BLOCK, @LB
	JRST	.+1
	JSR INPUT
	ADD WORD, BUFPNT
	MOVS 1, WORD
	HRR 1, ARRAY
	BLT 1, 11(ARRAY)
	JRST NEXT
OUT:	JRST	EXIT
;	CAMN BLOCK, @LB
	JRST .+5
	SKIPE FIRST
	SKIPN ROW(MASK)
	JSR EMPTY
	JSR INPUT
	MOVS 1, ARRAY
	ADD WORD, BUFPNT
	HRR 1, WORD
	BLT 1, 11(WORD)
NEXT:	CAML SEC, LR
	JRST .+5
	AOJ SEC,
	ADDI ARRAY, 12
	CLEARM FIRST
	JRST LOOP
	MOVEM IO,ROW(MASK)
EXIT:	MOVSI ACSAVE
	HRRI 1
	BLT 17
	JRA 16, 4(16)
INPUT:	0
	USETI (BLOCK)
	INPUT LIST
	STATO 740000
	JRST @INPUT
	TTYOUT CRLF
	TTYOUT TE
	TTYOUT [ASCIZ"INPUT."]
	CALLI 12
OUTPUT:	0
	USETO (BLOCK)
	OUTPUT LIST
	STATO 740000
	JRST @OUTPUT
	TTYOUT CRLF
	TTYOUT TE
	TTYOUT [ASCIZ"OUTPUT."]
	CALLI 12
ALG:	0
	MOVE 6, SEC
	SOJ 6, 
	MOVEM 7,SAVE#
	IDIVI 6, 14
	MOVE 7,SAVE    ;RESTORE AC(7) AFTER INTEGER DIVIDE
	MOVE BLOCK, 6
	AOJ BLOCK,
	IMULI 6, 14
	MOVE WORD, SEC
	SOJ WORD,
	SUB WORD, 6
	IMULI WORD, 12
	JRST @ALG
LRERR:	TTYOUT CRLF
	TTYOUT [ASCIZ"LR NOT POSITIVE."]
	CALLI 12
MSKERR:	TTYOUT CRLF
	TTYOUT [ASCIZ"MASK TOO LARGE."]
	CALLI 12
NSERR:	TTYOUT CRLF
	TTYOUT [ASCIZ"NO. SECTORS NOT POSITIVE."]
	CALLI 12
OVFL:	TTYOUT CRLF
	TTYOUT [ASCIZ"SECTOR EXCEEDS PACK SIZE."]
	CALLI 12
EMPTY:	0
	JRST @EMPTY
CRLF:	BYTE (7) 015, 012
MIL:	^D1000000
ROW:	REPEAT NO.PKS, <1>
BUF:	BLOCK NO.PKS*200
LIST:	IOWD 200,
	0
TE:	ASCIZ"TRANSMISSION ERROR ON "
	END