Crossware

Table of Contents        Previous topic       Next topic       

MICROPROCESSOR INSTRUCTION REFERENCE->BTST

BTST    Test a Bit

Complement (<bit no.> Destination) -> Z

    
Assembler Syntax: BTST Dn,<ea>
BTST #<data>,<ea>

Dn or #<data> specify the bit number

Size:  Byte, Long


Tests a bit in the destination operand and sets the Z condition code appropriately.  When a data register is the destination, any of the 32 bits can be specified by a modulo 32-bit number.  When a memory location is the destination, the operation is a byte operation, and the bit number is modulo 8.  In all cases, bit zero refers to the leaset significant bit.

Condition Codes:

N    Not affected
Z    Set if bit tested = 0, else clear
V    Not affected
C    Not affected
X    Not affected

    
Allowable Addressing Modes
    
Dn,<ea> #<data>,<ea>
    
Dn,Dn#(data),Dn
Dn,(An) #(data),(An)
Dn,(An)+#(data),(An)+
Dn,-(An)#(data),-(An)
Dn,(d16,An)#(data),(d16,An)
Dn,(d8,An,Xn)
Dn,(xxx).W
Dn,(xxx).L
Dn,#(data)
Dn,(d16,PC)
Dn,(d8,PC,Xn)

Dn,Dn and #(data),Dn are long only; all others are byte only.