MPLAB XC32 ASSEMBLER, LINKER AND UTILITIES User’s

2y ago
19 Views
4 Downloads
2.22 MB
234 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Gideon Hoey
Transcription

MPLAB XC32 ASSEMBLER,LINKER AND UTILITIESUser’s Guide 2013 Microchip Technology Inc.DS50002186A

Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular Microchip Data Sheet. Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in theintended manner and under normal conditions. There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to ourknowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s DataSheets. Most likely, the person doing so is engaged in theft of intellectual property. Microchip is willing to work with the customer who is concerned about the integrity of their code. Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does notmean that we are guaranteeing the product as “unbreakable.”Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of ourproducts. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such actsallow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.Information contained in this publication regarding deviceapplications and the like is provided only for your convenienceand may be superseded by updates. It is your responsibility toensure that your application meets with your specifications.MICROCHIP MAKES NO REPRESENTATIONS ORWARRANTIES OF ANY KIND WHETHER EXPRESS ORIMPLIED, WRITTEN OR ORAL, STATUTORY OROTHERWISE, RELATED TO THE INFORMATION,INCLUDING BUT NOT LIMITED TO ITS CONDITION,QUALITY, PERFORMANCE, MERCHANTABILITY ORFITNESS FOR PURPOSE. Microchip disclaims all liabilityarising from this information and its use. Use of Microchipdevices in life support and/or safety applications is entirely atthe buyer’s risk, and the buyer agrees to defend, indemnify andhold harmless Microchip from any and all damages, claims,suits, or expenses resulting from such use. No licenses areconveyed, implicitly or otherwise, under any Microchipintellectual property rights.TrademarksThe Microchip name and logo, the Microchip logo, dsPIC,FlashFlex, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro,PICSTART, PIC32 logo, rfPIC, SST, SST Logo, SuperFlashand UNI/O are registered trademarks of Microchip TechnologyIncorporated in the U.S.A. and other countries.FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,MTP, SEEVAL and The Embedded Control SolutionsCompany are registered trademarks of Microchip TechnologyIncorporated in the U.S.A.Silicon Storage Technology is a registered trademark ofMicrochip Technology Inc. in other countries.Analog-for-the-Digital Age, Application Maestro, BodyCom,chipKIT, chipKIT logo, CodeGuard, dsPICDEM,dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,ECONOMONITOR, FanSense, HI-TIDE, In-Circuit SerialProgramming, ICSP, Mindi, MiWi, MPASM, MPF, MPLABCertified logo, MPLIB, MPLINK, mTouch, Omniscient CodeGeneration, PICC, PICC-18, PICDEM, PICDEM.net, PICkit,PICtail, REAL ICE, rfLAB, Select Mode, SQI, Serial Quad I/O,Total Endurance, TSHARC, UniWinDriver, WiperLock, ZENAand Z-Scale are trademarks of Microchip TechnologyIncorporated in the U.S.A. and other countries.SQTP is a service mark of Microchip Technology Incorporatedin the U.S.A.GestIC and ULPP are registered trademarks of MicrochipTechnology Germany II GmbH & Co. KG, a subsidiary ofMicrochip Technology Inc., in other countries.All other trademarks mentioned herein are property of theirrespective companies. 2013, Microchip Technology Incorporated, Printed in theU.S.A., All Rights Reserved.Printed on recycled paper.ISBN: 978-1-62077-521-9QUALITY MANAGEMENT SYSTEMCERTIFIED BY DNV ISO/TS 16949 2013 Microchip Technology Inc.Microchip received ISO/TS-16949:2009 certification for its worldwideheadquarters, design and wafer fabrication facilities in Chandler andTempe, Arizona; Gresham, Oregon and design centers in Californiaand India. The Company’s quality system processes and proceduresare for its PIC MCUs and dsPIC DSCs, KEELOQ code hoppingdevices, Serial EEPROMs, microperipherals, nonvolatile memory andanalog products. In addition, Microchip’s quality system for the designand manufacture of development systems is ISO 9001:2000 certified.DS50002186A-page 2

MPLAB XC32 ASSEMBLER,LINKER AND UTILITIESUSER’S GUIDETable of ContentsPreface . 7Part 1 – MPLAB XC32 AssemblerChapter 1. Assembler Overview1.1 Introduction . 151.2 Assembler and Other Development Tools . 151.3 Feature Set . 161.4 Input/Output Files . 17Chapter 2. Assembler Command-Line Options2.1 Introduction . 232.2 Assembler Interface Syntax . 232.3 Compilation-Driver Interface Syntax . 242.4 Options that Modify the Listing Output . 252.5 Options that Control Informational Output . 372.6 Options that Control Output File Creation . 382.7 Assembler Symbol-Definition and Search-Path Options . 392.8 Compilation-Driver and Preprocessor Options . 40Chapter 3. MPLAB XC32 Assembly Language3.1 Introduction . 413.2 Internal Preprocessor . 423.3 Source Code Format . 433.4 Special Characters . 483.5 Symbols . 513.6 Giving Symbols Other Values . 523.7 The Special DOT Symbol . 523.8 Expressions . 533.9 Operators . 533.10 Special Operators . 55Chapter 4. Assembler Directives4.1 Introduction . 574.2 Directives that Define Sections . 584.3 Directives that Initialize Constants . 624.4 Directives that Declare Symbols . 644.5 Directives that Define Symbols . 654.6 Directives that Modify Section Alignment . 664.7 Directives that Format the Output Listing . 68 2013 Microchip Technology Inc.DS50002186A-page 3

XC32 Assembler, Linker and Utilities User’s Guide4.8 Directives that Control Conditional Assembly . 694.9 Directives for Substitution/Expansion . 714.10 Directives that Include Other Files . 754.11 Directives that Control Diagnostic Output . 764.12 Directives for Debug Information . 774.13 Directives that Control Code Generation . 79Chapter 5. Assembler Errors/Warnings/Messages5.1 Introduction . 815.2 Fatal Errors . 825.3 Errors . 835.4 Warnings . 905.5 Messages . 94Part 2 – MPLAB XC32 Object LinkerChapter 6. Linker Overview6.1 Introduction . 976.2 Linker and Other Development Tools . 976.3 Feature Set . 986.4 Input/Output Files . 98Chapter 7. Linker Command-Line Interface7.1 Introduction . 1057.2 Linker Interface Syntax . 1067.3 Compilation-Driver Linker Interface Syntax . 1077.4 Options that Control Output File Creation . 1087.5 Options that Control Run-time Initialization . 1137.6 Options that Control Multilib Library Selection . 1147.7 Options that Control Informational Output . 1157.8 Options that Modify the Link Map Output . 118Chapter 8. Linker Scripts8.1 Introduction . 1198.2 Overview of Linker Scripts . 1208.3 Command Line Information . 1208.4 Default Linker Script . 1218.5 Adding a Custom Linker Script to an MPLAB X IDE Project . 1238.6 Linker Script Command Language . 1248.7 Expressions in Linker Scripts . 140Chapter 9. Linker Processing9.1 Introduction . 1479.2 Overview of Linker Processing . 1489.3 Linker Allocation . 1509.4 Global and Weak Symbols . 1539.5 Initialized Data . 154DS50002186A-page 4 2013 Microchip Technology Inc.

Table of Contents9.6 Stack Allocation . 1579.7 Heap Allocation . 1579.8 PIC32MX Interrupt Vector Tables . 1589.9 Interrupt Vector Tables for PIC32 MCUs Featuring Dedicated ProgrammableVariable Offsets . 159Chapter 10. Linker Examples10.1 Introduction . 16310.2 Highlights . 16310.3 Memory Addresses and Relocatable Code . 16410.4 Locating a Variable at a Specific Address . 16510.5 Locating a Function at a Specific Address . 16510.6 Locating and Reserving Program Memory . 166Chapter 11. Linker Errors/Warnings11.1 Introduction . 16711.2 Fatal Errors . 16811.3 Errors . 16911.4 Warnings . 172Part 3 – 32-Bit Utilities (including the Archiver/Librarian)Chapter 12. MPLAB XC32 Object Archiver/Librarian12.1 Introduction . 17512.2 Archiver/Librarian and Other Development Tools . 17612.3 Feature Set . 17712.4 Input/Output Files . 17712.5 Syntax . 17712.6 Options . 17812.7 Scripts . 180Chapter 13. Other Utilities13.1 Introduction . 18313.2 xc32-bin2hex Utility . 18413.3 xc32-nm Utility . 18513.4 xc32-objdump Utility . 18813.5 xc32-ranlib Utility . 19113.6 xc32-size Utility . 19213.7 xc32-strings Utility . 19413.8 xc32-strip Utility . 195Part 4 – AppendicesAppendix A. Deprecated FeaturesA.1 Introduction . 199A.2 Assembler Directives that Define Sections . 200 2013 Microchip Technology Inc.DS50002186A-page 5

XC32 Assembler, Linker and Utilities User’s GuideAppendix B. Useful TablesB.1 Introduction . 201B.2 ASCII Character Set . 201B.3 Hexadecimal to Decimal Conversion . 202Appendix C. GNU Free Documentation LicenseGlossary .205Index .225Worldwide Sales and Service .234DS50002186A-page 6 2013 Microchip Technology Inc.

MPLAB XC32 ASSEMBLER,LINKER AND UTILITIESUSER’S GUIDEPrefaceNOTICE TO CUSTOMERSAll documentation becomes dated, and this manual is no exception. Microchip tools anddocumentation are constantly evolving to meet customer needs, so some actual dialogsand/or tool descriptions may differ from those in this document. Please refer to our web site(www.microchip.com) to obtain the latest documentation available.Documents are identified with a “DS” number. This number is located on the bottom of eachpage, in front of the page number. The numbering convention for the DS number is“DSXXXXXXXXA”, where “XXXXXXXX” is the document number and “A” is the revision levelof the document.For the most up-to-date information on development tools, see the MPLAB X IDE online help.Select the Help menu, and then Topics to open a list of available online help files.INTRODUCTIONThis chapter contains general information that is useful to know before using 32-bitlanguage tools. Items discussed include: Document LayoutConventions Used in this GuideRecommended ReadingThe Microchip Web SitemyMicrochip Personalized Notification ServiceCustomer Support 2013 Microchip Technology Inc.DS50002186A-page 7

XC32 Assembler, Linker and Utilities User’s GuideDOCUMENT LAYOUTThis document describes how to use GNU language tools to write code for 32-bitapplications. The document layout is as follows:Part 1 – MPLAB XC32 Assembler Chapter 1. Assembler Overview – gives an overview of assembler operation. Chapter 2. Assembler Command-Line Options – details command-line optionsfor the assembler. Chapter 3. MPLAB XC32 Assembly Language – discusses the sourcelanguage used by the macro assembler. Chapter 4. Assembler Directives – describes the assembler commands in thesource code. Chapter 5. Assembler Errors/Warnings/Messages – provides a descriptive listof the errors, warnings and messages.Part 2 – MPLAB XC32 Object Linker Chapter 6. Linker Overview – gives an overview of linker operation. Chapter 7. Linker Command-Line Interface – details command-line options forthe linker. Chapter 8. Linker Scripts – describes how to generate and use linker scripts tocontrol linker operation. Chapter 9. Linker Processing – discusses how the linker builds an applicationfrom input files. Chapter 10. Linker Examples – includes a number of 32-bit-specific linkerexamples. Chapter 11. Linker Errors/Warnings – provides a descriptive list of the errorsand warnings.Part 3 – 32-Bit Utilities (including the Archiver/Librarian) Chapter 12. MPLAB XC32 Object Archiver/Librarian – details command-lineoptions for the archiver/librarian. Chapter 13. Other Utilities – details the other utilities and their operation.Part 4 – Appendices Appendix A. Deprecated Features – discusses the features consideredobsolete. Appendix B. Useful Tables – lists some useful tables: the ASCII character setand hexadecimal to decimal conversion. Appendix C. GNU Free Documentation License – details the licenserequirements for using the GNU language tools.DS50002186A

MPLAB XC32 ASSEMBLER, LINKER AND UTILITIES USER’S GUIDE 2013 Microchip Technology Inc. DS50002186A-page 7 Preface INTRODUCTION This chapter contains gener

Related Documents:

MPLAB SIM MPLAB ICE 2000 MPLAB ICD 2 MPLAB ICE 4000 MPLAB IDE Debugger The other debug engines are hardware devices, while MPLAB SIM is a software program, running on your PC. MPLAB SIM provides many of the same features as in-circuit emulators and in-circuit debuggers.

Chapter 1: MPLAB IDE Preview – An overview of what MPLAB IDE is and how it works. Chapter 2: MPLAB IDE Installation – How to install MPLAB IDE on your computer. Chapter 3: Getting Started with MPLAB IDE – A Tutorial – How to begin using MPLAB IDE. Chapter 4: MPLAB IDE Projects Tuto

MPLAB X CCS C Compiler Tutorial How to install the CCS C Compiler inside MPLAB X Before the CCS C Compiler can be used inside MPLAB X, the CCS C MPLAB X Plug-in must be installed. This process can be done inside MPLAB X. 1. Launch MPLAB X. 2. From the MPLAB X menu, select Tools - Plugins 3.

MPLAB C18 C Compiler The layout of this document: –Installing MPLAB C18: A step-by-step guide through the installation process of MPLAB C18 Compiler. –Configuring MPLAB IDE: MPLAB IDE setup for use with MPLAB C18. Basics of MPLAB IDE configuration to run your Program

MPLAB IDE Integrated Development Environment MPASM Assembler, MPLINK Linker, MPLIB Librarian and MPLAB SIM Simulator MPLAB C30 C Compiler MPLAB Visual Device Initializer MPLAB Data Monitor and Control Interface MPLAB

MPLAB ICD In-Circuit Debugger MPLAB ICE In-Circuit Emulator · ICE 2000 · ICEPIC Simulator C Compilers · MPLAB C17 · MPLAB C18 MPLIB Object Librarian MPLINK Object Linker MPASM Assembler MPLAB IDE The MPLAB Integrated Development Environment, or IDE, can be looked

MPLAB X IDE The latest information on Microchip MPLAB X IDE, the Windows Integrated Development Environment for dev elopment systems tools. This list is focused on the MPLAB IDE, MPLAB ID E Project Manager, MPLAB Editor and MPLAB SIM simu

the welfarist objective assumed in modern Mirrleesian theory. In normative terms, the shift from the classical bene–t-based view to the dominant modern approach, which pursues so-called "endowment taxation," is quite substantial. Under the modern approach, an individual s income-earning ability is taken as a given, and as ability makes it .