Re: A86: Random Integer
[Prev][Next][Index][Thread]
Re: A86: Random Integer
the ops are 10 byte floating point numbers. when you call _randint, op1
becomes a random integer between op1 and op2 (i have no idea how the system
gets the random number). when you call _convop1, ahl becomes the random
number, so if the number is less than 65536, it will be in hl, and if it is
less than 256, it will be in l. you can then load it into memory like this:
ld (var),l ;for less than 256
ld (var),hl ;for less than 65536
not sure how to load ahl, but anyway, you get the idea.
In a message dated 11/29/98 17:13:00 Eastern Standard Time, Bowser797@aol.com
writes:
> For this little piece of source, which someone posted earlier in response to
> my random integer question, how do I now display the random integer, or
> store
> it to a variable? Also, how exactly does it work to get the random ints?
I
> don't understand the ops.
>
> get_random_int:
> ld a,1
> call _setxxop1
> ld a,50
> call _setxxop2
> call _randint
> call _convop1
>
>
> Thanks,
> Bowser
>