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

Assembly Language 4−3<br />

4.1 INPUT SPECIFICATION<br />

An assembly program consists of zero or one statement per line. A<br />

statement may optionally be followed by a comment, which is introduced<br />

by a semicolon character (;) and terminated by the end of the input line.<br />

Lines starting with a dollar character ($) in the first column are control<br />

lines. They are interpreted independently from the rest of the input. The<br />

syntax of these lines is described separately in the chapter <strong>Assembler</strong><br />

Controls.<br />

A line with a # character in the first position is a line generated by a macro<br />

preprocessor to inform the assembler of the original source file name and<br />

line number. The format of the remaining lines is given below. A statement<br />

can be defined as:<br />

[label[:]] [instruction | directive] [;comment]<br />

label is an identifier. The occurrence of label: defines the symbol<br />

denoted by label and assigns the current value of the location<br />

counter to it. The colon ’:’ is only required for CODE labels.<br />

identifier has to be made up of letters, digits, underscore<br />

characters (_) and/or question marks (?). The first character<br />

cannot be a digit.<br />

Example:<br />

LAB1: ;This is a label<br />

instruction is any valid <strong>C166</strong>/<strong>ST10</strong> assembly language instruction<br />

consisting of a mnemonic and one, two, three or no<br />

operands. Operands are described in the chapter Operands<br />

and Expressions. The instructions are described in the<br />

hardware manuals.<br />

Examples:<br />

EINIT ; No operand<br />

BSET ABIT ; One operand<br />

AND R0, #0H ; Two operands<br />

BFLDL 0FF0CH, #4, #6 ; Three operands<br />

directive any one of the assembler directives; described separately in<br />

the chapter <strong>Assembler</strong> Directives.<br />

A statement may be empty.

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

Saved successfully!

Ooh no, something went wrong!