Changes

Jump to: navigation, search

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 (rand8Rand8 +1),a
ld l,a ; HL now contains a random 16-bit number
ret
</pre>
[[Category:Programming]]
1,165
edits