
Instruction Set Description
4.6.4.11 TSTA
* TSTA
Test 20-bit destination register
TSTA Rdst
Syntax
Operation
dst + 0 1
dst + 1
dst + 0FFh + 1
CMPA #0,Rdst
Emulation
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
242
CPUX
SLAU272C – May 2011 – Revised November 2013
Copyright © 2011–2013, Texas Instruments Incorporated