A86: Re: Random Integer
[Prev][Next][Index][Thread]
A86: Re: Random Integer
>
>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 ;load 1 into a (low number)
> call _setxxop1 ;load a (1) into OP1
> ld a,50 ;load 50 into a (high number)
> call _setxxop2 ;load a (50) into OP2
> call _randint ;call a routine which finds a random integer
between OP1 and OP2 and returns it in OP1
> call _convop1 ;put the new random integer (OP1) into a
Now, you can use SCaBBy's display a routine (which I don't have handy =( )
to display a in var-width font...
To save it to a temp variable, do this:
ld (var),a
var:
.db 0
______
JBrett
tbarwick@esn.net
ICQ UIN: 20607010
http://ww2.esn.net/~tbarwick
ACZ member
Plexus Publishing member
Follow-Ups: