You copied the Doc URL to your clipboard.

TST (immediate)

Test bits (immediate), setting the condition flags and discarding the result.

This instruction is an alias of ANDS (immediate).

Syntax

TST  Wn, #imm    ; 32-bit general registers
TST  Xn, #imm    ; 64-bit general registers

Where:

Wn

Is the 32-bit name of the general-purpose source register, in the range 0 to 31.

Xn

Is the 64-bit name of the general-purpose source register, in the range 0 to 31.

imm

Is the bitmask immediate. Such an immediate is a 32-bit or 64-bit pattern viewed as a vector of identical elements of size e = 2, 4, 8, 16, 32, or 64 bits. Each element contains the same sub-pattern: a single run of 1 to e-1 non-zero bits, rotated by 0 to e-1 bits. This mechanism can generate 5,334 unique 64-bit patterns (as 2,667 pairs of pattern and their bitwise inverse). Because the all-zeros and all-ones values cannot be described in this way, the assembler generates an error message.

Note

Logical immediate instructions do not set the condition flags, but interesting results can usually directly control a CBZ, CBNZ, TBZ, or TBNZ conditional branch.