Analog Devices EE-120 Interfacing Assembly Language Programs to C

This document is a technical note on using Analog Devices' DSP components and development tools. It provides helpful steps for interfacing assembly code and C language.


Analog Devices EE-120 Interfacing Assembly Language Programs to C - cover page
Brand
Analog Devices
Category
Other Electronics
Document type
Application Note
Language
English
Pages
3
File format
PDF
File size
154 KB
Published
03 August, 2012
Updated
29 September, 2023
MD5 checksum
76B883B4F827FA14CC8F42CDE3AE13C3

About this manual

This document provides a technical guide for programmers working with Analog Devices DSP components and development tools. It details the steps required to write assembly language subroutines that can be called from C code, ensuring compatibility with the C runtime model. The text covers creating function prototypes, handling arguments passed in registers versus on the stack, and managing specific processor registers.

What's inside

  • Interfacing Assembly Language Programs to C
  • Writing a subroutine in assembly language
  • Creating a C interface definition
  • Handling arguments and registers
  • Calling a C function from assembly
  • Runtime model caveats
  • Stack setup for function calls

Frequently asked questions

What is the purpose of this technical note?

It contains helpful steps a programmer can use to interface assembly code and C safely and efficiently.

How should a C function prototype be declared for an assembly entry point?

The C compiler normally prefaces the name of external entry points with an underscore, so the function should be declared with an underscore.

What must be done with preserved registers in an assembly function?

Preserved registers must be saved first and then restored before returning to the caller.

Download PDF (154 KB)

More Analog Devices Manuals


View all Analog Devices manuals →