Instruction Set Description
253
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
CPUX
4.6.3.36 TSTX
* TSTX.A
Test destination address-word
* TSTX.[W]
Test destination word
* TSTX.B
Test destination byte
Syntax
TSTX.A dst
TSTX dst
or
TSTX.W dst
TSTX.B dst
Operation
dst + 0 1
dst + 1
dst + 0FFh + 1
Emulation
CMPX.A #0,dst
CMPX #0,dst
CMPX.B #0,dst
Description
The destination operand is compared with zero. The status bits are set according to the
result. The destination is not affected.
Status Bits
N:
Set if destination is negative, reset if positive
Z:
Set if destination contains zero, reset otherwise
C:
Set
V:
Reset
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Example
RAM byte LEO is tested; PC is pointing to upper memory. If it is negative, continue at
LEONEG; if it is positive but not zero, continue at LEOPOS.
TSTX.B
LEO
; Test LEO
JN
LEONEG
; LEO is negative
JZ
LEOZERO
; LEO is zero
LEOPOS
......
; LEO is positive but not zero
LEONEG
......
; LEO is negative
LEOZERO
......
; LEO is zero