Extended inline assembly with GCC in CodeWarrior

Showing results for 
Search instead for 
Did you mean: 

Extended inline assembly with GCC in CodeWarrior

No ratings

Extended inline assembly with GCC in CodeWarrior

Hello community!


Nowadays assembly language is being eradicated for embedded systems, and other alternatives such as C/C++ are widely used.


However we know sometimes it becomes necessary to get to "the bones" of our MCU, even from a C project, and play directly with its registers and status flags. Some use cases are:


- Startup code

- Bootloaders

- Time critical routines

- Benchmarking


It is common to include assembly code using the "asm()" style. But what if I want to use my C variables in the assembly code? or if I want to call an assembly subroutine from a C project? The GCC toolchain integrated with CodeWarrior brings this flexibility.


In the attached pdf document you can find an overview and explanation of this extended assembly feature. Also attached a pair of example projects tested with CW v10.6 using KL25Z128 and K60DN512.


Thanks to Abigail Inzunza Lopez for helping with this.


I hope you like it !

Labels (1)
Version history
Revision #:
1 of 1
Last update:
‎09-30-2014 11:29 AM
Updated by: