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 (https://www.microchip.com) 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. 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 Customers.......................................................................................................................................1 1. Preface....................................................................................................................................................4 1.1. Conventions Used in This Guide..................................................................................................4 1.2. Recommended Reading...............................................................................................................5 1.3. Document Revision History..........................................................................................................5 2. Assembler Overview............................................................................................................................... 6 2.1. Device Description....................................................................................................................... 6 2.2. Compatible Development Tools....................................................................................................6 3. Assembler Driver.....................................................................................................................................7 3.1. Single-step Assembly...................................................................................................................7 3.2. Multi-step Assembly..................................................................................................................... 7 3.3. Assembler Option Descriptions....................................................................................................8 4. MPLAB XC8 Assembly Language........................................................................................................ 19 4.1. Assembly Instruction Deviations................................................................................................ 19 4.2. Statement Formats.....................................................................................................................22 4.3. Characters..................................................................................................................................23 4.4. Comments..................................................................................................................................23 4.5. Constants................................................................................................................................... 23 4.6. Identifiers....................................................................................................................................24 4.7. Expressions................................................................................................................................25 4.8. Program Sections.......................................................................................................................26 4.9. Assembler Directives..................................................................................................................27 5. Assembler Features.............................................................................................................................. 45 5.1. Preprocessor Directives............................................................................................................. 45 5.2. Assembler-provided Psects........................................................................................................46 5.3. Default Linker Classes............................................................................................................... 46 5.4. Linker-Defined Symbols............................................................................................................. 48 5.5. Assembly List Files.....................................................................................................................48 6. Linker.................................................................................................................................................... 50 6.1. Operation....................................................................................................................................50 6.2. Psects and Relocation................................................................................................................56 6.3. Map Files....................................................................................................................................56 7. Utilities...................................................................................................................................................61 7.1. Archiver/Librarian....................................................................................................................... 61 7.2. Hexmate.....................................................................................................................................62 The Microchip Website.................................................................................................................................76 Product Change Notification Service............................................................................................................76 Customer Support........................................................................................................................................ 76 © 2020 Microchip Technology Inc. User Guide DS50002974A-page 2 Microchip Devices Code Protection Feature................................................................................................76 Legal Notice................................................................................................................................................. 76 Trademarks.................................................................................................................................................. 77 Quality Management System....................................................................................................................... 77 Worldwide Sales and Service.......................................................................................................................78 © 2020 Microchip Technology Inc. User Guide DS50002974A-page 3 Preface 1. Preface 1.1 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 ...is the only compiler... 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 Filenames autoexec.bat 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 file.o, 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 Ellipses... Replaces repeated text var_name [, var_name...] Represents code supplied by user void main (void) { ... } © 2020 Microchip Technology Inc. User Guide DS50002974A-page 4 Preface 1.2 Recommended Reading This user’s guide describes the use and features of the MPLAB XC8 PIC Assembler. 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. MPLAB® XC8 C Compiler Release Notes for PIC MCU For the latest information
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages78 Page
-
File Size-