perm filename TIMER.RTJ[HAK,ROB] blob sn#432334 filedate 1979-04-11 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00003 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	title TSTRTJ
C00006 00003		TITLE	INSTIM - Intruction time timer for the PDP-6
C00007 ENDMK
C⊗;
title TSTRTJ

.insert MESDEF[SIX,MUS]

OPDEF SNDMES [044000000000]	; Skips unless couldn't send message
OPDEF RCVMES [045000000000]	; Skips if there was a message there
OPDEF GDATA  [046000000000]	; Skips upon success, code in AC

; AC codes for GDATA UUO

  JOBOWN←0
  JOBLEN←1
  JOBADR←2
  THSDAT←3
  TIME←4
  CORTAL←5
  CHKINL←6
  EIOTM←7
  INWAIT←10
  UUOTRP←11

; Accumulators

ac1←4
p←17

; Private message codes . . .

mhi←←2000	; Hi there
mtty←←2001	; TTY message

; Messages . . .

iaa:	f6to10!fnowds!mhi,,0	; Send him a "hi" message

hello:	f6to10!mtty,,0		; Now an actual string message
	hlen,,0			; length to be determined
	asciz /Hello from the RTJ!
/
	hlen←←.-hello-2		; Just length of data part

rhelp:	f6to10!mtty,,0		; Now an actual string message
	hlen1,,0		; length to be determined
	asciz /RCVMES didn't skip!
/
	hlen1←←.-rhelp-2	; Just length of data part

adone:	f6to10!mtty,,0		; Now an actual string message
	hlen2,,0		; length to be determined
	asciz /All done. Success!
/
	hlen2←←.-adone-2	; Just length of data part

badm:	f6to10!mtty,,0		; Now an actual string message
	hlen3,,0		; length to be determined
	asciz /Didn't get the message type I expected!?!
/
	hlen3←←.-badm-2		; Just length of data part

inmes:	0	; incoming message buffer
	block 22	; Better not be any longer than this

; Program starts here

START:	sndmes iaa		; First thing.
	 jfcl
wmes:	movei ac1,inwait	; Wait for corresponding message
	gdata ac1,
	 jfcl			; Always takes skip return
	rcvmes inmes		; Bring in new message
	 jrst ohelp		; Error if no message
	ldb ac1,[point 12,inmes+1,17]
	caie ac1,mhi
	 jrst mhelp
	sndmes adone
	 jfcl
	aoja 0,.

ohelp:	sndmes rhelp
	 jfcl
wait:	movei 0,777777
	sojg 0,.		; wait a second so as not to flood
	jrst wmes

mhelp:	sndmes badm
	 jfcl
	jrst wait

end START		; This sets the starting address of the RTJ
	TITLE	INSTIM - Intruction time timer for the PDP-6

	.TIME			; Get the time on the SIX
	SNDMES			; tell the user what time it is
	MOVI	AC1,count	; 
loop:				; loop:
	PUSHJ	P,tstsub	;   call the test routine
	SOJGE	AC1,loop	;   whole bunches of times
	;
	.TIME			; get the time again
	SNDMES			;