A83: Random Numbers


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

A83: Random Numbers




I've been fiddling around w/ the rom calls and trying to make a random
# routine, but all it ever spits out is '0' -- what's wrong w/ this?

	;store max. value for random # in 'a'
        call 4A78h      ;_setxxop2 (store 'a' in op2)
        call 50B6h      ;_random (generate random # in op1)
        call 40AAh      ;_fpmult (multiply op1 by op2)
        call 4EFCh      ;_convop1 (store op1 in 'a')
        ld (result),a   ;store result


References: