aboutsummaryrefslogtreecommitdiff
path: root/rand.s
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2015-12-29 23:10:50 -0500
committerB. Watson <yalhcru@gmail.com>2015-12-29 23:10:50 -0500
commit2300d2813a524cbfeabac794335e7abe99263df6 (patch)
treed729ca4f99634788cbb3a2101a5b5854a4bc2d06 /rand.s
downloadtaipan-2300d2813a524cbfeabac794335e7abe99263df6.tar.gz
initial commit
Diffstat (limited to 'rand.s')
-rw-r--r--rand.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/rand.s b/rand.s
new file mode 100644
index 0000000..c48478e
--- /dev/null
+++ b/rand.s
@@ -0,0 +1,23 @@
+
+ .export _randi, _randl
+ .importzp sreg
+
+RANDOM = 53770 ; POKEY LFSR read address, defined in the Atari OS
+
+; void __fastcall__ randi(void);
+_randi:
+ lda #0
+ sta sreg
+ beq randl1
+
+; void __fastcall__ randl(void);
+_randl:
+ lda RANDOM
+randl1:
+ sta sreg
+ lda RANDOM
+ sta sreg+1
+ lda RANDOM
+ ldx RANDOM
+ rts
+