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

Passing parameters between C and the assembly language

When a function or subroutine is called, its address must be loaded into the PC so that it can be executed and, when it terminates, execution of the calling routine must continue. In addition, there must be a convention that defines the following:

  • How parameters are passed to the function
  • How parameters are returned
  • Which (if any) registers can be modified by the function

The ARM Architecture Procedure Call Standard deals with these issues (refer to Procedure Call Standard for the ARM Architecture, http://infocenter.arm.com/).

Getting ready

In this section, we will learn more about the ARM Architecture Procedure Call Standard (AAPCS) by writing an assembly language subroutine that receives a parameter ...

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