Skip to main content
Hansel
Senior
April 14, 2022
Question

What is the most effective way for using assembly code at the core of interrupt handling?

I've been able to successfully handle my tasks via C using the interrupt entry for DMA1_Stream0_IRQHandler() but want to rewrite it in assembly code (let's please not get into a discussion of whether this is worth it or not for performance reasons).

When trying to write pure assembly code, I see STMCubeIDE offer me only C or C++ source files, apparently nothing for ASM. What's an effective way to do it then? I specifically want to write code that is called when the interrupt for DMA1_Stream0_IRQHandler() is called.

Some hints in the right direction or even some simple framework would be highly appreciated. I can take it from there. So far I haven't really had much luck to find instructions on the internet.

This topic has been closed for replies.

3 replies

Pavel A.
April 14, 2022

> see STMCubeIDE offer me only C or C++ source files, apparently nothing for ASM. 

Every CubeIDE project has at least one pure asm file. The startup.s.

The best way to deal with assembly is to have a code review with an expert.

Nikita91
Lead II
April 14, 2022

Write your code in a .s file. it will be compiled automatically.

Have a look to the startup assembly file as example.

Hansel
HanselAuthor
Senior
April 14, 2022

D'oh. Should've known that. Thanks for the hints.