Some inline arm assembly to flash some LEDs on the FRDM-KL25Z
The FRFM-KL25Z uses the Coretex-M0+ which based on the ARM v6m architecture. FRDM-KL25Z
On the development board, there is a set of RGB LEDs available for use.
The idea behind the code is to have a simple counter which increments by one on each loop. If the counter reaches some target value set by the user, the LED will be toggled and the counter reset. This makes the LED flash. Adjusting the target value changes the frequency at which the LED flashes.
In order to toggle the LEDs, you have to write to the PTOR register of the GPIO Port responsible for the LED. For this hardware target, the corresponding values can be found here.
To run this yourself with the FRDM-KL25Z, you can go to the mbed.org online compiler, and create a new project. Paste the main.cpp code into main.cpp and create a new file in the same folder called my_asm.s and copy the assembly in. Then compile and run.
Here is a quick video of what it might look like: