dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 614

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
SUB.B
Operation:
D – S →
Description: Subtract a 9-bit signed immediate integer from the 8-bit portion of the destination register, and store
Usage:
Example:
Explanation of Example:
Condition Codes Affected:
A-270
Before Execution
A2
D
0
the result in the destination (D). The value is internally sign extended to 20 bits before the operation.
If the destination is a 16-bit register, it is first sign extended before the subtraction is performed. The
immediate integer is used to represent 8-bit unsigned values from 0 to 255 as well as the signed range:
–128 to 127. The condition codes are calculated based on the 8-bit result, with the exception of the E
and U bits, which are calculated based on the 20-bit result. The result is not affected by the state of the
saturation bit (SA).
This instruction can be used for both integer and fractional two’s-complement data.
SUB.B
Prior to execution, the 36-bit A accumulator contains the value $0:3158:1234. The SUB.B instruction
automatically sign extends the immediate value to 20 bits and subtracts the result from the A2:A1 por-
tion of the A accumulator. The 8-bit result ($00) is stored back into the low-order 8 bits of A1.
E
U
N
Z
V
C
LF
15
— Set if the extension portion of the 20-bit result is in use
— Set if the 20-bit result is unnormalized
— Set if bit 7 of the result is set
— Set if the result equals zero
— Set if overflow has occurred in the result
— Set if a borrow occurs from bit 7 of the result
(no parallel move)
3158
P4
14
A1
#$58,A
13
P3
SR
P2
12
MR
DSP56800E Core Reference Manual
P1
11
1234
0300
A0
P0
10
Subtract Byte
; subtract hex 58 from A accumulator
I1
9
Assembler Syntax:
SUB.B
I0
8
SZ
7
After Execution
6
L
A2
0
5
E
S,D
U
4
CCR
3100
A1
N
3
(no parallel move)
SR
2
Z
Freescale Semiconductor
V
1
1234
0314
C
0
A0
SUB.B

Related parts for dsp56800e