Re: A83: CP with register DE?
[Prev][Next][Index][Thread]
Re: A83: CP with register DE?
In a message dated 29-01-99 11:07:30 AM Eastern Standard Time, AtmaZ@aol.com
writes:
<< Hi all,
What the sources on Z80 ASM have taught me is that CP only works with
register
A. However, the below usage of CP is contradictory to that rule...take a
look
at this.
Here's the code:
call _getk ; get keycode
call _op2toop1 ; swap OPs
call _convop1 ; put OP1 in -->DE<-- and not A
cp 22 ; compare with [MODE] keycode
ret z ; exit if pressed
>>
This works because CP compairs to a, not with a. So, when you do cp 22, it
checks to see if a=22.
-David