Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_SRC_3_19910112 - utilities/iklock.fai
There are no other files named iklock.fai in the archive.
	title IKlock
	search monsym

;This program works ONLY on Telerays.

;It displays, every second, in inverse mode (black on white) :
;the date in the upper left corner of the screen,
;the time in the middle of the screen.
;it can be stopped by typing <ESC>,
;any other character will give a help message.

	a1=	1
	a2=	2
	a3=	3
	wait=	=1000
	look=	=500
chntab:	1,,help
	2,,stop
levtab:	0,,pclev1
	0,,pclev2
pclev1:	block	1
pclev2:	block	1

start:	reset

	move	a1,[0,-1]
	gttyp			;get terminal type,
	cain	a2,.tttel	;test if it is a Teleray 1601.
	jrst	right
	hrroi	a1,[asciz/		This program works only on Telerays.
If you are a masochist and like programs of that kind (Kind like Kill), and:
		- are on a VT52, try KLOCK instead,
		- are on a Hazeltine, try HKLOCK instead./]
	psout			;output help message
	haltf

right:	movei	a1,.fhslf
	move	a2,[levtab,,chntab]
	sir			;set up software interrupt tables.
	eir			;enable software interrupts.
	move	a2,[1b0]
	aic			;activate channel 0.
	move	a2,[1b1]
	aic			;activate channel 1.
	move	a1,[.ticti,,0]
	ati			;assign any typein to channel 0.
	move	a1,[.tices,,1]
	ati			;assign <ESC> to channel 1.

	movei	a1,.priou
	rfmod
	and	a2,[-1,,777477]	;put terminal
	sfmod			;in binary mode.

again:	hrroi	a1,[asciz/jmRD/];clear screen, put 1st line in inverse mode,
	psout			;and put display in wide mode

	hrroi	a1,[asciz/Y+:R@Y+.RD/];put area for time in middle of
	psout			;screen in inverse mode.

time:	hrroi	a1,[asciz/H/]	;move cursor home.
	psout

	hrroi	a1,[asciz/	/]	;send a tab.
	psout

	movei	a1,.priou	
	move	a2,[-1]		;output date.
	move	a3,[ot%day+ot%fdy+ot%fmn+ot%4yr+ot%spa+ot%ntm]
	odtim

	hrroi	a1,[asciz\Y+/\];move cursor to the
	psout			;middle of the screen.

	movei	a1,.priou	
	move	a2,[-1]		;output time.
	move	a3,[ot%nda+ot%12h]
	odtim

	hrroi	a1,[asciz/Y7o/];move cursor to the
	psout			;lower right corner of the screen.

	movei	a1,wait		;go to sleep
	disms			;for one second.

	jrst	time		;and start again (forever)...

	;when interrupt occurs (any character typed) :
help:	movei	a1,.priin
	cfibf			;clear terminal input buffer.
  
	hrroi	a1,[asciz/j/]	;clear screen
	psout			

	hrroi	a1,[asciz\Y+ \];move cursor to
	psout			;line 12, column1.

	hrroi	a1,[asciz/     type <ESC> to kill the clock.../]
	psout			;output help message

	hrroi	a1,[asciz/Y7o/];move cursor to the
	psout			;lower right corner of the screen.

	cis			;clear software interrupt system.

	movei	a1,look		;go to sleep
	disms			;for 1/2 second.

	jrst	again		;and start again...

	;when interrupt occurs (<ESC> typed) :
stop:	movei	a1,.priin
	cfibf			;clear terminal input buffer.
  
	hrroi	a1,[asciz/jl/];clear screen
	psout			;and put display in normal (80 columns) mode.

	hrroi	a1,[asciz\RR\];dim first line.
	psout			

	move	a1,[-1]
	lgout			;and logout our job...

	end	start