Sub (Subtract Binary) (Word) - Renesas H8/300 Series Programming Manual

Table of Contents

Advertisement

SUB (SUBtract binary) (word)

<Operation>
Rd - Rs
Rd
<Assembly-Language Format>
SUB.W Rs, Rd
<Examples>
SUB.W R0, R1
<Operand Size>
Word
<Description>
This instruction subtracts a 16-bit source register from a 16-bit destination register and places
the result in the destination register.
<Instruction Formats>
Addressing
mode
Register direct
Mnem.
Operands
SUB.W
Rs, Rd
<Condition Code>
I
— —
I: Previous value remains unchanged.
H: Set to "1" when there is a borrow from
bit 11; 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" if an overflow occurs;
otherwise cleared to "0."
C: Set to "1" if there is a borrow from bit
15; otherwise cleared to "0."
Instruction code
1st byte
2nd byte
1
9
0 rs 0 rd
112
H
N
Z
3rd byte
4th byte
SUB
V
C
No. of
states
2

Advertisement

Table of Contents
loading

Table of Contents