Google
 

Trailing-Edge - PDP-10 Archives - BB-FI82B-DD_1989 - 35,1414/runhrs.mac
There is 1 other file named runhrs.mac in the archive. Click here to see a list.
	TITLE RUNHRS
	SEARCH UUOSYM

;AC DEFINITIONS

F=0	;FLAG REGISTER
T1=1	;
T2=2	;
T3=3
M1=4
M2=5
M3=6
CNT=10
FAC=12
DIG=14

CNTBUF: BLOCK ^D10

DAECLK: .CLOCK
	EXP ^D3600
;	EXP ^D1


STRT:	SETZB CNT,T1
	SETZB T2,T3
	SETZB FAC,DIG

CNTINI:	SETZM 0,CNTBUF(CNT)
	ADDI CNT,1
	CAIGE CNT,^D9
	JRST CNTINI

CNTINX:	SETZM 0,CNT
	OUTSTR	[ASCIZ/Hours to sleep: /]

GETCNT:	INCHRW	t2
	ANDI T2,777
	CAIN T2,15	;CR
	JRST GOTCNT
	CAIGE T2,"0"
	JRST INERR
	CAILE T2,"9"
	JRST INERR
	MOVEM T2,CNTBUF(CNT)
	ADDI CNT,1
	CAILE CNT,^D3
	JRST TOOBIG
	JRST GETCNT

GOTCNT:	JUMPE CNT,WAKE
	SUBI CNT,1
	SETZM 0,T2
	MOVEI FAC,1
GETHRS:	MOVE DIG,CNTBUF(CNT)
	SUBI DIG,60
	IMUL DIG,FAC
	ADD T2,DIG
	SOJL CNT,GOTHRS
	IMULI FAC,^D10
	JRST GETHRS

GOTHRS:	cain t2,0
	jrst wake
	OUTSTR	[ASCIZ/
Runtime Monitor Begins...
/]
	RESET
	SETZM 0,T3
	MOVEI T3,^D59000
;	MOVEI T3,^D1000
	HRLI T3,(HB.RWJ)
	HIBER T3,
	 JRST HBRERR
	OUTSTR [ASCIZ/
 Start of 1st Hour...
/]
HIBERN:	reset
	SETZM 0,T3
	HRLI T3,(HB.RWJ)
	MOVE T1,[XWD,DAECLK]
	DAEMON T1,
	 JRST HBRERR
	HIBER T3,
	 JRST HBRERR
	SOJLE T2,WAKE
	SETZB M1,M2
	SETZM 0,CNT
	MOVE M1,T2
REP:	IDIVI M1,^D10
	ADDI M2,60
	MOVEM M2,CNTBUF(CNT)
	JUMPE M1,REPOUT
	ADDI CNT,1
	JRST REP


REPOUT:	OUTSTR	[ASCIZ/End of hour... Hours left = /]
REPLOP:	OUTCHR CNTBUF(CNT)
	SOJL CNT,REPEND
	JRST REPLOP

REPEND:	OUTSTR	[ASCIZ/
/]
	JRST HIBERN



WAKE:	OUTSTR	[ASCIZ/
END OF HIBERNATION
/]
	EXIT

TOOBIG::	OUTSTR	[ASCIZ/
% Must be three digits or less
/]
	jrst strt

INERR::	OUTSTR	[ASCIZ/
%Must be numeric vaule (hours)
/]
	jrst strt

HBRERR:	OUTSTR	[ASCIZ/
? Hibernation error!!!
/]
	EXIT

	END	STRT