3.1 Comments
There are several styles of comments that can be used in assembly source code.
Assembler comments consist of a semi-colon,
;
, followed by the comment
text. These can be placed on a line of their own, such as the
comment:;objects in common (Access bank) memory
They can also be
at the end of a line containing an instruction or directive, as shown in the
line: movff PORTA,tmp ;read the port
C-style comments can be used in assembly source code if the assembly source
file is preprocessed. To run the preprocessor over an assembly source file, name the
file using a .S
extension (upper case), or use the
-xassembler-with-cpp
option when you build.
Single-line C-style comments begin with a double slash sequence,
//
,
followed by the comment text, as seen in the
line:CONFIG PWRTS=PWRT_OFF // PWRT is disabled
Multi-line C-style comments begin with slash-star,
/*
, and
terminate with a star-slash sequence, */
. This is the only comment
style that allow the comment text to run over multiple lines. One is shown in the
example:/* find the highest PORTA value read, storing this into
the object max */