beautypg.com

8 table, Table – Avago Technologies LSI53C1010 User Manual

Page 132

background image

4-12

Using the LSI Logic Assembler NASM™

4.6.8 TABLE

TABLE describes a data structure used with the table indirect addressing
feature of the SCRIPTS processor. The starting location for the buffer is
defined by the data structure address written to the DSA register. The
expression specifies the offset into the buffer and is added to the starting
address of the buffer (DSA register) to form the absolute address. This
feature allows SCRIPTS to be programmed into a ROM.

Example

This example shows the typical use of the RELATIVE keyword.
NASM syntax requires that no SCRIPTS statements span
more than one line. However, in the case of RELATIVE, this
would result in a very unreadable source code file. The
following example demonstrates the use of the logical line
continuation character ‘\’. When this character is used, the
assembler appends the next line to the end of the current line.

RELATIVE data_buffer\
identify_msg_buf = 1{??}, \
synch_msgo_buf = {1,2,3,4,5},\
synch_msgi_buf = 5{??},\
cmd_buf = 12{??},\
W_cmd_buf = 12{??},\
stat_buf = 1{??},\
msg_in_buf = 1{??},\
disc_msg_in_buf = 2{??},\
read_cap_buf = {1,2,3,4,\
5,6,7,8},\
inquiry_buf = 36{??},\
request_sense_buf = 18{??},\
data_buf = 16384{??}

Description

The RELATIVE keyword defines a template for a collection of
data elements of the same or varying types, each of which can
be accessed by a descriptive name, but no storage is
allocated. It is up to the programmer to use the RELATIVE
information that is placed in the output file to declare space in
the driver program that RELATIVE maps to.

Notes

The first form of the RELATIVE syntax example is only
provided for compatibility with older versions of the SCRIPTS
compiler. The second form (with baselabel definition) should
be used for all new programs.
Since the SCRIPTS array will have only offsets from the base
address of the buffer, the SCRIPTS elements containing
references to relative buffers will need to be patched by the
driver program after the buffer space is allocated.

This manual is related to the following products: