Datasheet
www.ti.com
Instruction Set Description
4.6.3.36 TSTX
* TSTX.A Test destination address-word
* TSTX.[W] Test destination word
* TSTX.B Test destination byte
TSTX.A dst
Syntax
TSTX dst or TSTX.W dst
TSTX.B dst
Operation dst + 0FFFFFh + 1
dst + 0FFFFh + 1
dst + 0FFh + 1
CMPX.A #0,dst
Emulation
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
255
SLAU144J–December 2004–Revised July 2013 CPUX
Submit Documentation Feedback
Copyright © 2004–2013, Texas Instruments Incorporated