Sbc - Subtract With Carry - Samsung SAM88RCRI S3C9442 Manual

Table of Contents

Advertisement

S3C9442/C9444/F9444/C9452/C9454/F9454
SBC
— Subtract With Carry
SBC
dst,src
dst ← dst – src – c
Operation:
The source operand, along with the current value of the carry flag, is subtracted from the
destination operand and the result is stored in the destination. The contents of the source are
unaffected. Subtraction is performed by adding the two's-complement of the source operand to
the destination operand. In multiple precision arithmetic, this instruction permits the carry
("borrow") from the subtraction of the low-order operands to be subtracted from the subtraction of
high-order operands.
Set if a borrow occurred (src > dst); cleared otherwise.
Flags:
C:
Z:
Set if the result is "0"; cleared otherwise.
S:
Set if the result is negative; cleared otherwise.
V:
Set if arithmetic overflow occurred, that is, if the operands were of opposite sign and the sign of
the result is the same as the sign of the source; cleared otherwise.
Format:
opc
opc
opc
Examples:
Given: R1 = 10H, R2 = 03H, C = "1", register 01H = 20H, register 02H = 03H, and register
03H = 0AH:
SBC
SBC
SBC
SBC
SBC
In the first example, if working register R1 contains the value 10H and register R2 the value 03H,
the statement "SBC R1,R2" subtracts the source value (03H) and the C flag value ("1") from the
destination (10H) and then stores the result (0CH) in register R1.
dst | src
src
dst
dst
src
R1,R2
R1 = 0CH, R2 = 03H
R1,@R2
R1 = 05H, R2 = 03H, register 03H = 0AH
01H,02H
Register 01H = 1CH, register 02H = 03H
01H,@02H →
Register 01H = 15H,register 02H = 03H, register 03H = 0AH
01H,#8AH
Register 01H = 95H; C, S, and V = "1"
SAM88RCRI INSTRUCTION SET
Bytes
Cycles
Opcode
2
4
6
3
6
6
3
6
Addr Mode
(Hex)
dst
src
32
r
r
33
r
lr
34
R
R
35
R
IR
36
R
IM
6-43

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sam88rcri s3c9444Sam88rcri s3c9452Sam88rcri s3c9454

Table of Contents