38
ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
M8C Instruction Set
4.1
Add with Carry
ADC
Computes the sum of the two operands plus the carry value from the Flag register. The first oper-
and’s value is replaced by the computed sum. If the sum is greater than 255, the Carry Flag is set in
the Flag register. If the sum is zero, the Zero Flag is set in the Flag register.
Instructions
Operation
Opcode
Cycles Bytes
Mnemonic
Argument
ADC
A, expr
0x09
4
2
ADC
A, [expr]
0
x0A
6
2
ADC
A, [X+expr]
0x0B
7
2
ADC
[expr], A
0x0C
7
2
ADC
[X+expr], A
0x0D
8
2
ADC
[expr], expr
0x0E
9
3
ADC
[X+expr], expr
0x0F
10
3
Conditional
Flags:
CF
ZF
Set if the sum > 255; cleared otherwise.
Set if the result is zero; cleared otherwise.
Example 1:
mov
A, 0
;set accumulator to zero
or
F, 0x02
;set carry flag
adc
A, 12
;accumulator value is now 13
Example 2:
mov
[0x39], 0
;initialize ram[0x39]=0x00
mov
[0x40], FFh
;initialize ram[0x40]=0xFF
inc
[0x40]
;ram[0x40]=0x00, CF=1, ZF=1
adc
[0x39], 0
;ram[0x39]=0x01, CF=0, ZF=0
A
A
k CF
+ +
A
A
ram
k
CF
+
+
A
A
ram X k
+
CF
+
+
ram k
ram
k
A CF
+
+
ram X k
+
ram
X k
+
A CF
+
+
ram k
1
ram
k
1
k
2
CF
+
+
ram X k
1
+
ram X k
1
+
k
2
CF
+
+
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 ...