48
ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
M8C Instruction Set
4.11
Increment
INC
Adds one to the argument. The argument’s original value is replaced by the new value. If the value
after the increment is 0x00, the Carry Flag and the Zero Flag will be set (original value must have
been 0xFF).
Instructions
Operation
Opcode
Cycles Bytes
Mnemonic
Argument
INC
A
0x74
4
1
INC
X
0x75
4
1
INC
[expr]
0x76
7
2
INC
[X+expr]
0x77
8
2
Conditional
Flags:
CF
ZF
Set if value after the increment is 0; cleared otherwise.
Set if the result is zero; cleared otherwise.
Example 1:
mov
A, 0x00
;initialize A to 0
or
F, 0x06
;make sure CF and ZF are set (1)
inc
A
;A=0x01, CF=0, ZF=0
Example 2:
mov
A, 0xFF
;initialize A to 0
and
F, 0x00
;make sure flags are all 0
inc
A
;A=0x00, CF=1, ZF=1
A
A 1
+
X
X 1
+
ram k
ram k
1
+
ram X k
+
ram X k
+
1
+
Summary of Contents for PSoC DESIGNER ImageCraft M8C
Page 6: ...6 ImageCraft Assembly Language Guide Document 001 44475 Rev B Contents Feedback ...
Page 10: ...10 ImageCraft Assembly Language Guide Document 001 44475 Rev B Introduction Feedback ...
Page 24: ...24 ImageCraft Assembly Language Guide Document 001 44475 Rev B M8C Microprocessor Feedback ...
Page 95: ...ImageCraft Assembly Language Guide Document 001 44475 Rev B 95 Assembler Directives Feedback ...
Page 96: ...96 ImageCraft Assembly Language Guide Document 001 44475 Rev B Assembler Directives Feedback ...
Page 104: ...104 ImageCraft Assembly Language Guide Document 001 44475 Rev B Feedback ...
Page 108: ...108 ImageCraft Assembly Language Guide Document 001 44475 Rev B Index Feedback ...