AppleIIAsm-Collection/disks/disk3_math/T.RAND16.MIN
nathanriggs 16c1731e54 Strings 0.2.0 update
- bugfixes
- implemented required library
- commenting updates
- .min of every routine
2018-12-22 20:35:05 -05:00

37 lines
653 B
Plaintext

*
RAND16
*
LDA RNDL
STA :SEED
LDA RNDH
STA :SEED+1
LDA :SEED
BEQ :LOW0
ASL :SEED
LDA :SEED+1
ROL
BCC :NOEOR
:DOEOR
EOR #>$0369
STA :SEED+1
LDA :SEED
EOR #<$0369
STA :SEED
JMP :EXIT
:LOW0
LDA :SEED+1
BEQ :DOEOR
ASL
BEQ :NOEOR
BCS :DOEOR
:NOEOR
STA :SEED+1
:EXIT LDX :SEED+1
LDY :SEED
STY RETURN
STX RETURN+1
LDA #2
STA RETLEN
RTS
:SEED DS 2