Instruction Set Description
269
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
CPUX
4.6.4.11 TSTA
* TSTA
Test 20-bit destination register
Syntax
TSTA Rdst
Operation
dst + 0 1
dst + 1
dst + 0FFh + 1
Emulation
CMPA #0,Rdst
Description
The destination register is compared with zero. The status bits are set according to the
result. The destination register is not affected.
Status Bits
N:
Set if destination register is negative, reset if positive
Z:
Set if destination register contains zero, reset otherwise
C:
Set
V:
Reset
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Example
The 20-bit value in R7 is tested. If it is negative, continue at R7NEG; if it is positive but
not zero, continue at R7POS.
TSTA
R7
; Test R7
JN
R7NEG
; R7 is negative
JZ
R7ZERO
; R7 is zero
R7POS
......
; R7 is positive but not zero
R7NEG
......
; R7 is negative
R7ZERO
......
; R7 is zero