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 />

Operands and Expressions 5−11<br />

5.2 EXPRESSIONS<br />

An operand of an assembler instruction or directive is either an assembler<br />

symbol or an expression. The assembler symbols for the <strong>C166</strong>/<strong>ST10</strong> are:<br />

SFR names (Bit and Non−Bit Addressable), System bit names and<br />

Peripheral bit names. An expression denotes an address in a particular<br />

memory space or a number. Expressions that can be evaluated at assembly<br />

time are called absolute expressions. Expressions where the result can<br />

not be known until logical sections have been combined and located are<br />

called relocatable expressions.<br />

There are some rules and restrictions when an expression is relocatable:<br />

Sections and Groups<br />

The name of a section or group can be used to represent its page or<br />

segment number in an expression. This value is relocatable for all sections<br />

and groups except for a section defined with the ’AT expression’ form for<br />

the SECTION directive. These values are assigned by the locator. This type<br />

of relocatability is called ’base relocatability’. See the paragraph Sections<br />

in the chapter Assembly Language for more information on sections and<br />

groups.<br />

Example:<br />

DATAGRP DGROUP DATA1, DATA2<br />

DATA1 SECTION DATA<br />

.<br />

.<br />

DATA1 ENDS<br />

DATA2 SECTION DATA PUBLIC<br />

SEGSTORE DW DATAGRP ; DATAGRP is base relocatable<br />

SEGBASE DW DATA1 ; DATA1 is base relocatable<br />

DATA2 ENDS<br />

Variables and Labels<br />

The offset of any variable or label is relocatable, i.e. variables are ’offset<br />

relocatable’. These values are also assigned by the locator.

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

Saved successfully!

Ooh no, something went wrong!