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?




>  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.  if u
want to save it, you need to push it onto the floating point stack.

>  call _OP2SET1            ;OP2=1
>  call _FPSUB                ;OP1=y-1
>  call _OP6TOOP2        ;OP2=y

so when u do this, you're not getting anything to move.  that might be why
u have the overflow error.  not sure though.
>Plot:
>  call _OP6TOOP1    ;OP1=y
>  ld a,64
>  call _SetXXOP2      ;OP2=64
>  call _FPMULT         ;OP1=y*64
>  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.

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)


Follow-Ups: References: