Crossware

Table of Contents        Previous topic       Next topic       

MICROPROCESSOR INSTRUCTION REFERENCE->BTST

BTST    Test a Bit

Compatibility: 68000, 68010, 68020, CPU32 families


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


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

Dn or #<data> specify the bit no. and <ea> may be data only

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>
    
BTSTDn,DnBTST#(data),Dn
BTSTDn,(An) BTST#(data),(An)
BTSTDn,(An)+BTST#(data),(An)+
BTSTDn,-(An)BTST#(data),-(An)
BTSTDn,(d16,An)BTST#(data),(d16,An)
BTSTDn,(d8,An,Xn)BTST#(data),(d8,An,Xn)
BTSTDn,(bd,An,Xn) 2BTST#(data),(bd,An,Xn) 2
BTSTDn,([bd,An,Xn],od) 1BTST#(data),([bd,An,Xn],od) 1
BTSTDn,([bd,An],Xn,od) 1BTST#(data),([bd,An],Xn,od) 1
BTSTDn,(xxx).WBTST#(data),(xxx).W
BTSTDn,(xxx).LBTST#(data),(xxx).L
BTSTDn,#(data)
BTSTDn,(d16,PC)BTST#(data),(d16,PC)
BTSTDn,(d8,PC,Xn)BTST#(data),(d8,PC,Xn)
BTSTDn,(bd,PC,Xn) 2BTST#(data),(bd,PC,Xn) 2
BTSTDn,([bd,PC,Xn],od) 1BTST#(data),([bd,PC,Xn],od) 1
BTSTDn,([bd,PC],Xn,od) 1BTST#(data),([bd,PC],Xn,od) 1

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

1   68020 only
2   68020 and CPU32 only