Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50142/punch.mac
There are no other files named punch.mac in the archive.
TITLE PAPER TAPE PUNCH LABEL PROGRAM FOR PDP-10
SUBTTL R. P. MALISKA <OCTOBER 30,1971>

IFNDEF	SEGMNT<SEGMNT=-1>	;-1=REENTRANT 0=LOW SEGMENT ONLY
IFNDEF	PAT<PAT=0>		;-1=ASSEM PATCH AREA 0=DONT ASSEM. PATCH AREA

REPEAT	0,<
PUNCH CHRACTERS
===============

CHARACTERS AVAILABLE ARE:
A THROUGH Z, 0 THROUGH 9, AND MISC. CHARACTERS: SPACE CAR RET AND
 #$%&()*=-:+;/?.,


OPERATING INSTRUCTIONS
======================

USER SIMPLY TYPES THE CHARACTERS HE WISHES TO PUNCH
ON THE TTY.
WHEN FINISHED HE TYPES A ^Z(CONTROLL Z)

SAMPLE DIALOGUE
===============

R PUNCH				;USER TYPES THIS TO MONITOR

*				;PUNCH RESPONDS WITH *
THIS IS A TEST			;USER TYPES THIS
^Z				;USER HAS TYPED ^Z

FINISHED			;PUNCH TYPES THIS

EXIT
^C
.				;USER IS BACK IN MONITOR

NOTE THAT YOU MAY RUBOUT CHARACTERS UP UNTILL THE APPERANCE OF A
CARR. RET CHARACTER

RESTRICTIONS
============

DEVICE PTP MUST BE A PAPER TAPE PUNCH
ALTHOUGH THE AOUTHOR HAS TRIED THIS ROUTINE ON THE CDP
ITS RELIABILITY IS NOT ASSURED

GOOD LUCK
>
EXTERN	JOBREN,JOBVER

VPNCH==001

IFN	SEGMNT,<
HISEG
>

AC=4
P=17
T=1
N=20
CNT=3


BEG:	RESET
	MOVEI	0,BEG
	HRRI	JOBREN		;SET A REENTRY ADDRESS
	MOVEI	VPNCH
	HRLI	JOBVER		;STORE JOB VERSION
	TTCALL	3,[ASCIZ/*/]
	INIT	T,1
	SIXBIT	/TTY/
	XWD	0,TTYIN
	JRST	TTYERR
	INIT	P,10
	SIXBIT	/PTP/
	XWD	PTPOUT,0
	JRST	PTPERR
	MOVE	P,[XWD	-N,PDL]
	PUSHJ	P,FEED			;LEADER!

LOOP:	SOSG	TTYIN+2
	INPUT	T,
	ILDB	AC,TTYIN+1
	CAIN	AC,15			;CR?
	JRST	CR			;YES!
	CAIL	AC,140			;SPACE?
	JRST	LOOP
	CAIN	AC,32			;TYPED ^Z TO END
	JRST	ENDIT		;YES CLOSE FILE!
	CAIN	AC,54		;TYPED A COMMA?
	JRST	COMMA		;PUNCH A COMMA
	SUBI	AC,40
	JUMPE	AC,SPACE
	JUMPL	AC,LOOP		;GET NXT CHAR.
	MOVE	AC,TABLE(AC)	;GET CHAR FORMAT
	JUMPE	AC,LOOP		;=0?
	SETZ	CNT,		;CLEAR COUNTER
	ROTC	CNT,6
	ROT	AC,-6
	SKIPN	CNT

;THIS ROUTINE OUTPUTS A SPACE
SPACE:	MOVEI	CNT,6
	MOVEI	AC+1,0
	ROTC	AC,-6
	ROT	AC+1,7
	PUSHJ	P,PUT
	SOJG	CNT,.-4
	JRST	LOOP

;THIS ROUTINE PUNCHES A COMMA
COMMA:	MOVEI	AC+1,1
	PUSHJ	P,PUT
	MOVEI	AC+1,6
	PUSHJ	P,PUT
	MOVEI	AC+1,0
	PUSHJ	P,PUT
	JRST	LOOP

;THIS ROUTINE FEEDS TAPE FOR A CARRIAGE RET.
CR:	PUSHJ	P,FEED-1
	JRST	LOOP

;THIS ROUTINE CLOSES THE FILE WHEN ^Z IS TYPED
ENDIT:	PUSHJ	P,FEED
	PUSHJ	P,FEED
	CLOSE	P,
	CLOSE	T,
	RESET
	TTCALL	3,[ASCIZ/
FINISHED
/]
	EXIT

;THIS ROUTINE PUNCHES LEADER, TRAILER, AND SPACES
	SKIPA	CNT,[50]	;SHORT SPACE FOR CARR. RET.
FEED:	MOVEI	CNT,^D200	;LONG SPACE FOR LEADER AND TRAILER
	SETZ	AC+1,
	PUSHJ	P,PUT
	SOJG	CNT,.-1
	POPJ	P,

;THIS IS THE OUTPUT ROUTINE
PUT:	SOSG	PTPOUT+2
	OUTPUT	P,
	IDPB	AC+1,PTPOUT+1
	POPJ	P,

TTYERR:	TTCALL	3,[ASCIZ/
CAN'T INIT DEVICE TTY
/]
	EXIT

PTPERR:	TTCALL	3,[ASCIZ/
CAN'T INIT DEV PTP
/]
	EXIT

IFN	SEGMNT,<
LOC	140
>

TTYIN:	BLOCK	3

PTPOUT:	BLOCK	3


PDL:	BLOCK	N

IFN	SEGMNT,<
	RELOC	BEG+240
>

TABLE=.	
C240:	BLOCK	4
	45651775122
	BLOCK	3
C250:	030000004136
	030000003641
	040000120412
	040000041604
	0
	040000040404
	030000000303
	2010040201
DIGIT:	050036414136
	040000017721
	3145454523
	2651514122
	0477442414
	4651515172
	4651515136
	6050474040
	2651515126
	3645454530
C272:	BLOCK	3
	040000060606
	0
	050030454030
ALPHA:	0
	3744444437
	2651515177
	2241414136
	3641414177
	4141515177
	4040505077
	645454136
	7704040477
	40000417741
	7601010102
	4122140477
	101010177
	7720142077
	7702142077
	3641414136
	3044444477
	3542454136
	3146444477
	4651515122
	4040774040
	7601010176
	7006030670
	7603140376
	4122142241
	4020172040
	6151414543
C333:	BLOCK	^D5

IFN	PAT,<
PATCH:	BLOCK	^D10
>
END	BEG