Trailing-Edge
-
PDP-10 Archives
-
decuslib10-06
-
43,50437/slp30.mac
There are no other files named slp30.mac in the archive.
TITLE SLP30 SLEEP TILL NEXT HALF HOUR
ENTRY SLP30
SEARCH C
A=0
B=1
P=17
SLP30: MOVE A,[%CNMIN] ;GET MINUTE
GETTAB A, ;PAST THE HOUR
JRST ERROR ;SHAME, SHAME
CAIGE A,^D30 ;TIME GREATER THAN HALF-PAST?
JRST LSTH30 ;NO
MOVEI B,^D60 ;ONE HOUR
SUB B,A ;MAKE SLEEP TIME
JRST COM ;GO MAKE INTO SECONDS
LSTH30: MOVEI B,^D30 ;HERE FOR 30 MINUTES
SUB B,A ;MAKE SLEEP TIME
COM: IMULI B,^D60 ;MAKE SECONDS FOR DAEMON
MOVEM B,BLOCK+1 ;SET UP FOR DAEMON
MOVE A,[%CNHOR] ;GET HOUR OF DAY
GETTAB A,
JRST ERROR
CAIE A,^D23 ;EQUAL TO 11PM?
JRST X1 ;NO, GO PUT ZERO
MOVE A,[%CNMIN] ;YES, GET MINUTE
GETTAB A,
JRST ERROR
CAIGE A,^D30 ;MINUTES >= 30?
JRST X1 ;NO GO PUT ZERO
MOVEI A,1 ;YES, PUT 1
SKIPA A, ;SKIP
X1: SETZ A, ;PLACE ZERO
MOVEM A,@0(16) ;PLACE VERDICT
MOVEI A,BLOCK ;DEMAND VACATION
DAEMON A, ;DEMAND VACATION
JRST SLP30 ;**[01]DAEMON STRIKES BACK!
SETZ A, ;GET READY, GET SET,
HIBER A, ;VACATION TIME!!
JRST ERROR ;RIPOFF
ERROR: POPJ P, ;BACK TO WORK
BLOCK: 2
Z
END