-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ad4855
commit 14320d9
Showing
3 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
;-*-MIDAS-*- | ||
|
||
TITLE DATE ; Display date and time | ||
|
||
; This program has the current century hardcoded, | ||
; so it needs to be updated every 100 years | ||
|
||
T==0 | ||
|
||
A=1 | ||
B=2 | ||
C=3 | ||
D=4 | ||
|
||
A1=5 | ||
|
||
TTY==1 | ||
|
||
PTTY=<001000,,> | ||
|
||
LOC 41 | ||
JSR UUOH | ||
|
||
LOC 100 | ||
|
||
UUOH: 0 | ||
MOVEM A1,ASAV | ||
MOVEI A1,440600 ; SIXBIT byte pointer | ||
HRLM A1,40 | ||
.PTTY: ILDB A1,40 | ||
CAIN A1,'@ | ||
JRST .RET | ||
ADDI A1,40 ; Convert to ASCII | ||
.IOT TTY,A1 | ||
JRST .PTTY | ||
.RET: MOVE A1,ASAV | ||
JRST 2,@UUOH | ||
|
||
GO: .OPEN TTY,.+1 | ||
1,,'TTY | ||
PTTY [SIXBIT / @/] | ||
.RDATE T, | ||
LDB A,[360400,,T] ; First digit of year | ||
IMULI A,10. | ||
LDB B,[300400,,T] ; Second digit of year | ||
ADD A,B | ||
IDIVI A,4 | ||
IMULI A,5 | ||
ADD A,B | ||
LDB C,[140600,,T] ; Month | ||
TLNE T,A | ||
ADDI C,10. | ||
JUMPN B,.+3 | ||
CAIG C,22 | ||
SOJ A, | ||
ADD A,MONTAB-1-'0 (C) | ||
LDB B,[060400,,T] ; First digit of day | ||
IMULI B,10. | ||
LDB D,[000400,,T] ; Second digit of day | ||
ADD A,D | ||
ADD A,B | ||
CAL2: ADDI A,5 ; This century starts on a Saturday | ||
IDIVI A,7 | ||
PTTY @WKDAY(B) | ||
PTTY @MONTH-1-'0 (C) | ||
LDB B,[001400,,T] ; MMDD | ||
ROT B,-14 | ||
TLO B,40 | ||
TLNN B,170000 | ||
LSH B,6 | ||
PTTY B | ||
PTTY [SIXBIT /, 20@/] ; Century | ||
MOVSI B,777700 | ||
AND B,T | ||
TLO B,40 | ||
PTTY B | ||
PTTY [SIXBIT / @/] | ||
.RTIME B, | ||
LSHC A,2*6 | ||
LSH A,6 | ||
IORI A,': | ||
LSHC A,2*6 | ||
LSH A,6 | ||
IORI A,': | ||
CAMGE A,[SIXBIT /12:00:/] | ||
JRST TPRT | ||
SUB A,[010200,,] | ||
TLNN A,002000 | ||
ADD A,[771200,,] | ||
XORI B,210000 | ||
TPRT: XORI B,'AM'@ | ||
PTTY A | ||
.IOT A,[15] ; CR | ||
.LOGOUT 1, | ||
ASCII /:KILL/ | ||
.USET | ||
0 | ||
|
||
MONTH: [SIXBIT/JANUARY @/] | ||
[SIXBIT/FEBRUARY @/] | ||
[SIXBIT/MARCH @/] | ||
[SIXBIT/APRIL @/] | ||
[SIXBIT/MAY @/] | ||
[SIXBIT/JUNE @/] | ||
[SIXBIT/JULY @/] | ||
[SIXBIT/AUGUST @/] | ||
[SIXBIT/SEPTEMBER @/] | ||
[SIXBIT/OCTOBER @/] | ||
[SIXBIT/NOVEMBER @/] | ||
[SIXBIT/DECEMBER @/] | ||
|
||
MONTAB: 0 | ||
3 | ||
3 | ||
6 | ||
1 | ||
4 | ||
6 | ||
2 | ||
5 | ||
0 | ||
3 | ||
5 | ||
|
||
WKDAY: [SIXBIT/MONDAY, @/] | ||
[SIXBIT/TUESDAY, @/] | ||
[SIXBIT/WEDNESDAY, @/] | ||
[SIXBIT/THURSDAY, @/] | ||
[SIXBIT/FRIDAY, @/] | ||
[SIXBIT/SATURDAY, @/] | ||
[SIXBIT/SUNDAY, @/] | ||
|
||
CONSTANTS | ||
|
||
ASAV: 0 | ||
|
||
END GO |