mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
14 lines
217 B
NASM
Executable file
14 lines
217 B
NASM
Executable file
GenRandom_: ; 13a8f (4:7a8f)
|
|
; generate a random 16-bit integer and store it at $FFD3,$FFD4
|
|
ld a,[rDIV]
|
|
ld b,a
|
|
ld a,[H_RAND1]
|
|
adc b
|
|
ld [H_RAND1],a
|
|
ld a,[rDIV]
|
|
ld b,a
|
|
ld a,[H_RAND2]
|
|
sbc b
|
|
ld [H_RAND2],a
|
|
ret
|