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
143 / 153
One instruction per source file line or per include line is allowed. Below is an example:
stf low b0;
4.2 Inserting a comment field
The source code file supports the addition of comments. The comment fields are
identified with:
•
Two '*' characters, one placed before and the other after the comment text
•
One '*' symbol placed before comment text. In this case, all characters up to the end of
the line are considered as part of the comment.
The comment field syntax is as follows:
*
Comment
*
*
Comment
Below are some examples:
*Put the channel in error state* SWInterruptRoutine: stflowErrorFlag;
SWInterruptRoutine: stflowErrorFlag; *Put the channel in error state
4.3 Defining a constant
The software designer can use a constant value label, instead of using a number as an
instruction parameter (define). This constant definition helps to make the source code
more readable. The define function is used for a constant value definition that is used
locally in the source code. The constant definitions must terminate in the character ';'.
The define syntax is as follows:
#define
SymbolName SymbolValue
;
The constant definitions are placed:
•
At the beginning of the line
•
Or after the final comment field character '*'
The constant definition must be placed in an instruction line. No other item, such as an
instruction, label or include statement, is allowed in a constant definition line. All define
statements must be unique, that is not already used as the
SymbolName
of a line label,
and cannot have the same name as an instruction or a parameter. The define name
(
SymbolName
) cannot start with a number but can contain one or several numbers. It
must not include spaces. The Define arguments
SymbolName
and
SymbolValue
are
mandatory. See the example below:
#define ErrorFlag 10;
4.4 Including a data RAM address definition file
The assembler has the ability to manage a nested file structure. The sub files called in
the main source file are known as definition files. These definition files are commonly
used for variable definition dedicated to device Data RAM. However, any instruction or
label can be used in definition files.
All the include statements must terminate with the character ';'. A valid file name must be
placed between two apostrophe characters ('
text
').