Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
46
Добавлен:
27.04.2015
Размер:
4.26 Mб
Скачать

Software Techniques

Table 8-1. Operations Synthesized Using DSP56800 Instructions (Continued)

Operation

Description

 

 

 

 

JVS, JVC, BVS, BVC

Jumps or branches if the overflow bit is set or clear

 

 

JPL, JMI, JES, JEC, JLMS, JLMC,

Jumps or branches on other condition codes

BPL, BMI, BES, BEC, BLMS, BLMC

 

 

 

NEGW

Negates of upper two registers of an accumulator

 

 

NEG

Negates another data ALU register, an AGU register, or a memory location

 

 

XCHG

Exchanges any two registers

 

 

MAX

Returns the maximum of two registers

 

 

MIN

Returns the minimum of two registers

 

 

Accumulator sign extend

Sign extends the accumulator into the A2 or B2 portion

 

 

Accumulator unsigned load

Zeros the accumulator LSP and extension register

 

 

8.1.1 Jumps and Branches

Several operations for jumping and branching can be emulated, depending on selected bits in a bit field, overflows, or other condition codes.

8.1.1.1 JRSET and JRCLR Operations

The JRSET and JRCLR operations are very similar to the BRSET and BRCLR instructions. They still test a bit field and go to another address if all masked bits are either set or cleared. The BRSET and BRCLR instructions only allow branches of 64 locations away from the current instruction and can only test an 8-bit field; however, JRSET and JRCLR operations allow jumps to anywhere in the 64K-word program address space, and can specify a 16-bit mask. The following code shows that these two operations allow the same addressing modes as the BFTSTH and BFTSTL instructions.

Example 8-1. JRSET and JRCLR

;JRSET Operation

;Emulated in 5 Icyc (4 Icyc if false), 4 Instruction Words

BFTSTH

#xxxx,X:<ea>

;

16-bit

mask

allowed

JCS

label

;

16-bit

jump

address allowed

;JRCLR Operation

;Emulated in 5 Icyc (4 Icyc if false), 4 Instruction Words

BFTSTL

#xxxx,X:<ea>

;

16-bit

mask

allowed

JCS

label

;

16-bit

jump

address allowed

 

 

 

 

 

 

8-2

DSP56800 Family Manual

 

Useful Instruction Operations

8.1.1.2 BR1SET and BR1CLR Operations

The BR1SET and BR1CLR operations are very similar to the BRSET and BRCLR instructions. They still test a bit field and branch to another address based on the result of some test. The difference is that for BRSET and BRCLR the condition is true if all selected bits in the bit field are 1s or 0s, respectively, whereas for BR1SET and BR1CLR the condition is true if at least one of the selected bits in the bit field is a 1 or 0, respectively. BR1SET and BR1CLR operations can also specify a 16-bit mask, compared to an 8-bit mask for BRSET and BRCLR. The following code shows that these two operations allow the same addressing modes as the BFTSTH and BFTSTL instructions.

Example 8-2. BR1SET and BR1CLR

;BR1SET Operation

;Emulated in 5 Icyc (4 Icyc if false), 3 Instruction Words

BFTSTL

#xxxx,X:<ea>

;

16-bit mask allowed

BCC

label

;

7-bit signed PC relative offset allowed

;BR1CLR Operation

;Emulated in 5 Icyc (4 Icyc if false), 3 Instruction Words

BFTSTH

#xxxx,X:<ea>

;

16-bit mask allowed

BCC

label

;

7-bit signed PC relative offset allowed

 

 

 

 

8.1.1.3 JR1SET and JR1CLR Operations

The JR1SET and JR1CLR operations are very similar to the JRSET and JRCLR instructions. They still test a bit field and jump to another address based on the result of some test. The difference is that for JRSET and JRCLR the condition is true if all selected bits in the bit field are 1s or 0s, respectively, whereas for JR1SET and JR1CLR the condition is true if at least one of the selected bits in the bit field is a 1 or 0, respectively. JR1SET and JR1CLR operations allow jumps to anywhere in the 64K-word program address space, and can specify a 16-bit mask. The following code shows that these two operations allow the same addressing modes as the BFTSTH and BFTSTL instructions.

Example 8-3. JR1SET and JR1CLR

;JR1SET Operation

;Emulated in 5 Icyc (4 Icyc if false), 4 Instruction Words

BFTSTL

#xxxx,X:<ea>

;

16-bit

mask

allowed

JCC

label

;

16-bit

jump

address allowed

;JR1CLR Operation

;Emulated in 5 Icyc (4 Icyc if false), 4 Instruction Words

BFTSTH

#xxxx,X:<ea>

;

16-bit

mask

allowed

JCC

label

;

16-bit

jump

address allowed

 

 

 

 

 

 

 

Software Techniques

8-3

Соседние файлы в папке DSP568xx