Extended Inline Assembly with Kinetis Design Studio

Document created by Jorge_Gonzalez Employee on Sep 30, 2014Last modified by ebiz_ws_prod on Dec 13, 2017
Version 6Show Document
  • View in full screen mode

Hello KDS users!

 

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? We can do this in Kinetis Design Studio, which comes with GCC tools preinstalled.

 

The attached document is an overview and explanation of this extended assembly feature. Also I am including a pair of example projects developed in KDS v1.1.1, for the KL25Z128 and K60DN512 devices.

 

Thanks to Abigail Inzunza Lopez, who helped with this.

 

I hope you find this useful !

Original Attachment has been moved to: KDS_KL25_ASM_C.zip

Original Attachment has been moved to: KDS_K60D100_ASM_C.zip

2 people found this helpful

Attachments

Outcomes