Transcription of MPLAB XC8 PIC Assembler User's Guide
1 MPLAB XC8 PIC Assembler User's Guide Notice to Customers All documentation becomes dated and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions can differ from those in this document. Please refer to our web site ( ) to obtain the latest documentation available. Documents are identified with a DS number. This number is located on the bottom of each page, in front of the page number. The numbering convention for the DS number is DSXXXXXA, where XXXXX is the document number and A is the revision level of the document.
2 For the most up-to-date information on development tools, see the MPLAB IDE online help. Select the Help menu, and then Topics to open a list of available online help files. 2020 Microchip Technology Inc. User Guide DS50002974A-page 1. Table of Contents Notice to 1. Conventions Used in This Recommended Document Revision 5. 2. Assembler 6. Device 6. Compatible Development 3. Assembler Single-step Multi-step 7. Assembler Option 8. 4. MPLAB XC8 Assembly 19. Assembly Instruction 19. Statement 23. 23. Program Assembler 5. Assembler 45. Preprocessor 45. Assembler -provided Default Linker 46.
3 Linker-Defined 48. Assembly List 6. 50. Psects and Map 7. 61. 62. The Microchip Product Change Notification Customer 76. 2020 Microchip Technology Inc. User Guide DS50002974A-page 2. Microchip Devices Code Protection 76. Legal 76. 77. Quality Management 77. Worldwide Sales and 2020 Microchip Technology Inc. User Guide DS50002974A-page 3. Preface 1. Preface Conventions Used in This Guide The following conventions may appear in this documentation: Table 1-1. Documentation Conventions Description Represents Examples Arial font: . Italic characters Referenced books MPLAB IDE User's Guide Emphasized text.
4 Is the only Initial caps A window the Output window A dialog the Settings dialog A menu selection select Enable Programmer Quotes A field name in a window or dialog Save project before build . Underlined, italic text with right A menu path File>Save angle bracket Bold characters A dialog button Click OK. A tab Click the Power tab N Rnnnn A number in verilog format, where 4 b0010, 2 hF1. N is the total number of digits, R is the radix and n is a digit. Text in angle brackets < > A key on the keyboard Press <Enter>, <F1>. Courier New font: Plain Courier New Sample source code #define START.
5 Filenames File paths c:\mcc18\h Keywords _asm, _endasm, static Command-line options -Opa+, -Opa- Bit values 0, 1. Constants 0xFF, A'. Italic Courier New A variable argument , where file can be any valid filename Square brackets [ ] Optional arguments mcc18 [options] file [options]. Curly brackets and pipe Choice of mutually exclusive errorlevel {0|1}. character: { | } arguments; an OR selection Replaces repeated text var_name [, ]. Represents code supplied by user void main (void). { .. }. 2020 Microchip Technology Inc. User Guide DS50002974A-page 4. Preface Recommended Reading This User's Guide describes the use and features of the MPLAB XC8 PIC Assembler .
6 The following Microchip documents are available and recommended as supplemental reference resources. MPLAB XC8 PIC Assembler Migration Guide This Guide is for customers who have MPASM projects and who wish to migrate them to the MPLAB XC8 PIC. Assembler . It describes the nearest equivalent Assembler syntax and directives for MPASM code. MPLAB XC8 PIC Assembler Guide For Embedded Engineers This Guide is a getting started Guide , describing example projects and commonly used coding sequences used by the MPLAB XC8 PIC Assembler . Use this Guide if you need to develop new projects using the Assembler .
7 MPLAB XC8 C Compiler Release Notes for PIC MCU. For the latest information on changes and bug fixes to this Assembler , read the Readme file in the docs subdirectory of the MPLAB XC8 installation directory. Development Tools Release Notes For the latest information on using other development tools, read the tool-specific Readme files in the docs subdirectory of the MPLAB X IDE installation directory. Document Revision History Revision A (March 2020). Initial release of this document, based on the Assembler chapter from the MPLAB XC8 C Compiler User's Guide (DS50002737).
8 2020 Microchip Technology Inc. User Guide DS50002974A-page 5. Assembler Overview 2. Assembler Overview The MPLAB XC8 PIC Assembler is a free-standing cross Assembler and linker package, supporting all 8-bit PIC . microcontrollers. Device Description This Guide describes the MPLAB XC8 PIC Assembler 's support for all 8-bit Microchip PIC devices with baseline, mid- range, enhanced mid-range and PIC18 cores. The following descriptions indicate the distinctions within those device cores: The baseline core uses a 12-bit-wide instruction set and is available in PIC10, PIC12 and PIC16 part numbers.
9 The enhanced baseline core also uses a 12-bit instruction set, but this set includes additional instructions. some of the enhanced baseline chips support interrupts and the additional instructions used by interrupts. These devices are available in PIC12 and PIC16 part numbers. The mid-range core uses a 14-bit-wide instruction set that includes more instructions than the baseline core. It has larger data memory banks and program memory pages, as well. It is available in PIC12, PIC14 and PIC16 part numbers. The Enhanced mid-range core also uses a 14-bit-wide instruction set but incorporates additional instructions and features.
10 There are both PIC12 and PIC16 part numbers that are based on the Enhanced mid-range core. The PIC18 core instruction set is 16 bits wide and features additional instructions and an expanded register set. PIC18 core devices have part numbers that begin with PIC18. See Print-devices for information on finding the full list of devices that are supported by the Assembler . Compatible Development Tools The Assembler works with many other Microchip tools, including: The MPLAB X IDE ( ). The MPLAB X Simulator The Command-line MDB Simulator see the Microchip Debugger (MDB) User's Guide (DS52102).