Hyundai GMS800 Instruction Manual page 37

Gms800 series 8-bit single-chip microcomputers
Table of Contents

Advertisement

CMPY

Function
: ( Y )
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
CMPY #imm
CMPY dp
CMPY !abs
Example
:
252 E122 3E00
253 E124 9E
254 E125 D51AE0
255 E128 9F
256 E129 7E05
257 E12B F0F7
CMPW

Function
: ( YA )
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
CMPW dp
Example
:
531 C245 BD05
532 C247 5D05
533 C249 7004
534 C24B C400
535 C24D 3E00
536 C24F DD03
( Compare Y-register )
( M )
OP Code
7E
8C
9C
LDY
CNTLOOP:
INC
LDA
TAY
CMPY
BEQ
( Compare word - YA )
( dp + 1 ) ( dp )
OP Code
5D
DECW
CMPW
BNE
LDA
LDY
NEXT:
TYA
Bytes
Cycles
2
2
2
3
3
4
#00H
Y
!DATA+Y
#5H
CNTLOOP
Bytes
Cycles
2
4
CMPDATL
CMPDATL ; YA(030FH) - (CMPDATL+1)(CMPDATL)
NEXT
#0H
#0H
DPL
Instruction Set
33

Advertisement

Table of Contents
loading

Table of Contents