Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 用户手册
产品代码
SW006021-1
MPLAB
®
XC8 C COMPILER
USER’S GUIDE
2012 Microchip Technology Inc.
DS52053B-page 241
Chapter 6. Macro Assembler
6.1
INTRODUCTION
Two macro assemblers are included with the MPLAB XC8 C Compiler to assemble
source files for all 8-bit PIC devices. The operation and assembler directives are almost
identical for both assemblers. The appropriate assembler application is invoked when
you use the compiler driver to build projects.
source files for all 8-bit PIC devices. The operation and assembler directives are almost
identical for both assemblers. The appropriate assembler application is invoked when
you use the compiler driver to build projects.
This chapter describes the usage of the assembler and the directives (assembler
pseudo-ops and controls) accepted by the assembler in the source files.
pseudo-ops and controls) accepted by the assembler in the source files.
Although the term “assembler” is almost universally used to describe the tool which
converts human-readable mnemonics into machine code, both “assembler” and
“assembly” are used to describe the source code which such a tool reads. The latter is
more common and is used in this manual to describe the language. Thus you will see
the terms assembly language (or just assembly), assembly listing and etc, but
assembler options, assembler directive and assembler optimizer.
converts human-readable mnemonics into machine code, both “assembler” and
“assembly” are used to describe the source code which such a tool reads. The latter is
more common and is used in this manual to describe the language. Thus you will see
the terms assembly language (or just assembly), assembly listing and etc, but
assembler options, assembler directive and assembler optimizer.
The following topics are examined in this chapter of the user’s guide:
• Options
6.2
ASSEMBLER USAGE
The assembler is called ASPIC18 for PIC18 devices, and ASPIC for all other 8-bit
devices. It is available to run on Windows, Linux and Mac OS X systems. Note that the
assembler will not produce any messages unless there are errors or warnings – there
are no “assembly completed” messages.
devices. It is available to run on Windows, Linux and Mac OS X systems. Note that the
assembler will not produce any messages unless there are errors or warnings – there
are no “assembly completed” messages.
Typically the command-line driver, xc8, is used to invoke the assembler as it can be
passed assembler source files as input; however, the options for the assembler are
supplied here for instances where the assembler is being called directly, or when they
are specified using the command-line driver option --SETOPTION, see
Section 4.8.53 “--SETOPTION: Set the Command-line Options For Application”.
passed assembler source files as input; however, the options for the assembler are
supplied here for instances where the assembler is being called directly, or when they
are specified using the command-line driver option --SETOPTION, see
Section 4.8.53 “--SETOPTION: Set the Command-line Options For Application”.
The usage of the assembler is similar under all of available operating systems. All com-
mand-line options are recognized in either upper or lower case. The basic command
format is shown:
mand-line options are recognized in either upper or lower case. The basic command
format is shown:
ASPIC[18] [ options ] files
files
is a space-separated list of one or more assembler source files. Where more
than one source file is specified, the assembler treats them as a single module; i.e., a
single assembly will be performed on the concatenation of all the source files specified.
The files must be specified in full, no default extensions or suffixes are assumed.
single assembly will be performed on the concatenation of all the source files specified.
The files must be specified in full, no default extensions or suffixes are assumed.
options
is an optional space-separated list of assembler options, each with a dash –
as the first character in the case of single letter options, or double dashes in the case
of multi-letter options. The assembler options must be specified on the command line
before any files.
of multi-letter options. The assembler options must be specified on the command line
before any files.