44
ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
M8C Instruction Set
4.7
Non-Destructive Compare
CMP
Subtracts the second argument from the first. If the difference is less than zero the Carry Flag is set.
If the difference is 0 the Zero Flag is set. Neither operand’s value is destroyed by this instruction.
Instructions
Operation
Opcode
Cycles Bytes
Mnemonic
Argument
CMP
A, expr
0x39
5
2
CMP
A, [expr]
0x3A
7
2
CMP
A, [X+expr]
0x3B
8
2
CMP
[expr], expr
0x3C
8
3
CMP
[X+expr], expr
0x3D
9
3
Conditional
Flags:
CF
ZF
Set if Operand 1 < Operand 2; cleared otherwise.
Set if the operands are equal; cleared otherwise.
Example:
mov
A, 34
;initialize the accumulator to 34
cmp
A, 33
;A>=34 CF cleared, A != 33 ZF cleared
cmp
A, 34
;A=34 CF cleared, ZF set
cmp
A, 35
;A<35 CF set, A != 35 ZF cleared
A k
–
A ram k
–
A ram X k
+
–
ram k
1
k
2
–
ram X k
1
+
k
2
–
Содержание PSoC DESIGNER ImageCraft M8C
Страница 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Страница 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Страница 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Страница 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Страница 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Страница 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Страница 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...