RE: A86: TI-86 ASM Questions...


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

RE: A86: TI-86 ASM Questions...




from a, use _setxxop1 [that loads a into op1]
from hl, use _setxxxxop2 / _op2toop1 [load hl into op1]

now for random routine, i used one w/ops in DuckHunt, but I found Jimmy's to
be a lot better.. this generates a random # between 0 and a.


Random:	       ; Creates a pseudorandom number 0 <= x < A
 ld b,a	       ; Thanks to Jimmy Mardell for this routine
 ld a,r
 add a,a
 ld hl,0
 ld d,0
 ld e,a
RMul:
 add hl,de
 djnz RMul
 ld a,h
 ret

--
Ahmed El-Helw
ahmedre@bellsouth.net
http://asm8x.home.ml.org
ICQ: 3350394

-----Original Message-----
From: owner-assembly-86@lists.ticalc.org
[mailto:owner-assembly-86@lists.ticalc.org]On Behalf Of
GrafixxHQ@aol.com
Sent: Tuesday, August 18, 1998 11:12 PM
To: assembly-86@lists.ticalc.org
Subject: A86: TI-86 ASM Questions...



Oops.. I thought of one more question:

Is there an easy way to get a random number, or how do you get the random
number in OP1 to hl or a (If this is the easiest way)?

thanks
Sean Hilty
Grafixx Software


References: