-
Notifications
You must be signed in to change notification settings - Fork 87
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
ed921b8
commit 8e3ed08
Showing
2 changed files
with
157 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
TITLE Light Show | ||
|
||
;Default is to build for both TS and NTS. | ||
IFNDEF TS,TS==1 | ||
IFNDEF NTS,NTS==1 | ||
|
||
A=1 | ||
B=2 | ||
T=10 | ||
TT=11 | ||
Q=16 | ||
P=17 | ||
|
||
APR==0 | ||
PI==4 | ||
|
||
TICKS=20*60. ;20 seconds. | ||
PDLLEN==20 | ||
|
||
GO: MOVE P,[-PDLLEN,,PDL-1] | ||
IFN TS,[ | ||
;Timesharing code starts here. If not present, fall through to | ||
;non-timesharing code. | ||
SETO A, ;Enable IOT luser mode. | ||
.IOTLSR A, ;Jump to UUO handler on NTS. | ||
MOVE A,[SQUOZE 0,MIPGDS] | ||
.EVAL A, | ||
.VALUE | ||
HRLI A,[-1] ;Have ITS not clobber memory indicators. | ||
.SETLOC A, | ||
MOVE A,[%RLFLS\%RLSET,,[1]] | ||
.REALT A, ;Clock interrupt every 1/60 seconds. | ||
.SUSET [.SMASK,,[%PIRLT]] | ||
JFCL | ||
.HANG | ||
|
||
TSINT: 0 | ||
0 | ||
PUSH P,A | ||
SKIPL A,TSINT | ||
TLNN A,(%PIRLT) ;Is this the clock interrupt? | ||
.DISMIS TSINT+1 | ||
POP P,A | ||
PUSHJ P,LITES | ||
.DISMIS TSINT+1 | ||
|
||
ZZ==. | ||
LOC 42 | ||
TSINT | ||
LOC ZZ | ||
] | ||
|
||
IFN NTS,[ | ||
;Non-timesharing code starts here. If TS code executed first, | ||
;the UUO hanler will be called and jump here. | ||
NTS1: CONO APR,5002 ;APR interrupt at channel 2. | ||
CONO APR,2002 ;Enable clock. | ||
CONO PI,12240 ;Enable interrupt. | ||
JRST . | ||
|
||
APRBRK: 0 | ||
CONSO APR,1000 ;Is this the clock interrupt? | ||
JRST 12,@APRBRK | ||
PUSHJ P,LITES | ||
CONO APR,3002 | ||
JRST 12,@APRBRK | ||
|
||
ZZ==. | ||
LOC 41 | ||
JRST NTS1 | ||
LOC 44 | ||
JSR APRBRK | ||
LOC ZZ | ||
] | ||
|
||
LITES: PUSH P,A | ||
SKIPE TICK | ||
JRST LITES0 | ||
MOVE A,[TICKS] ;Pattern ran out of ticks, get new one. | ||
MOVEM A,TICK | ||
MOVE A,PATRN | ||
CAIN A,PATRNE | ||
MOVEI A,PATRNS ;Reached end of list. | ||
MOVEM A,PATRN | ||
MOVE A,@PATRN | ||
AOS PATRN | ||
MOVEM A,PC' | ||
LITES0: MOVE Q,PC | ||
POP P,A | ||
JSP Q,(Q) ;Coroutine call. | ||
MOVEM Q,PC | ||
DATAO PI,A ;Display A on memory indicators. | ||
SOS TICK | ||
POPJ P, | ||
|
||
|
||
COUNTER: ;Simple counter pattern. | ||
SETZ A, | ||
JSP Q,(Q) | ||
AOS A | ||
JRST .-2 | ||
|
||
ROT777: MOVEI A,777 ;Rotating pattern. | ||
JSP Q,(Q) | ||
ROT A,1 | ||
JRST .-2 | ||
|
||
.INSRT XOROSH | ||
|
||
RANDOM: PUSHJ P,XOROSHIRO ;Random generator. | ||
JSP Q,(Q) | ||
JRST RANDOM | ||
|
||
SAIL: SETZ A, ;SAIL null job. | ||
SAIL0: ROT A,-1 | ||
TLNN A,200000 | ||
TLC A,400000 | ||
JSP Q,(Q) ? JSP Q,(Q) ? JSP Q,(Q) | ||
JRST SAIL0 | ||
|
||
PATRNS: COUNTER | ||
ROT777 | ||
RANDOM | ||
SAIL | ||
PATRNE: | ||
|
||
PATRN: PATRNE | ||
TICK: 0 | ||
PDL: BLOCK PDLLEN | ||
|
||
END GO |
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,26 @@ | ||
xstate: -1,, ? 1 | ||
|
||
parm.a==2 | ||
parm.b==9 | ||
parm.c==5 | ||
parm.r==11. | ||
|
||
xoroshiro: | ||
push p,t | ||
move t,xstate | ||
xorm t,xstate+1 | ||
rot t,parm.a | ||
xor t,xstate+1 | ||
movem t,xstate | ||
move t,xstate+1 | ||
lsh t,parm.b | ||
xorm t,xstate | ||
move t,xstate+1 | ||
rot t,parm.c | ||
movem t,xstate+1 | ||
pop p,t | ||
move a,xstate | ||
add a,xstate+1 | ||
rot a,parm.r | ||
add a,xstate | ||
popj p, |