Re: A86: How do you get the value in OP1 into a register?
[Prev][Next][Index][Thread]
Re: A86: How do you get the value in OP1 into a register?
watch out for side affects.
On Sun, 24 May 1998 17:09:15 -0500 Robby Gutmann
<gutmann@planet-connect.com> writes:
>
>> call _OP2TOOP6 ;OP6=y
>> ld c,0 ;c = iteration counter
>>CALC:
>> call _OP6TOOP1 ;OP1=y
>
>once you do this, i'm pretty sure the value of y is no longer in OP6.
op6toop1 just copies, op6 stays the same.
it might change c
>>Plot:
>> call _OP6TOOP1 ;OP1=y
>> ld a,64
>> call _SetXXOP2 ;OP2=64
a now is $64=100
(setxxop2 converts a to bcd)
>> call _FPMULT ;OP1=y*64
fpmult destorys a as well as hl,de,bc, and op3
>> call _OP1TOOP2 ;OP2=OP1
>> call _SetXXOP1 ;OP1=64
>> call _FPSUB ;OP1=64-y*64
>> call _INTGR ;get integer value of OP1
>>;what do I need to put in order to get d to equal the value in OP1
>
>you could use _convop1 (not sure of the equate). it puts the floating
>point number in op1 in de. i think that's exactly what you want.
>sometimes, though, i get problems using it because de is 2 bytes, and
>the
>ops are 11.
convop1 is $5577
de=op1,a=e (so if op1<256 a=op1)
it also destroys op1, bc, and hl
you should probly save the registers on the stack (push&pop) or in memory
or reload them in a lot of places. it gets really annoying.
-josh
>
>I hope this helps. What exactly is the prog supposed to do? i can't
>tell.
> thanx.
>
>Robby Gutmann
>gutmann@planet-connect.com
>ICQ UIN: 724927 Agonostis on IRC
>
>Of course, Ankh-Morpork's citizens had always claimed that the river
>water
>was incredibly pure. Any water that had passed through so many
>kidneys,
>they reasoned, had to be very pure indeed.
> -- (Terry Pratchett, Sourcery)
>
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
References: