Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_SRC_3_19910112 - utilities/moon.mac
There are no other files named moon.mac in the archive.
	TITLE	MOON - PHASE OF THE MOON PROGRAM

	SEARCH	JOBDAT,UUOSYM


MOON:	JFCL				;NO CCL
	RESET				;STOP THE WORLD
;SOME DAY, MAKE THIS DO IT RIGHT
REPEAT 0,<
	MOVE	1,[53,,11]		;GET THE DATE/TIME
	GETTAB	1,			;IN UNIVERSAL FORMAT
	TDZA	1,1			;PREHISTORIC MONITOR
>
REPEAT 1,<
	SEARCH	MONSYM,MACSYM
	SETZB	3,4
	SETO	2,
	ODCNV
	TLZ	4,77
	IDCNV
	 HALT .
	;AC2= UNIVERSAL TIME ADJUSTED FOR TIME ZONE
	MOVE	1,2			;RIGHT PLACE
>
	SUB	1,NEWMN		;SUB OFF BASE NEW MOON
	IDIV	1,PERIOD		;DIVIDE BY THE PERIOD
	IDIV	2,PERIO4		;GET FRACTIONS OF A PERIOD
	CAMG	3,PERIO8		;CHECK FOR PAHSE + OR -
	JRST	MOON1			;NOT MORE THAT 3+ DAYS
	SUB	3,PERIO4		;MAKE IT NEXT PHASE -N DAYS
	CAIN	2,3			;IS IT LQ+3D+?
	TDZA	2,2			;IT IS
	AOJ	2,			;INCREMENT PHASE

MOON1:	HLLZ	1,TABLE(2)		;GET SIXBIT PHASE
	SKIPGE	3			;3 < 0 THEN MINUS PHASE OUTPUT
	TLOA	1,'-'			;-
	TLOA	1,'+'			;+
	MOVMS	3			;FIX MAG OF 3
	MOVE	2,[POINT 6,1]		;BYTE POINTER
	MOVEI	5,2			;LOOP 3 TIMES

MOON2:	ILDB	4,2			;GET A CHARACTER
	ADDI	4," "			;MAKE ASCII
	OUTCHR	4			;TYPE IT
	SOJGE	5,MOON2			;LOOP
	MOVSI	4,-4			;MAKE AOBJN POINTER

MOON3:	HRRZ	2,TABLE(4)		;GET A MULTIPLIER
	TRZ	2,774000		;STRIP OFF ASCII CHARACTER
	IMULI	3,(2)			;GET THE VALUE DECODED
	HLRZ	1,3			;GET VALUE
	TLZ	3,-1			;ZAP OLD LH
	MOVE	5,1			;USE 5 & 6 HERE
	IDIVI	5,12			;RADIX 10
	ADDI	5,60			;MAKE ASCII
	CAILE	5,60			;CHECK FOR LEADING ZERO
	OUTCHR	5			;TYPE IT
	ADDI	6,60			;MAKE ASCII
	OUTCHR	6			;TYPE IT
	LDB	5,[POINT 7,TABLE(4),24]	;GET D/H/M/S
	OUTCHR	5			;TYPE IT
	OUTCHR	["."]			;FOLLOW WITH A DOT
	AOBJN	4,MOON3
	EXIT	1,			;SLIENT EXIT
	JRST	MOON			;THE FOOL WANTS TO DO IT AGAIN

NEWMN:	125575,,34343			;28-JAN 79 0120 EST
PER==35,,422752				;29D.12H.53M.19S
PERIOD:	PER
PERIO4:	PER/4
PERIO8:	PER/10

TABLE:	BYTE(18)'NM '(7)"d"(11)^D1	;NEW MOON - DAYS - 1
	BYTE(18)'FQ '(7)"h"(11)^D24	;FIRST QUARTER - HOURS - 24
	BYTE(18)'FM '(7)"m"(11)^D60	;FULL MOON - MINUTES - 60
	BYTE(18)'LQ '(7)"s"(11)^D60	;LAST QUARTER - SECONDS - 60
STOP:	EXIT	1,			;STOP HIM/HER/IT

CONT:	OUTSTR	[ASCIZ\?
\]					;IDIOT
	JRST	STOP			;AGAIN

	LIT

	END	MOON