Re: A86: Answer my Own Random Question =)


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

Re: A86: Answer my Own Random Question =)



hmm...
	You did add the headers and ret, etc?  I did a cp/jp for a.  I did the
routine then said cp 1 , jp diisp1, so on ...  it worked w/me ...

At 07:25 PM 10/12/97 +0000, you wrote:
>Ahmed El-Helw wrote:
>> 
>> 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
>> 
>i tried this routine and when it exits the program it shuts it off and
>turns the contrast down to 0 and u gotta press on then take out a batt
>and put back in to turn it on, kinda similar to the off routine
>
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: