Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50177/pcpy1.mac
There are no other files named pcpy1.mac in the archive.
TITLE PCPY
			;PROGRAM TO COPY ONE RP02 DISK PACK TO ANOTHER
			;AUTHOR: MARIA PLAZA
			;YOU MUST ASSIGN THE INPUT PACK "IN" AND
			;THE OUTPUT PACK "OUT"
			;FOR EXAMPLE,     .AS DPA0 IN
			;                 .AS DPA3 OUT

	LOC 137
	XWD 0,1
	RELOC
	CNT=6
START:	CALLI 0
	INIT 0,17	;DUMP MODE NEEDED FOR SUPER USETI/O
	SIXBIT/IN/	;ASSIGNED INPUT DISK PACK - IN
	Z
	JRST MESS1
	INIT 1,17
	SIXBIT/OUT/	;ASSIGNED OUTPUT PACK - OUT
	Z
	JRST MESS2
	MOVEI 2,1	;START COPY WITH BLOCK 1
	USETI 0,2	;CONTENTS OF EFFECTIVE ADDRESS HAS STARTING BLOCK
	USETO 1,2
	INPUT 0,IOL	;GET FIRST HALF CYLINDER LESS BLOCK 0
	STATZ 740000	;ERRORS?
	JRST IERR	;YES
	OUTPUT 1,IOL	;OUTPUT FIRST HALF CYLINDER LESS BLOCK 0
	STATZ 1,740000	;ERRORS?
	JRST OERR	;YES
			;VERIFICATION FOR 1ST HALF CYLINDER
			;SEE COMMENTS IN VERIFY SUBROUTINE
	MOVEI 7,^D2559
	USETI 1,2
VIN1:	MOVEI 4,^D2559
	INPUT 1,VI
STAT:	STATZ 1,740000
	JRST REDERR
COMP1:	MOVE 5,VBLK(4)
	CAME 5,BLK(7)
	JSR DISCRP
	SOS 7
	SOJGE 4,COMP1
	ADDI 7,^D5120		;TO GET TO NEXT GROUP
	CAIN 7,^D12799		;JUST DONE 4TH GROUP?
	JRST DIM		;YES
	CAIE 7,^D15359		;NO,DONE 5 GROUPS?
	JRST VIN1		;NO
				;YES, 1ST HALF CYLINDER DONE
	ADDI 2,^D99	;COUNT # OF BLOCKS + BLOCK 0 COPIED & VERIFIED
MORE:	INPUT 0,IO	;GET NEXT HALF CYLINDER(100 BLOCKS)
	STATZ 740000	;ERRORS?
	JRST IERR	;YES
	OUTPUT 1,IO	;OUTPUT HALF CYLINDER
	STATZ 1,740000	;ERRORS?
	JRST OERR	;YES
	JSR VERIFY
	ADDI 2,^D100	;INCREMENT NUMBER OF BLOCKS COPIED & VERIFIED
	CAIGE 2,^D40000	;ALL BLOCKS COPIED?
	JRST MORE	;NO
	TTCALL 3,[ASCIZ/COPY COMPLETED
/]
	RELEAS 0,	;YES
	RELEAS 1,
	CALLI 12
VERIFY:	Z
				;20 BLKS AT A TIME
				;SO 5 GROUPS PER HALF CYLINDER
	MOVEI 7,^D2559		;2560 WDS PER GROUP
	USETI 1,2		;BLK # TO INPUT IN 2
VIN:	MOVEI 4,^D2559		;#WDS-1 IN 20 BLKS
	INPUT 1,VI		;GET 20 BLKS
	STATZ 1,740000		;ANY ERRORS?
	JRST REDERR		;YES
COMP:	MOVE 5,VBLK(4)		;START COMPARE AT END OF VBLK
	CAME 5,BLK(7)		;COMPARE TO PART OF INPUT BLOCK					;FROM ORIGINAL PACK
	JSR DISCRP			;NO MATCH
	SOS 7		;DECREMENT INDEX
	SOJGE 4,COMP			;FINISHED A GROUP ?
	ADDI 7,^D5120		;YES,TO GET TO NEXT GROUP
	CAIE 7,^D15359		;DONE 5 GROUPS?
	JRST VIN		;NO
	JRST @VERIFY			;YES, RETURN
REDERR:	TTCALL 3,[ASCIZ/ERROR IN READING FROM OUTPUT PACK
/]
	CALLI 12
DISCRP:	Z
	TTCALL 3,[ASCIZ/NO COMPARE
/]
	JRST @DISCRP
VI:	IOWD ^D2560,VBLK
	Z
VBLK:	BLOCK ^D2560			;20 BLOCKS
DIM:	SUBI 7,^D128		;1ST HALF CYL SHORT ONE BLK
	MOVEI 4,^D2431		;19 BLKS
	INPUT 1,VI1
	JRST STAT
VI1:	IOWD ^D2432,VBLK		;19 BLKS
	Z
IOL:	IOWD ^D12672,BLK
	Z
IO:	IOWD ^D12800,BLK
	Z
BLK:	BLOCK ^D12800
MESS1:	TTCALL 3,[ASCIZ/INIT ERROR ON INPUT DEVICE
/]
	CALLI 12
MESS2:	TTCALL 3,[ASCIZ/INIT ERROR ON OUTPUT DEVICE
/]
	CALLI 12
IERR:	TTCALL 3,[ASCIZ/INPUT ERROR DURING DUMP
/]
CHK1:	GETSTS 10
	CALLI 12
OERR:	TTCALL 3,[ASCIZ/OUTPUT ERROR DURING DUMP
/]
CHK2:	GETSTS 1,11
	CALLI 12
	END START