This Technical Note discusses migration from GCC inline assembler to IAR Embedded Workbench for ARM. This Technical Note applies to ARM7/9 devices, not to Cortex devices.
These examples have been written by Mr. Ivan Paulik, Pasat, Bratislava, Slovakia, Europe. We are most grateful that he shares his findings with IAR Embedded Workbench for ARM users.
Now and then there are users requesting that IAR makes a "GCC to IAR Embedded Workbench for ARM Migration Guide". This might seem to be trivial task (as IAR have written other Migration Guides), but it is not trivial - as there is no "one single GCC compiler" we are not able to cover all GCC variants.
The most different area between GCC and IAR Embedded Workbench for ARM is Inline Assembler and such constructions (and some other issues) will be commented in this Technical Note (and in the attachment). The goal is that the 9 examples + comments should cover the issues that are most different between GCC and IAR Embedded Workbench for ARM, and that other issues can be sorted out by the developer that performs the migration.
The GCC compiler seems to give the user more responsibility to the user, where IAR Embedded Workbench for ARM instead uses keywords, intrinsic functions and/or options for covering the same construction in the application.
Please rewrite such constructions without reading/using the general registers. As noted in the example, there is great risk that IAR C/C++ Compiler for ARM (ICCARM) will re-use register R0 and thus create a run-time error.
Replace the GCC construction with the IAR Systems C/C++ Compiler for ARM keyword __SWI.
This should not be used in ICCARM as the use of inline assembly should be minimized in order to make the compile more efficient.
The IAR Systems suggestion is to rewrite the inline assembly as a real assembly function in an assembly file.
There are great risks in keeping the GCC construction. The IAR Systems suggestion is to rewrite the inline assembly as a real assembly function in an assembly file.
This is describes a change of syntax from GCC to IAR Systems C/C++ Compiler for ARM.
Rewrite with the use of the IAR Systems C/C++ Compiler for ARM section operators.
Remove the GCC constructions and use the Interwork option instead.
This is describes a change of syntax from GCC to IAR Systems C/C++ Compiler for ARM.
This is describes a change of syntax from GCC to IAR Systems C/C++ Compiler for ARM.
Note:
This Technical Note does not cover all GCC-to-IAR Embedded Workbench for ARM conversion issues, but is it at least a starting point for the migration.
All product names are trademarks or registered trademarks of their respective owners.
© IAR Systems 1995-2021 - All rights reserved.
We use cookies on this website to provide you with a better experience. You need to accept cookies to continue using this site. Cookies