A86: Re: getting _randint to work


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

A86: Re: getting _randint to work




The value stored in _FPS is the 16-bit address in RAM page 1 of the top of
the floating point stack. E.g., if there are no floating point operations in
progress, the value is the same as in _FPBASE, which is $0000, since the
floating point stack starts at the beginning of ram page 1.

I assume that he does not mean for you to load the value into (_FPS) itself,
but into the top of the floating point stack on RAM page 1.
I guess it would be stored in the same format as an OP, not sure though.


>
>This was the description of randint in the undocumented .inc file
>
>_randint  equ $5544
>;Random Integer in OP1, for b >= a
>;Input: _OP1 = a; _FPS = b; a and b are the range of the random integer
>;Output: _OP1 = random integer
>
>How do you get it to work? I tried putting _OP1 a floating point, then a
>normal, I tried
>loading an 8-bit val into _FPS, then a 16-bit, then a 24-bit, _FPS was
>always greater
>then _OP1, I even tried switching them, but that didnt work. I even tried
>using _OPS instead of OP1 thinking it was a spelling mistake or something..
>Anyone know how to get this stupid rom call to work?
>
>All I wanted to do is get a random number with this rom call and display it
>using _dispOP1 ($515B)
>
>-Matt


Follow-Ups: