8051 IAR Embedded Workbench Migration Guide
Total Page:16
File Type:pdf, Size:1020Kb
8051 IAR Embedded Workbench Migration Guide for the MCS-51 Microcontroller Family M8051-2 COPYRIGHT NOTICE © Copyright 1991–2005 IAR Systems. All rights reserved. No part of this document may be reproduced without the prior written consent of IAR Systems. The software described in this document is furnished under a license and may only be used or copied in accordance with the terms of such a license. DISCLAIMER The information in this document is subject to change without notice and does not represent a commitment on any part of IAR Systems. While the information contained herein is assumed to be accurate, IAR Systems assumes no responsibility for any errors or omissions. In no event shall IAR Systems, its employees, its contractors, or the authors of this document be liable for special, direct, indirect, or consequential damage, losses, costs, charges, claims, demands, claim for lost profits, fees, or expenses of any nature or kind. TRADEMARKS IAR Systems, From Idea to Target, IAR Embedded Workbench, visualSTATE, IAR MakeApp and C-SPY are trademarks owned by IAR Systems AB. Microsoft and Windows are registered trademarks of Microsoft Corporation. All other product names are trademarks or registered trademarks of their respective owners. EDITION NOTICE Second edition: July 2005 Part number: M8051-2 This guide applies to version 7.x of 8051 IAR Embedded Workbench®. M8051-2 Contents Tables ........................................................................................................................ v Migrating from version 6.x to version 7.10A ..................................... 1 Key advantages .......................................................................................... 1 Migration considerations ....................................................................... 2 IAR Embedded Workbench IDE ........................................................ 2 Workspace and projects ....................................................................... 2 C-SPY layout files ............................................................................... 2 Project options .......................................................................................... 2 Runtime library and object files considerations .......................... 3 Compiling and linking with the DLIB runtime library ........................ 3 Program entry ....................................................................................... 4 System initialization—Cstartup ........................................................... 4 Migrating from CLIB to DLIB ............................................................ 4 Linker considerations ........................................................................... 5 Migrating from version 5.x to version 6.x ............................................. 7 Key advantages .......................................................................................... 7 IDE ....................................................................................................... 7 Compiler ............................................................................................... 8 Debugger .............................................................................................. 8 Migration considerations ....................................................................... 8 Project file and project setup .............................................................. 9 Source code and compiler considerations ................................... 10 Predefined symbols ............................................................................ 10 Memory models ................................................................................. 11 Assembler considerations ................................................................... 12 Byte order ........................................................................................... 12 Removed operators ............................................................................ 12 New operators .................................................................................... 13 Removed directives ............................................................................ 13 New directives .................................................................................... 13 iii M8051-2 Runtime environment considerations ........................................... 14 Runtime library .................................................................................. 14 Calling conventions ............................................................................ 16 Generic pointers ................................................................................. 16 Constants and strings ......................................................................... 17 Byte order ........................................................................................... 18 Linker considerations .......................................................................... 19 Segment control directives ................................................................. 19 Object file format ............................................................................... 20 Compiler options .................................................................................... 21 Migrating project options ................................................................... 21 Filenames ........................................................................................... 24 List files .............................................................................................. 25 Environment variables ....................................................................... 25 Extended keywords ................................................................................ 25 Bits ..................................................................................................... 26 Storage modifiers ............................................................................... 27 Interrupt functions and vectors .......................................................... 28 Absolute located variables ................................................................. 28 Pragma directives ................................................................................... 29 Intrinsic functions ................................................................................... 32 Segments .................................................................................................... 33 Assembler source code ....................................................................... 35 Other changes .......................................................................................... 35 Nested comments ............................................................................... 35 Sizeof in preprocessor directives ....................................................... 36 8051 IAR Embedded Workbench iv Migration Guide M8051-2 Ta bl e s 1: Converting from version 5.x memory models ...................................................... 11 2: Default pointers used for selected data models in version 6.x .............................. 17 3: Conversion of constant and string location keywords .......................................... 18 4: Version 5.x compiler options not available in version 6.x .................................... 22 5: Compiler options identical in both compiler versions .......................................... 22 6: Renamed or modified options ............................................................................... 23 7: Specifying filename and directory in version 5.x and version 6.x ........................ 24 8: Old and new extended keywords .......................................................................... 25 9: Old and new pragma directives ............................................................................. 30 10: Old and new intrinsic functions .......................................................................... 32 11: Old and new segments ........................................................................................ 33 v M8051-2 8051 IAR Embedded Workbench vi Migration Guide M8051-2 Migrating from version 6.x to version 7.10A This guide gives hints for porting your application code and projects to the new version 7.10A. C source code that was originally written for the 8051 IAR C Compiler version 6.x can be used also with the new 8051 IAR C/C++ Compiler version 7.10A. However, some small modifications may be required. This guide presents the major differences between the 8051 IAR Embedded Workbench version 6.x and the 8051 IAR Embedded Workbench version 7.10A, and describes the migration considerations. Note that if you are migrating from the 8051 IAR Embedded Workbench version 5.x , you must first read the chapter Migrating from version 5.x to version 6.x. Key advantages This section lists the major advantages in the 8051 IAR Embedded Workbench version 6.x as compared to the 8051 IAR Embedded Workbench version 7.10A. Hereafter, the two versions are referred to as version 6.x and version 7.10A, respectively. ● Efficient window management through dockable windows optionally organized in tab groups ● Source browser with a catalog of functions, classes, and variables, for a quick navigation to symbol definitions ● Template projects to get a project that links and runs out of the box for a smooth development start-up ● Batch build with ordered lists of configurations