Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap2_198111 - decus/20-0027/ptape.mac
There are 2 other files named ptape.mac in the archive. Click here to see a list.
TITLE	PTAPE IOTS, HIGH SPEED READER AND PUNCH	VERSION #2	SEPT. 1 '69
SUBTTL	DAVE MCCLURE'S MODIFICATIONS TO DON WITCRAFT'S ORIGINAL


;READER DATA BLOCK

ENTRY RDATA,RCDATA,EFLG8

RDATA:	EXP	4*^D10000/3	;300 CPS	DEVICE DATA BLOCK
	Z
	XWD RACTIV,RFLG
	Z
RCDATA:	EXP	I		;FILE DATA BLOCK FOR PTR
	SIXBIT /PTR/		;SEE F.MAC FOR DESCRIPTION
	XWD	0,PTRB
	Z
	XWD	0,RLOOK
	Z
	Z
	Z
	Z
	Z

RB:	0			;READER BUFFER

;READER IOTS

INTERNAL RFC,RSF,RRB,RRBRFC
EXTERNAL NTIME,TIME

RFC:	TRZ	FLAGS,RFLG	;<6014> CLEAR READER FLAG AND READER BUFFER.
	SETZM	RB		;FETCH CHARACTER, SET READER FLAG WHEN DONE
READ:	SOSG	PTRB+2		;ANY MORE CHARACTERS IN BUFFER?
	PUSHJ	PDP,RIN		;NO SO FILL BUFFERS
	ILDB	AC0,PTRB+1	;PUT NEXT CHARACTER IN AC0
	ANDI	AC0,377		;MAKE SURE ONLY 8 BITS
	LDB	AC1,[POINT 4,RCDATA+CDSTAT,35]
	CAILE	AC1,AL		;IMAGE?
	JRST	.+4		;YES.
	MOVE	AC1,@PTRB+2	;NO. ASCII.
	TRNE	AC1,1		;SEQUENCED?
	JRST	READ		;YES. IGNORE SEQUENCE NUMBERS.
	MOVEM	AC0,RB		;PUT CHARACTER IN READER BUFFER
	TLO	FLAGS,RACTIV	;SET READER ACTIVE
	MOVE	AC0,TIME	;LOAD CURRENT SIMULATED TIME
	ADD	AC0,RDATA	;ADD DELAY TIME
	MOVEM	AC0,RDATA+1	;SAVE TIME FOR FLAG TO RISE
	CAMGE	AC0,NTIME	;IS THIS THE NEXT FLAG?
	MOVEM	AC0,NTIME	;YES
	POPJ	PDP,		;RETURN

RSF:	TRNE	FLAGS,RFLG	;<6011> SKIP IF READER FLAG IS A 1.
	AOS	PC		;SKIP
	POPJ	PDP,		;RETURN

RRB:	OR	AC,RB		;<6012> READ THE CONTENT OF THE READER	BUFFER
	TRZ	FLAGS,RFLG	;CLEAR THE READER FLAG.
	POPJ	PDP,		;RETURN

RRBRFC:	PUSH	PDP,[EXP RFC]	;<6016> SECOND DO A RFC
	JRST	RRB		;FIRST DO A RRB
EXTERNAL CONSOL,SREAD

RIN:	MOVEI	FDB,RCDATA
	PUSHJ	PDP,SREAD	;FILL BUFFERS
	SKIPA			;EOF RETURN
	POPJ	PDP,		;RETURN
	POP	PDP,AC0
	HLRZ	AC0,RLOOK+1
	CAIN	AC0,625155	;"RIM" EXTENSION TO FILE NAME?
	PUSHJ	PDP,CONSOLE	;YES SO EXIT TO CONSOL CONTROL
EFLG8:	POPJ	PDP,		;NO - CONTINUE BLITHLY

RLOOK:	SIXBIT	/PTR/		;BLOCK FOR LOOKUP ON PTR FILE
	SIXBIT	/RIM/		;FILE NAME EXTENSION	SEE RIN
	EXP	Z,Z
PTRB:	BLOCK	3		;READER BUFFER HEADER


;PUNCH DATA BLOCK

ENTRY PDATA,PCDATA

PDATA:	EXP	^D63141		;63.3 CPS
	Z
	XWD	PACTIV,PFLG
	Z
PCDATA:	EXP	I
	SIXBIT	/PTP/
	EXP	PTPB
	EXP	0
	EXP	PENTRY
	Z
	Z
	Z
	Z
	Z

PB:	0			;PUNCH BUFFER.


;PUNCH IOTS

INTERNAL PLS,PPC,PSF,PCF
EXTERNAL SWRITE

PLS:	TRZ	FLAGS,PFLG	;<6026> CLEAR FLAG AND BUFFER.
	SETZM	PB
PPC:	MOVEI	DDB,PCDATA	;<6024> LOAD BUFFER AND PUNCH CHARACTER
	SOSG	PTPB+2
	PUSHJ	PDP,SWRITE
	MOVE	AC0,AC
	ANDI	AC0,377		;REDUCE TO AT MOST 8 BITS
	ORB	AC0,PB
	IDPB	AC0,PTPB+1
	TLO	FLAGS,PACTIV
	MOVE	AC0,TIME	;CURRENT APPX TIME
	ADD	AC0,PDATA	;ADD DELAY TIME CONSTANT
	MOVEM	AC0,PDATA+1
	CAML	AC0,NTIME	;NEXT DEVICE TO RAISE A FLAG?
	MOVEM	AC0,NTIME	;YES
	POPJ	PDP,

PSF:	TRNE	FLAGS,PFLG		;<6021> SKIP IF PUNCH FLAG IS A 1.
	AOS	PC
	POPJ	PDP,

PCF:	TRZ	FLAGS,PFLG		;<6022> CLEAR PUNCH FLAG AND PUNCH BUFFER
	SETZM	PB
	POPJ	PDP,


PTPB:	BLOCK 3			;PTP BUFFER HEADER
PENTRY:	SIXBIT	/PTP/		;BLOCK FOR ENTER ON PTP FILE
	SIXBIT	/OUT/
	EXP	Z,Z
	END