Trailing-Edge
-
PDP-10 Archives
-
decuslib10-01
-
43,50176/taptst.mac
There are 3 other files named taptst.mac in the archive. Click here to see a list.
TITLE TAPTST TO WRITE ONES ONTO MAGTAPE
SUBTTL AUTHOR A.J.COPANAS, DEC, MAYNARD
MLON
SIZE=^D800*6
AC0=0
AC1=1
TAC=2
TAC1=TAC+1
NUM=4
CNT=5
CNT1=6
LOC 124
XWD 0,ST
RELOC ;SET REENTER ADDRESS
ST: SETZ AC0,
HRRZI 17,AC1
BLT 17,17 ;CLEAR ALL AC'S
CALLI
REPT: TTCALL 3,[ASCIZ/DO YOU WANT ONE PASS AT 556 BPI? (Y OR C.R.)
/]
TTCALL 11,
TTCALL 0,AC0
CAIN AC0,"Y" ;TEST FOR YES
JRST BPI5
TTCALL 3,[ASCIZ/DO YOU WANT ONE PASS AT 800 BPI? (Y OR C.R.)
/]
TTCALL 11,
TTCALL 0,AC0
XCT .-5
JRST BPI8
TTCALL 3,[ASCIZ/DO YOU WANT 2 PASSES, ONE AT 556,
THEN AT 800? (Y OR C.R.)
/]
TTCALL 11,
TTCALL 0,AC0
XCT .-12
JRST BPI58
JRST REPT
GO: OPEN 1,SPEC
JRST NOTAVL
MOVE AC0,[XWD 400000,BUF1+1]
MOVEM AC0,MAGBUF
MTAPE 1,1
MTAPE 1,0
SETOM NUM
WLP: TTCALL 3,[ASCIZ/NOW WRITING TAPE
/]
SETOM AC1
JSR PUTCHR
JRST .-1
VERIF: MOVEI TAC,VERIF+6
JRST ERRTST
SETZ NUM,
CLOSE 1,
MTAPE 1,1
MTAPE 1,0
RLP: TTCALL 3,[ASCIZ/NOW VERIFYING TAPE
/]
JSR GETCHR
CAMN AC1,[-1]
JRST .-2
COMERR: TTCALL 3,[ASCIZ /VERIF ERROR ON DATA WORD /]
MOVEI CNT,^D12
MOVE TAC1,[POINT 3,AC1]
JSR TOCT
JSR RECNUM
JRST SIZ
RECNUM: 0
TTCALL 3,[ASCIZ/
RECORD NUMBER (IN OCTAL) /]
MOVEI CNT,4
MOVE TAC1,[POINT 3,NUM,23]
JSR TOCT
JRST @RECNUM
SIZ: TTCALL 3,[ASCIZ/
REC SIZE (IN OCTAL) = /]
MOVEI CNT,^D6
MOVE TAC1,[POINT 3,BUF1+2,17]
JSR TOCT
TTCALL 3,[ASCIZ /
POSITION WITHIN THIS RECORD = /]
HRRZ TAC,BUF1+2
AOS TAC
SUB TAC,MAGBUF+2
MOVE TAC1,[POINT 3,TAC,17]
MOVEI CNT,6
JSR TOCT
TTCALL 3,[ASCIZ/
/]
JRST RLP+1
TOCT: 0
ILDB AC0,TAC1
ADDI AC0,60
TTCALL 1,AC0
SOJN CNT,.-3
JRST @TOCT
PUTCHR: 0
SOSG MAGBUF+2
JRST PUTBUF
PUTNXT: IDPB AC1,MAGBUF+1
JRST @PUTCHR
PUTBUF: OUT 1,
JSP TAC,ERRTST
GETSTS 1,TAC
TRNE TAC,2000 ;EOT?
JRST LAST1
JSR TEST
TRNN TAC,400000
JRST PUTNXT
TTCALL 3,[ASCIZ/TAPE IS WRITE-LOCKED, TYPE "REEN" TO RESTART
/]
EXIT
GETCHR: 0
SOSG MAGBUF+2
JRST GETBUF
GETNXT: ILDB AC1,MAGBUF+1
JRST @GETCHR
GETBUF: IN 1,
JSP TAC,ERRTST
GETSTS 1,TAC
TRNE TAC,2000 ;EOT?
JRST LAST2
JSR TEST
JRST GETBUF
TEST: 0
TRNE TAC,300000 ;DATA OR TAPE BAD?
JRST REWR
TRNN TAC,40000 ;BLK TOO LG?
JRST @TEST
TTCALL 3,[ASCIZ !TAPE ERROR, BLOCK TOO LARGE. BAD!]
AOS NUM
JSR RECNUM
TTCALL 3,[ASCIZ/
THIS RECORD NOT VERIFIABLE, WILL CONTINUE
/]
JRST @TEST
REWR: AOS CNT1 ;BUMP ERROR COUNT
CAIGE CNT1,^D10 ;ALLOW 10 TRIES FOR I/O
JRST SPACE
TTCALL 3,[ASCIZ!READ/WRITE FAILED AFTER 10 TRIES ON!]
AOS NUM
JSR RECNUM
TTCALL 3,[ASCIZ/
/]
SETZ CNT1,
JRST @TEST
SPACE: MTAPE 1,7
MTAPE 1,0
JUMPLE NUM,@TEST
MTAPE 1,7
MTAPE 1,0
MTAPE 1,6
MTAPE 1,0
JRST @TEST
LAST1: TRNN TAC,300000
JRST VERIF
JRST PUTBUF+5
LAST2: TRNN TAC,300000
JRST RDEOF
JRST GETBUF+5
ERRTST: AOS NUM
CAIG CNT1,0
JRST -4(TAC)
AOS CNT1
MOVEI CNT,4
MOVE TAC1,[POINT 3,CNT1,23]
JSR TOCT
TTCALL 3,[ASCIZ! ATTEMPTS TO READ/WRITE ON TAPE!]
JSR RECNUM
TTCALL 3,[ASCIZ/
/]
SETZ CNT1,
JRST -4(TAC)
BPI5: MOVEI AC0,600
HRRM AC0,RDEOF+2
BPI58: TTCALL 3,[ASCIZ/
556 BPI
/]
MOVEI AC0,510
MOVEM AC0,SPEC
JRST GO
BPI8: MOVEI AC0,710
HRRM AC0,SPEC
TTCALL 3,[ASCIZ/
800 BPI
/]
JRST GO
RDEOF: MOVEI TAC,RDEOF+6
JRST ERRTST
TROE TAC,200
JRST ENDS
SETSTS 1,@TAC
MTAPE 1,1
MTAPE 1,0
TTCALL 3,[ASCIZ /800 BPI
/]
JRST WLP
ENDS: MOVEI AC0,200
HRRM AC0,RDEOF+2
MTAPE 1,1
TTCALL 3,[ASCIZ /DONE
/]
CALLI 12
NOTAVL: TTCALL 3,[ASCIZ /TRY "AS MTA- TAPTST", THEN TYPE "REEN"
/]
EXIT
SPEC: 0
SIXBIT /TAPTST/
XWD MAGBUF,MAGBUF
MAGBUF: BLOCK 3
BUF1: 0
XWD SIZE+1,BUF1+1
BLOCK SIZE+1
END ST