NXP Semiconductors
PT2001SWUG
PT2001 programming guide and instruction set
PT2001SWUG
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2019. All rights reserved.
User guide
Rev. 3.0 — 29 April 2019
144 / 153
The include declaration must be placed:
•
At the beginning of the line
•
Or after the end comment character '*' The include syntax is as follows:
#include '
Filename
.def';
Use of nested
include
is not permitted.
Note that *.def or any other extension can be used as a definition file extension, with the
exception of assembler's input file extensions (*.dfi, *.link, *.xml) or output file extensions.
(*.cip, *.hex, *.bin, *.asm, *.log, *.reg, *.cip.bin, *.cip.hex).
See the example below:
#include '
Source1.def
'; *include variable to the source.dfi defined in the definition file
4.5 Using a line label
The assembler can manage line labels. This kind of label is used to replace a line
number called as an instruction parameter. The assembler immediately replaces the
label with the corresponding line number at the time of the source code assembly.
The label syntax is as follows:
LabelName
:
The label refers to a line code where the label is set. For example, if the label
Init
is
located on line 7 any instruction using this label refers to line 7.
Labels must be placed at the beginning of the line or after the final character of a
comment field. These labels end with the symbol ':' . All labels must be followed by an
instruction. They must be unique, must not already have been used as a
SymbolName
in a Define statement, and cannot be an instruction or parameter name. The
LabelName
can contain numbers, but cannot start with a number and must not include spaces. An
example follows:
SWInterruptRoutine:
4.6 Numbering convention
A parameter can either be a parameter name associated with a value defined in the
syntax file or it can be a numeric value. When a numeric value is used, the parameter is
decimal. Three formats are possible:
•
By default, the value is decimal (no suffix)
•
A 'h' specifies that the value is hexadecimal
•
A 'b' suffix specifies that the value is binary An example follows:
ldirl 10 _rst; *number 10
ldirl 10h _rst; *number 16
ldirl 10b _rst; *number 2
4.7 Conditional assembly
The assembler includes a basic
IF
function (conditional assembly). This function is
'static' so the
IF
function branch is considered at the time of assembly. The
IF
function
syntax is as follows: