INSTRUCTION DESCRIPTIONS

 

BSET

Bit Test and Set

 

Operation:

Assembler Syntax:

 

D[n] C;

BSET

#n,X:ea

 

1 D[n]

 

 

 

D[n] C;

BSET

#n,X:aa

 

1 D[n]

 

 

 

D[n] C;

BSET

#n,X:pp

 

1 D[n]

 

 

 

D[n] C;

BSET

#n,Y:ea

 

1 D[n]

 

 

 

D[n] C;

BSET

#n,Y:aa

 

1 D[n]

 

 

 

D[n] C;

BSET

#n,Y:pp

 

1 D[n]

 

 

 

D[n] C;

BSET

#n,D

 

1 D[n]

 

 

Description: Test the nth bit of the destination operand D, set it, and store the result in the destination location. 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 performs a read-modify-write operation on the destination location using two destination accesses before releasing the bus. This instruction provides a test-and- set capability which is useful for synchronizing multiple processors using a shared mem- ory. This instruction can use all memory alterable addressing modes.

Example:

:

 

 

BSET

#$0,X:<<$FFE5

;test and clear bit 14 in I/O Port B Data Reg.

:

 

 

X:$FFE5

Before Execution

$000000

X:$FFE5

After Execution

$000001

SR

$0300

SR

$0300

A - 56

INSTRUCTION SET DETAILS

MOTOROLA

Page 325
Image 325
Motorola 24-Bit Digital Signal Processor, DSP56000 manual Bset, Bit Test and Set Operation Assembler Syntax