Trailing-Edge
-
PDP-10 Archives
-
decuslib20-03
-
decus/20-0078/libsim/daytim.mac
There is 1 other file named daytim.mac in the archive. Click here to see a list.
COMMENT * SIMULA specification;
OPTIONS(/E:CODE,daytime);
TEXT PROCEDURE daytime;
COMMENT Returns a text object of length 8 with contents according to the pattern
hh:mm:ss, where hh is hours since midnight, mm is minutes, and ss is seconds.
;
!*;! MACRO-10 code !*;!
TITLE daytime
ENTRY daytime
SUBTTL SIMULA utility, Lars Enderin Dec 1975
;! Copyright 1975 by the Swedish Defence Research Institute.
;! Copying is allowed.
sall
search simmac,simmcr,simrpa
macinit
;! Local definitions ;!
result==ZBI%S
DF hh,2(XWAC1),2*7,2*7-1
DF hm,2(XWAC1),1*7,3*7-1
DF mm,2(XWAC1),2*7,5*7-1
DF ms,3(XWAC1),1*7,1*7-1
DF ss,3(XWAC1),2*7,3*7-1
DEFINE putdec(f)<
EXEC .putdec
SF ,f
>
.putdec:IDIVI ^D10
LI XIAC,"0"(X1)
IDIVI ^D10
LI "0"(X1)
LSH 7
ADDI (XIAC)
RETURN
daytime:
PROC
LI XWAC1,^D8
EXEC TXBL ;! Blanks(8)
XWD 0,0
STD XWAC1,result(XCB)
MSTIME XWAC3,
IDIVI XWAC3,^D1000 ;! Throw away msecs
IDIVI XWAC3,^D60
LI (XWAC4)
putdec ss
IDIVI XWAC3,^D60
LI (XWAC4)
putdec mm
LI (XWAC3)
putdec hh
LI ":"
SF ,hm
SF ,ms
BRANCH CSEP
EPROC
LIT
END;