dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 616

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
SUB.BP
Operation:
D – S →
Description: Subtract a byte stored in memory from the 8-bit portion of the destination register, and store the result
Usage:
Example:
Explanation of Example:
Condition Codes Affected:
A-272
(word address) X:$2000
Before Execution
A2
D
0
in the destination (D). The value is internally sign extended to 20 bits before the operation. If the des-
tination is a 16-bit register, it is first correctly sign extended before the subtraction is performed. 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. Absolute addresses are expressed as byte addresses. 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.BP X:$4000,A
Prior to execution, the 36-bit A accumulator contains the value $0:3100:1234. The SUB.BP instruction
automatically sign extends the memory byte to 20 bits and subtracts the result from the A2:A1 portion
of the A accumulator. The 8-bit result ($10) is stored back into the low-order 8 bits of A1. The C bit
in the CCR is set because a borrow took place.
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)
3100
P4
14
A1
13
P3
SR
P2
12
Subtract Byte (Byte Pointer)
MR
DSP56800E Core Reference Manual
P1
11
1234
44F0
0300
A0
P0
10
; subtract byte in memory from A accumulator
I1
9
Assembler Syntax:
SUB.BP
I0
8
SZ
7
After Execution
6
L
A2
0
5
E
S,D
U
4
CCR
3110
A1
X:$2000
N
3
(no parallel move)
SR
2
Z
Freescale Semiconductor
V
1
44F0
1234
0311
SUB.BP
C
0
A0

Related parts for dsp56800e