Notice: Trying to access array offset on value of type bool in /mnt/cpcwiki-httpdocs/includes/libs/IPSet.php on line 243

Notice: Trying to access array offset on value of type bool in /mnt/cpcwiki-httpdocs/includes/libs/IPSet.php on line 246

Notice: Trying to access array offset on value of type bool in /mnt/cpcwiki-httpdocs/includes/libs/IPSet.php on line 243

Notice: Trying to access array offset on value of type bool in /mnt/cpcwiki-httpdocs/includes/libs/IPSet.php on line 246
Changes - CPCWiki

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