06.02.2013 Views

C166/ST10 Cross-Assembler, Linker/Locator, Utilities ... - Tasking

C166/ST10 Cross-Assembler, Linker/Locator, Utilities ... - Tasking

C166/ST10 Cross-Assembler, Linker/Locator, Utilities ... - Tasking

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• • • • • • • •<br />

Software Concept 1−41<br />

− a name followed by a ’:’ (e.g. LAB1: )<br />

− a LABEL directive<br />

− a PROC directive<br />

Like a variable, a label has three attributes, two are the same as those of a<br />

variable:<br />

Section: Same as variable.<br />

Offset: Same as variable.<br />

Type: Specifies the type of JuMP or CALL that must be made to that<br />

location. There are two types:<br />

NEAR: This type represents a label that is accessed by a<br />

JuMP or CALL that lies within the same physical<br />

segment. In this case, only the offset of the label<br />

is used in the JuMP or CALL instruction.<br />

FAR: This type represents a label that is accessed<br />

from a different segment. A far label is<br />

represented in the JuMP or CALL instruction by<br />

its offset and its segment number.<br />

A special form of defining a label is the PROC directive. This form<br />

specifies a sequence of code that is CALLed just as a subroutine in a<br />

high−level language. The PROC directive defines a label with the type,<br />

either NEAR or FAR. It also defines a context for the RET instruction so<br />

that the assembler can determine the type of RET to code (either RET or a<br />

RETS).<br />

When you define a variable or label, the assembler stores its definition,<br />

which includes the above attributes.<br />

1.10.2.1 DEFINING CODE LABELS<br />

’Code’ labels can be defined by:<br />

or<br />

label:<br />

label: {NEAR|FAR}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!