A86: Answer my Own Random Question =)


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

A86: Answer my Own Random Question =)




Hey Guys ...

	I was expirementing and figured it out ... For all you who want to know ...

-----------
_setxxop2			     equ	4617h
_convop1                         equ            5577h
_fpmult                          equ            548Ch

-----------
	call	_RANDOM
	ld	a,5				;Digit that you want, so Random 1-5 here
	call	_setxxop2
	call	_fpmult
	call	_convop1
	ld	a,e

			Thanks =)



At 04:30 AM 10/13/97 +0000, you (or was it I =) wrote:
>Hello Guys,
>	I missed the message about Random ... Is there a way to do a random #
>between 1-85 ?  The below is a routine for the Ti-83, if anyone cares to
>convert it, or someone tell me please an easier way ??  Thanks !
>
>;------------------------------------------------------------------
>
>;Where TEMP = 85 ....
>	
>random:
>	call _zerooop1		;0->op1
>	call _random			;rand # 0-1 -> op1
>	call _op2set0			;0->op2
>	ld a,(temp)			;temp->a
>	call _setxxop2		;'a'->op2
>	call _fpmult			;op1*op2->op1
>	call _trunc			;ipart(op1)->op1
>	call _plus1			;op1+1->op1
>	call _convop1			;op1->de
>	ld a,e				;e->a (e is the second 8 bits of de)
>	ret				;random done, return
>;------------------------------------------------------------------------
>
>
>							Ahmed
>Ahmed El-Helw
>ahmed3@worldnet.att.net
>http://asm83.home.ml.org
>The Ultimate TI-83 Site!
>http://asm86.home.ml.org
>The Ultimate TI-86 ASM Site
>ICQ :  3350394
>__________________________
>Member of The TI-Files!
>http://ti-files.home.ml.org
>Member of KickASM
>http://kickasm.home.ml.org
>
>
Ahmed El-Helw
ahmed3@worldnet.att.net
http://asm83.home.ml.org
The Ultimate TI-83 Site!
http://asm86.home.ml.org
The Ultimate TI-86 ASM Site
ICQ :  3350394
__________________________
Member of The TI-Files!
http://ti-files.home.ml.org
Member of KickASM
http://kickasm.home.ml.org


Follow-Ups: References: