Flags; Instructions; Examples; Table 10-4. Alf Flags - Lucent Technologies DSP1617 Information Manual

Digital signal processor
Table of Contents

Advertisement

DSP1611/17/18/27/28/29 DIGITAL SIGNAL PROCESSOR
Bit I/O Unit
10.2 Software View

10.2.2 Flags

Those bits that have been configured as inputs can be individually tested for 1 or 0 (compared with PATTERN). For
those inputs that are being tested, there are four flags produced: allt (all true, all the tested bits match PATTERN),
allf (all false, none of the tested bits match the PATTERN), somet (some true, at least one of the tested bits
matches the PATTERN), and somef (some false, at least one of the tested bits fails to match the PATTERN). The
flags are updated each time the cbit register is written and can be tested by the conditional branch or special func-
tion instructions. The state of these flags can be saved and restored by reading and writing bits 0 to 3 of the alf
register.

Table 10-4. alf Flags

Bit
Flag
3
somef
2
somet
1
allf
0
allt

10.2.3 Instructions

The data move group of instructions is used to read and write the sbit and cbit registers. These registers can be
written from memory, from an accumulator, or with immediate data. They can be read to memory or to an accumu-
lator.
The flags that are set by the BIO are included in the general set of flags that are tested by the conditional branch
and special function instruction.

10.2.4 Examples

The following sections of code show how the BIO can be used. The first section uses the BIO as all outputs:
sbit=0xff00
cbit=0x0000
cbit=0x00ab
cbit=0xff0f
cbit=0x0f0f
The following code segment uses the BIO as all inputs:
sbit=0
a0=sbit
a0=a0h&0x00ff
cbit=0xffab
if allt goto pass /* if (BIO==0xab) branch to label pass
cbit=0x0302
if somet a0h=a0h+1/* if either bit matches, increment a0
10-6
(continued)
Use
SOME FALSE from BIO
SOME TRUE from BIO
ALL FALSE from BIO
ALL TRUE from BIO
/* set all direction bits to 1 (output)
/* initialize BIO[7—0] to all 0s (data mode write)
/* write 0xab out to BIO[7—0] (data mode write)
/* toggle bits 3—0 of BIO; leave bits 7—4 unchanged
/* write 0 to bits 7—4 in data mode; toggle bits 3—0
/* set all direction bits to 0 (input)
/* read current value in sbit register
/* mask off direction byte (if necessary)
/* a0 now holds the current value on BIO pins
/* test the entire BIO byte for 0xab
/* test the bottom 2 bits for 0x2
DRAFT COPY
Information Manual
April 1998
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
Lucent Technologies Inc.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dsp1629Dsp1618Dsp1611Dsp1627Dsp1628

Table of Contents