[A83] Re: cp-ing a register


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

[A83] Re: cp-ing a register




At 12:38 PM 9/29/2001 -0600, you wrote:

>I set a value to 'a' early in a program, but I want to do a cp on it and jp
>accordingly. It is my understanding that cp statements compare the last
>value to program used, with one that you specify. Is there a way to compare
>a given register with a value even if the register hasn't been used or
>altered for a while?


cp subtracts the argument from the accumulator, and sets flags 
accordingly.  The accumulator is not affected.  So: cp 1 is roughly 
equivelent to: a=a-1 : if a=0 then z=1 else nz=1 : a=a+1, but way faster.






References: