AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
Syntax:          TST {<cond>} {<P>} <operand1>, <operand2>
Operation:     Reflect result of operand one AND operand two
Flags:          N,Z,(C)

This instruction performs the logical bitwise ANDing of operands one and two, but does not store the result anywhere - instead the status flags are altered to reflect the result.

TST can be used to see if a particular bit in a data word is set or clear. The data word forms one operand. A bit mask, in which the appropriate bit is et, forms the other operand. After the TST operation the Z flag will be set if the bit is set in the data word, clear if it is not.

Examples:
TST  R1,#%1000     ; Test to see if bit 3 is set in R1
TST  R3,R4     ; Test if any bits set in both R3 and R4

Like CMP and CMN,this is another instruction where the S suffix is implied.
The C flag is set to the carry output bit generated by the shifter.

[sh-index] Back to list of manuals