ImageCraft Assembly Language Guide, Document # 001-44475 Rev. *B
69
M8C Instruction Set
4.32
Subtract with Borrow
SBB
Computes the difference of the two operands plus the carry value from the Flag register. The first
operand’s value is replaced by the computed difference. If the difference is less than ‘0’ the Carry
Flag is set in the Flag register. If the difference is zero, the Zero Flag is set in the Flag register; other-
wise, the Zero Flag is cleared.
Instructions
Operation
Opcode
Cycles Bytes
Mnemonic
Argument
SBB
A, expr
0x19
4
2
SBB
A, [expr]
0x1A
6
2
SBB
A, [X+expr]
0x1B
7
2
SBB
[expr], A
0x1C
7
2
SBB
[X+expr], A
0x1D
8
2
SBB
[expr], expr
0x1E
9
3
SBB
[X+expr], expr
0x1F
10
3
Conditional
Flags:
CF
ZF
Set if treating the numbers as unsigned, the difference < 0; cleared other-
wise.
Set if the result is zero; cleared otherwise.
Example 1:
mov
A, 0
;set accumulator to zero
or
F, 0x02
;set carry flag
sbb
A, 12
;accumulator value is now 0xF3
Example 2:
mov
[0x39], 2
;initialize ram[0x39]=0x02
mov
[0x40], FFh
;initialize ram[0x40]=0xff
inc
[0x40]
;ram[0x40]=0x00, CF=1
sbb
[0x39], 0
;ram[0x39]=0x01
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
+
–
Содержание 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 ...