O'Reilly logo

ARM® Cortex® M4 Cookbook by Dr. Mark Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing Cortex-M4 assembly language

Before we start to write an assembly language subroutine, we need an idea of what the function has to achieve. The best way to specify this is to first write the function in a high-level language, such as C, and then translate the C code into assembly language line by line. Some experienced assembly language programmers argue that this is inefficient, but the technique produces well-documented code that can be optimized in further iterations of the design.

Getting ready

To translate the C code, we need to be familiar with both the instruction set and the addressing modes that are used by the Cortex-M4. Details of the instruction set can be found in ARM's Architecture Reference Manual and also in the ARM Cortex-M4 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required