A86: Random Routine ???


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

A86: Random Routine ???



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