INSTRUCTION DESCRIPTIONS

 

BTST

Bit Test

BTST

Operation:

Assembler Syntax:

 

D[n] C;

BTST

#n,X:ea

 

D[n] C;

BTST

#n,X:aa

 

D[n] C;

BTST

#n,X:pp

 

D[n] C;

BTST

#n,Y:ea

 

D[n] C;

BTST

#n,Y:aa

 

D[n] C;

BTST

#n,Y:pp

 

D[n] C;

BTST

#n,D

Description: Test the nth bit of the destination operand D. The state of the nth bit is stored in the carry bit C of the condition code register. The bit to be tested is selected by an immediate bit number from 0–23. This instruction is useful for performing serial to par- allel conversion when used with the appropriate rotate instructions. This instruction can use all memory alterable addressing modes.

Example:

:

 

 

 

 

 

BTST

#$0,X:<<$FFEE

ROL

A

:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Before Execution

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X:$FFEE

 

 

 

 

 

 

 

 

 

$000002

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SR

 

 

 

 

 

 

 

 

 

 

 

 

$0300

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

;read SSI serial input flag IF1 into C bit ;rotate carry bit C into LSB of A1

 

 

 

 

 

 

After Execution

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

X:$FFEE

 

 

 

$000002

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SR

 

 

 

$0301

 

 

 

 

 

 

 

 

 

 

 

 

Explanation of Example: Prior to execution, the 24-bit X location X:$FFEE (I/O SSI sta- tus register) contains the value $000002. The execution of the BTST #$1,X:<<$FFEE instruction tests the state of the 1st bit (serial input flag IF1) in X:$FFEE and sets the carry bit C accordingly. This instruction sequence illustrates serial to parallel conversion using the carry bit C and the 24-bit A1 register.

A - 64

INSTRUCTION SET DETAILS

MOTOROLA

Page 333
Image 333
Motorola 24-Bit Digital Signal Processor, DSP56000 manual Bit Test, Operation Assembler Syntax