Re: A83: TSE nearing completion


[Prev][Next][Index][Thread]

Re: A83: TSE nearing completion




If you need one to be absolutely as fast as possible, then this one that I
wrote a while ago works out fairly well.  It works by pulling "random" bytes
out of the ROM.  Not as nice as a table, but can't get away with that on the
calc:

; a fast, yet decent random number generator
; returns: a = psuedo random number
; destroyed: flags
RandomNumber:
 push bc
 ld a,r
 ld b,a
 ld a,($1234)
_@RandomNumberSeed =$-2
 ld c,a
 ld a,(bc)
 ld (_@RandomNumberSeed),a
 xor b
 sub b
 add a,c
 pop bc
 ret

> increment mode), yes? Can you be more specific about producing random
numbers?
> (please...)




Follow-Ups: References: