beautypg.com

4 entry, 5 label patches, Entry – Avago Technologies LSI53C1010 User Manual

Page 147: Label patches

background image

NASM Output File Examples

5-9

};
#define R_rel_buf2 0x00000001L
ULONG R_rel_buf2_Used[] = {

0x00000007L

};

5.2.4 Entry

The ENTRY section contains the entry records, if any were declared. An
entry record is a

#define

of the entry name prefixed with

Ent_,

defined

to be a byte offset into the SCRIPTS array.

Example:

Using

-o

or

-p

assembler option:

#define Ent_Send_CMD

0x00000018L

#define Ent_Send_DATA

0x00000020L

#define Ent_Start

0x00000000L

The labels defined as entries are the only ones available to the driver
code. The “C” code examples in

Figure 5.1

are examples of how the

driver uses this information to start SCRIPTS routines at any location
defined as an entry. The ENTRY section is not affected by NASM
command line options.

5.2.5 Label Patches

The Label Patches section contains the label patch records. A label
patch record is an array of locations that are referred to by an absolute
Transfer Control instruction. These locations are the Dword offsets into
the SCRIPTS array. The offsets patch in the physical addresses at run
time. Please see the section on patching SCRIPTS in

Chapter 7,

“Integrating SCRIPTS Programs into “C” Language Drivers,”

for more

information on how to patch absolute jump instructions. The Label
Patches section is not affected by NASM command line options.

Example:

Using

-o

or

-p

assembler option:

ULONG LABELPATCHES[] = {

0x00000019L

};

This manual is related to the following products: