Re: A83: Random number...
[Prev][Next][Index][Thread]
Re: A83: Random number...
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
try this:
call _random ; get a random number
ld a, 40d ; prepare to multiply by 40
call _setXXOP2
call _fpMult ; do it!
ld a, 10d
call _fpAdd ; add 10 to OP1
call _convOP1 ; get the result back in de
now 10 <= DE <= 50
yean yean wrote:
>
> Hi,
>
> I'm sure it's very simple... :), but I ask.
> Is there a way to do in assembly like in basic : 10+rand*41 ????
> That thing will display a number between 10 and 50, I want to do
like this, but in asm.
> Is it possible ?
>
> THX ;)
>
> see ya,
> 'yhean
>
> Get your FREE Email at http://mailcity.lycos.com
> Get your PERSONALIZED START PAGE at http://personal.lycos.com
- --
Adam Loutzenhiser, professional serf of West Ottawa High School
[mailto:velex@geocities.com] [ICQ: 17091343]
[http://www.geocities.com/CapitolHill/Congress/2035/index.html]
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.0 for non-commercial use <http://www.pgp.com>
iQA/AwUBNmCa1SGD6d+yDkrHEQIaLACg7rk0kdbWXTi3wIbKTzHyp+1fkI8AnjIo
r6CokD0b/H+AzcgA3lvBsfsf
=jpQF
-----END PGP SIGNATURE-----
References: