121
2.2.53(1) SUB (subtract binary) (byte)
Operation
Rd - Rs
→
Rd
Assembly-Language Format
SUB.B Rs, Rd
Operand Size
Byte
Condition Code
I
H
N
Z
V
C
—
—
∆
—
∆
∆
∆
∆
I:
Previous value remains unchanged.
H:
Set to 1 when there is a borrow from bit 3; otherwise cleared to 0.
N:
Set to 1 when the result is negative; otherwise cleared to 0.
Z:
Set to 1 when the result is zero; otherwise cleared to 0.
V:
Set to 1 when an overflow occurs; otherwise cleared to 0.
C:
Set to 1 when there is a borrow from bit 7; otherwise cleared to 0.
Description
This instruction subtracts an 8-bit source register from an 8-bit destination register and places
the result in the destination register.
Only register direct addressing is supported. To subtract immediate data it is necessary to use the
SUBX.B instruction, first setting the zero flag to 1 and clearing the carry flag to 0.
The following codings can also be used to subtract nonzero immediate data.
(1) ORC #H'05, CCR
SUBX #(Imm - 1), Rd
(2) ADD #(0 - Imm), Rd
XORC #H'01, CCR
Summary of Contents for H8/300L Series
Page 1: ...H8 300L Series Programming Manual ...
Page 6: ...iv ...
Page 8: ...2 ...
Page 11: ......
Page 14: ......
Page 46: ......
Page 48: ......
Page 60: ......
Page 83: ......
Page 116: ......
Page 150: ...144 ...
Page 151: ......
Page 156: ...150 ...