beautypg.com

1 block move instructions, Block move instructions – Avago Technologies LSI53C1010 User Manual

Page 194

background image

8-8

Writing Device Drivers with SCRIPTS

Prior to the start of an I/O, load the DSA register with the base address
of the table indirect data structure. The address must be on a Dword
boundary. Adding the DSA to the 24-bit signed offset value from the
opcode at the start of a table indirect instruction generates the address
of the table entry. Both positive and negative offsets are allowed. With
table indirect addressing, it is not necessary to initialize the SCSI ID, byte
counts, clock dividers, synchronous parameters, or data buffers within
the SCRIPTS instruction. Instead, only the table in memory needs to be
updated.

To use table indirect addressing, you must set up tables in memory
similar to the one shown in

Figure 8.5

. These tables contain device IDs,

synchronous period information, byte counts, and data addresses. The
data in the table entry is fetched into the appropriate instruction,
depending on whether it is a Block Move or a Select/Reselect.

8.6.1 Block Move Instructions

When you select the table indirect mode by using the FROM operator in
a SCRIPTS Block Move instruction, the 32-bit start address is treated as
a 24-bit signed value. After the instruction is moved into the chip, the
24 bits are added to the DSA register to form a 32-bit physical address.
The byte count (24 bits of count plus 8 bits of high-order zeros) and the
data buffer address (32 bits) are fetched from this new address.

There are several programming implications of table indirect addressing.
First, a standard SCSI data structure can be designed with values at
predefined offsets. The Block Move instruction does not require the
actual 32-bit address or 24-bit count to be within the instruction itself. At
the start of an I/O and after the actual data structure is built, no further
firmware intervention is required except loading the data table base
address into the DSA register. Second, the SCRIPTS instructions may
be placed in a PROM because no dynamic alteration is required at the
start of an I/O. Finally, only one copy of the main SCSI SCRIPTS
program is needed for all I/O operations, with a fast context switch used
to change to another I/O. Only the data structure is unique to each I/O,
and the SCRIPTS instructions are reusable, as shown in

Table 8.1

.

This manual is related to the following products: