Instruction Set
33
CMPY
( Compare Y-register )
Function
: ( Y )
( M )
Description : Compare the Y-register with the contents of memory or immediate data.
The results effects N, Z, C and the Y-register and the contents of memory are unchanged.
Flag
:
Mnemonic
OP Code
Bytes
Cycles
CMPY #imm
7E
2
2
CMPY dp
8C
2
3
CMPY !abs
9C
3
4
Example
:
252 E122 3E00
LDY
#00H
253 E124 9E
CNTLOOP:
INC
Y
254 E125 D51AE0
LDA
!DATA+Y
255 E128 9F
TAY
256 E129 7E05
CMPY
#5H
257 E12B F0F7
BEQ
CNTLOOP
CMPW
( Compare word - YA )
Function
: ( YA )
( dp + 1 ) ( dp )
Description : Compare the 16bit accumulator(YA) with memory pair(16bit).
The results effects N, Z, C and the YA and the contents of memory are unchanged.
Flag
:
Mnemonic
OP Code
Bytes
Cycles
CMPW dp
5D
2
4
Example
:
531 C245 BD05
DECW
CMPDATL
532 C247 5D05
CMPW
CMPDATL ; YA(030FH) - (1)(CMPDATL)
533 C249 7004
BNE
NEXT
534 C24B C400
LDA
#0H
535 C24D 3E00
LDY
#0H
536 C24F DD03
NEXT:
TYA
DPL