Intel i86W Manual page 80

Table of Contents

Advertisement

CORE INSTRUCTIONS
Programming Notes
The
bla
instruction is useful for implementing loop counters, where isrc2 is the loop
counter and isrcl is set to -1. In such a loop implementation, a
bla
instruction may be
performed before the loop is entered to initialize the
Lee
bit of the
psr.
The target of
this
bla
should be the sequential instruction after the next, so that the next sequential
instruction is executed regardless of the setting of
Lee.
Another
bla
instruction placed
as the next to last instruction of the loop can test for loop completion and update the
loop counter. The total number of iterations is the value of isrc2 before the first
bla
. instruction, plus one. Example 5-1 illustrates this use of
bla.
Programmers should avoid calling subroutines from within a
bla
loop, because a subrou-
tine may also use
bla
and change the value of
Lee.
For the
bla
instruction, the register coded as isrcl must not be the same register as isrc2.
II EXAMPLE OF bla USAGE
II Write zeros to an array of 16 single-precision numbers
II Starting address of array is already in r4
adds
or
bla
addu
CLEAR_LOOP:
-1,
15,
r5,
-4,
bla
r5,
fst.l
f0,
r0,
r0,
r6,
r4,
r5
II r5
<--
loop increment
r6
II r6
<--
loop count
CLEAR_LOOP
II One time to initialize LCC
r4
II Start one lower to
II. allow for autoincrement
r6,
CLEAR_LOOP
II Loop for the 16 times
4(r4)++
II Write and auto increment
II
to next word
Example 5-1. Example of bla Usage
5-18

Advertisement

Table of Contents
loading

Table of Contents