Home
Random
Watchlist
Settings
Log in
About CPCWiki - THE Amstrad CPC encyclopedia!
Disclaimers
Open main menu
Changes
Programming:Random Number Generator
12 bytes added
,
08:47, 17 December 2010
/* 16-bit Random Number Generator using 'r' register */ changed labels, added ret
<pre>
Rand16
ld a,r
ld h,a
.rand8
Rand8
ld b,a
add a,a
add a,a
add a,b
inc a
ld (
rand8
Rand8
+1),a
ld l,a ; HL now contains a random 16-bit number
ret
</pre>
[[Category:Programming]]
← Older edit
Newer edit →
Octoate
1,165
edits