NXP Semiconductors
PT2001SWUG
PT2001 programming guide and instruction set
PT2001SWUG
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2019. All rights reserved.
User guide
Rev. 3.0 — 29 April 2019
3 / 153
and store). It is possible to transfer constant values to the ALU immediate register using
the ldirl and ldirh instructions.
When a multicycle instruction is required, it is recommended to wait until the operation
is finished (ex: cwer Dest opd row1) before going to the next instruction. The operation
completion can be checked by reading back the bit OP_DONE of the Arithmetic
Condition Register (arith_reg).
2.2.1 Arithmetic condition register
The 16-bit register contain the status of the ALU concerning the last requested operation.
Table 1. Arithmetic condition register
Bit
Name
Description
15
SHIFT_OUT
Shifted out bit
14
CONV_SIGN
Last conversion sign
13
CARRY
Carryover bit
12 to 1
ARITH_LOGIC
Arithmetic logic
10
MASK_MIN
Mask result 0000h
9
MASK_MAX
Mask result FFFFh
8
MUL_SHIFT_OVR
Multiplication shift overflow
7
MUL_SHIFT_LOSS
Multiplication shift precision loss
6
RES_ZERO
Addition or subtraction result is zero
5
RES_SIGN
Addition or subtraction sign result
4
UNSIGNED_UND
Unsigned underflow
3
UNSIGNED_OVR
Unsigned overflow
2
SIGNED_UND
Signed underflow
1
SIGNED_OVR
Signed overflow
0
OP_DONE
Operation complete
•
SHIFT_OUT is the last bit shifted out (either left or right) from a shift operation.
•
CONV_SIGN is the product of all signs removed by toint instruction. This bit can be
reset by performing a toint conversion with an rst parameter.
•
CARRY is the carry produced by the last addition or subtraction operation performed.
•
ARITH_LOGIC is a parameter used for addition and subtraction operations. It has four
possible values:
–
"00" or "10": no limitation is imposed on addition or subtraction. In case of an
overflow, the result should be represented by 17 bits, but only the 16 LSBs of this
result are put in the target register. In case of an underflow, the result put in the target
register is "65536 - the correct result", which can always be represented on 16 bits.
–
"01": the result of addition or subtraction are saturated between the maximum
possible value (if overflow) or the minimum possible value (if underflow). The
numbers are considered to be two's complement representation, so they are
saturated between 8000h (–32768) and 7FFFh (+32767).
•
"11": the result of addition or subtraction are saturated between the maximum possible
value (if overflow) or the minimum possible value (if underflow). The numbers are