Re: A83: Re: Random number...
[Prev][Next][Index][Thread]
Re: A83: Re: Random number...
Take out the ld a,e and try again. What you do is take out the value of e, then swap the registers then display them...weird
stuff will happen :)
HTH<
James Matthews (matthews@tkb.att.ne.jp)
ICQ: 7413754
http://home.att.ne.jp/gold/tomcat21/index.html
http://library.advanced.org/18242/
----------
> From: yean yean <yhean@mailcity.com>
> To: assembly-83@lists.ticalc.org
> Subject: Re: A83: Re: Random number...
> Date: Sunday, November 29, 1998 10:50 PM
>
>
>
> Thx James, but it doesn't work...... :(
> Let me tell you what I do after, to display the number :
>
> call _random
> ld a,40
> call _setxxop2
> call _fpmult
> ld a,10
> call _fpadd
>
> call _CONVOP1 ;
> ld a,e ; that's correct
> ex de,hl ; no ???
> call dispHL ;
>
> So, that gives me a number between 40 and 79 !
> I don't understand where's the problem. I have another problem, because if I try with
> 1 instead of 10, before "_fpadd", I always get a number between 40 and 79.
>
> Please help,
> 'yhean ;)
>
>
>
> On Sun, 29 Nov 1998 09:29:53 James Matthews wrote:
> >
> >This is a little slower probably than the ZLIB version, but it works:
> >
> > call _random
> > ld a,40
> > call _setxxop2
> > call _fpmult
> > ld a,10
> > call _fpadd
> >
> >OP1 now has a number between 10 and 50.
> >
> >HTH,
> >
> >James Matthews (matthews@tkb.att.ne.jp)
> >
> >ICQ: 7413754
> >http://home.att.ne.jp/gold/tomcat21/index.html
> >http://library.advanced.org/18242/
> >
> >----------
> >> From: yean yean <yhean@mailcity.com>
> >> To: assembly-83@lists.ticalc.org
> >> Subject: A83: Random number...
> >> Date: Sunday, November 29, 1998 5:10 AM
> >>
> >>
> >> 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