Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-02 - 43,50214/dskdta.mac
There are no other files named dskdta.mac in the archive.
TITLE DSKDTA COPIES FILES FROM DISK TO DTA AUTOMATICALLY
SUBTTL B.EIBEN DEC-MUNICH 1-13-72 
	I=10
ST:	CALLI 0
TTCALL 3,[ASCIZ "IF YOU WANT TO CONTROL THE NO. OF "]
TTCALL 3,[ASCIZ "FILES ON EACH DTA TYPE Y,ELSE TYPE N. "]
TTCALL 3,[ASCIZ "IF YOU TYPE Y THEN WHEN THE NAME OF THE"]
TTCALL 3,[ASCIZ " FILE TO BE COPIED TO DTA IS TYPED OUT,TYPE ALTMODE"]
TTCALL 3,[ASCIZ " IF YOU WANT A NEW DTA , TYPE "]
TTCALL 3,[ASCIZ "A CARRIAGE RETURN TO COPY,OR N TO SKIP THIS FILE
Y OR N?"]
	SETZ 1,
	TTCALL 11,;CLEAR TYPEOUT-BUFFER
	TTCALL 0,11;Y OR N
	CALLI 2,24;PPN IN 2
INIT 0,I
	SIXBIT /DSK/;INIT. DSK ON CHAN.1
	XWD IBUF0
	JRST ERR1
	MOVEM 2,E
	LOOKUP 0,E
		JRST ERR3
	INIT 1,I;
	SIXBIT /DSK/;INIT DSK ON CHAN.1
XWD IBUF
	JRST ERR1
NER:	RELEAS 2,;RELEASE O/P FILE
	MOVEM 2,E;PPN IN 2
		SETZ 7,
ONE:	TTCALL 3,[ASCIZ "
DTA?"];ASK FOR DTA
	TTCALL 11,;CLEAR TYPEOUT BUFFER
	TTCALL 4,10;I/P CH. IN ACC.10
	CAIE 10,104;SKIP IF =D
	JUMPA ONE;TRY AGAIN
	TTCALL 4,14
	CAIE 14,124;SKIP IF =T
	JUMPA ONE;TRY AGAIN
	TTCALL 4,12
		CAIE 12,101;SKIP IF =A
	JUMPA ONE
	TTCALL 4,13
	CAIGE 13,060;SKIP IF >=0
	JUMPA ONE
	CAILE 13,067;SKIP IF <=9
	JUMPA ONE
	TTCALL 4,15
	CAIE 15,015;SK	 IF =CR.
	JUMPA ONE
	TTCALL 4,15
	CAIE 15,012;SKIP IF =LF.
	JUMPA ONE
	SUBI 13,40;CONVERT TO SIXBIT
	TTCALL 3,[ASCIZ "
"]
	TTCALL 3,[ASCIZ "THE FOLLOWING FILES "]
	TTCALL 3,[ASCIZ "ARE IN TRANSFER TO DTA
"]
	DPB 13,[POINT 6,ODV,23];SUBSTIT. DTA
	MOVEI 16,0;N=0
	INIT 2,I
ODV:	SIXBIT/DTA/;INIT DTA
	XWD OBUF,
	JRST ERROR
	CALLI 2,13;ZERO DTA
	MOVEI 2,1076
	JRST TWO
ERROR:	TTCALL 3,[ASCIZ "ERROR IN INIT OF DTA PLEASE CORRECT"]
	JRST ODV-1
TWO:	CAIN 6,1
	JUMPA TWO+3
	PUSHJ 17,SELFIL;SELECT FILE
	ADDI 16,1;N=N+1
	MOVEI 6,0
	CAIG 16,26
	JUMPA .+3
	MOVEI 6,1
	JUMPA NER;ANOTHER DTA
	MOVEM 3,E1+2;NAME
               	HLLZM 4,E1+3;EXT
TRY:	LOOKUP 1,E1;LOOKUP FILE
JRST ERR4
	MOVEM 3,E2
	HLLZM 4,E2+1
	MOVE 5,E1+5;SIZE OF FILE
	IDIVI 5,177
	AOJ 5,	;GET # OF BLOCKS
	MOVEI 6,0
	CAMG 5,2
		JUMPA .+3
	MOVEI 6,1
	JUMPA NER;ANOTHER DTA
	JSR TYOUT
	SUB 2,5;A=A-B
	ENTER 2,E2;ENTER FILE ON DTA
	JSR ERR5
THREE:	JSR GETCHR;START OF COPY LOOP
	JSR PUTCHR
	JUMPA THREE;ANOTHER BYTE
INERR:	TTCALL 3,[ASCIZ "ERROR IN I/P OF FILE"]
	TTCALL 3,[ASCIZ "IF YOU WANT TO TRY AGAIN "]
	TTCALL 3,[ASCIZ "TYPE T ELSE TYPE CR."]
	TTCALL 11,0
	TTCALL 0,15
	CAIN 15,124;SKIP IF NOT T
	JRST THREE;TRY AGAIN
	CLOSE 1,;CLOSE I/P FILE
	CLOSE 2,;CLOSE O/P FILE
	JRST TWO;PROCEED TO NEXT FILE
INEOF:	CLOSE 2,;CLOSE O/P FILE
	STATZ 2,76000
	JRST EIC-3
	CLOSE 1,;CLOSE I/P FILE
	STATZ 1,74000
	JRST EIC
	JUMPA TWO
	STATO 2,40000;SKIP IF IOBKTL
	JRST EIC
	JRST OUTERR+2
EIC:	TTCALL 3,[ASCIZ "ERROR IN CLOSE.IF YOU WANT TO TRY"]
	TTCALL 3,[ASCIZ "AGAIN TYPE T ELSE TYPE CR."]
	TTCALL 0,15
	CAIN 15,124;SKIP IF NOT T
	JRST INEOF;TRY AGAIN
	JRST TWO;PROCEED & GET NEXT FILE
OUTERR:	STATO 2,40000;SKIP IF IOBKTL
	JRST ERR
	RENAME 2,E3;DELETE FILE
	JFCL
	INIT 2,I;
	SIXBIT /DTA/;INIT ANOTHER DTA
	XWD OBUF,
     	TTCALL 3,[ASCIZ "ERR. IN INIT OF DTA PLEASE CORRECT"]
	MOVEI 6,1
	JUMPA NER;ANOTHER DTA
TYOUT:	0
	SETZ 13,
	SETZ 6,
	MOVE 4,FROM
	MOVEM 4,FROM1
CHAR:	ILDB 3,FROM1
	ADDI 3,40
	ADDI 6,1
	CAIN 6,7
	TTCALL 3,[ASCIZ " . "]
	TTCALL 1,3
	ADDI 13,1
	CAIE 13,9
	JUMPA CHAR
	TTCALL 3,[ASCIZ "   "]
	CAIE 11,131;SKIP IF =Y
	JRST NO
	TTCALL 11,;CLEAR TYPEOUT BUFFER
	TTCALL 0,12
	CAIN 12,116	;SKIP IF NOT "N"
	JUMPA NO1	;NO,GET NEXT FILE
	CAIN 12,15;SKIP IF NOT CR.
	JRST NO;=CR.
	MOVEI 6,0
	JUMPA NER;ANOTHER DTA
NO1:	TTCALL 3,[ASCIZ "
"]
	SUBI 16,1
	JUMPA TWO+2
NO:	CAIN 12,15;SKIP IF NOT CR.
	JRST @ TYOUT
	TTCALL 3,[ASCIZ "
"]
	JRST @ TYOUT
FROM:POINT 6,E1+2
FROM1:0
E:0,0
  SIXBIT/UFD/
  0
XWD 1,1
E1:0,20
   0
   0
   0
	BLOCK 15
E2:	REPEAT 4,<0>
	E3:BLOCK 5
IBUF:BLOCK 3
OBUF:BLOCK 3
T:BLOCK 4
T1:BLOCK 4
	IBUF0:BLOCK 3
SELFIL:	SOS IBUF0+2
	SOSLE IBUF0+2
	JRST GETN
	IN 0
	JRST GETN
	JRST FINISH
GETN:	ILDB 3,IBUF0+1
	ILDB 4,IBUF0+1
	CAIN 3,0
	JRST SELFIL	;GET NEXT FILE-THIS ENTRY EMPTY
	POPJ 17,
GETCHR:	0
GETNXT:	SOSLE IBUF+2;DECREMENT BYTE COUNT
	JRST GETOK
	IN 1,;GET NXT BUFFER FROM MON.
	JRST GETOK;RETURN WHEN BUFFER IS FULL
	STATZ 1,740000;TEST ERROR BITS
	JRST INERR
	JRST INEOF;ASSUME EOF
GETOK:	ILDB 14,IBUF+1;GET CH. FROM BUFFER
	JRST @ GETCHR;RETURN
PUTCHR:	0
	SOSLE OBUF+2;DEC. BYTE COUNT
	JRST PUTOK;CHAR. WILL FIT
	OUT 2,;CALL MON. TO O/P THIS BUFFER
	JRST PUTOK;RETURN WHEN BUFFER AVAILABLE
	JRST OUTERR;PROCESS O/P ERROR
PUTOK:	IDPB 14,OBUF+1;STORE THIS CHAR.
	JRST @PUTCHR;RETURN TO CALLER
ERR1:	TTCALL 3,[ASCIZ "ERROR IN INIT OF DSK"]
	JRST FINISH
ERR3:	TTCALL 3,[ASCIZ "ERROR IN LOOKUP OF MFD"]
	JRST FINISH
ERR4:	TTCALL 3,[ASCIZ "ERROR IN LOOKUP OF FILE.IF YOU "]
	TTCALL 3,[ASCIZ "WANT TO TRY AGAIN TYPE T ELSE "]
	TTCALL 3,[ASCIZ "TYPE CR."]
	TTCALL 11,
	TTCALL 0,15
	CAIE 15,124;SKIP IF T
	JRST TWO+2;PROCEED & GET NEXT FILE
	JRST TRY;TRY AGAIN
ERR5:	TTCALL 3,[ASCIZ "ERROR IN ENTER OF FILE PLEASE "]
	TTCALL 3,[ASCIZ "CORRECT.IS DTA W/EN?"]
	JRST TRY+4
ERR:	TTCALL 3,[ASCIZ "ERROR IN O/P OF FILE.IF YOU "]
	TTCALL 3,[ASCIZ "WANT TO TRY AGAIN TYPE T ELSE CR."]
	TTCALL 0,15
	CAIN 15,124;SKIP IF NOT T
	JRST THREE+1
	JRST TWO+2;PROCEED TO NEXT FILE
	ADDI 12,1;J=J+1
FINISH:	RELEAS 0,
	RELEAS 1,
	RELEAS 2,
	CALLI 12
	END ST