Re: A86: Re: getting _randint to work
[Prev][Next][Index][Thread]
Re: A86: Re: getting _randint to work
>Ahh, now I understand. Store the lower bound in OP1 and the upper bound in
>OP2 and it works perfectly. It has absolutely nothing to do with the
>floating point stack.
Cool. Too bad it only seems to work up to 99 (which seems like 2 BCD
numbers). Anything
greater then that it seems to wrap around. Like if I did 100 it would
display 0 only.. you
will also find this along with some other calls I added to Rom Central.
-Matt
matt2000@gte.net
http://www.dogtech.com/cybop/ti86/
;----------------------------------
#include "ti86asm.inc"
;Defined in ti86un.inc
_randint equ $5544
_dispOP1 equ $515b
_setxxOP1 equ $4613 ;convert hex # in a to flt point in OP1
_setxxOP2 equ $4617 ;convert hex # in a to flt point in OP2
.org _asm_exec_ram
;Find number between 0 and 99
;Min
ld a, 0
call _setxxOP1
;Max
ld a, 99
call _setxxOP2
call _randint
call _dispOP1 ;Displays that random integer
.end