Loading .asm file into bare ARM microchip

Thread Starter

Samantha Groves

Joined Nov 25, 2023
63
Hello.I have just learnt ARM assembly and I am looking forward into buying a bare ARM microcontroller to actually do something.I am watching this youtube video series:


Later in the series he is writing down C code to program the microcontroller however is it possible to write assembly in that editor since I want to get as close to machine code as possible?
 

Ian0

Joined Aug 7, 2020
10,276
It's not the .asm file that goes in the microcontroller, it's the .hex file.
It looks like the processor is a STM32 and the IDE is based on Eclipse.
That being the case, the assembler file will be called .s
Eclipse includes GNU C and GNU AS, and any assembler file you write will be assembled by GNU AS.
The most difficult task when writing entirely in assembler is setting up the microcontroller at the beginning - telling it which clock to use, enabling all the necessary peripherals, setting up the interrupt vectors etc.
There is an example of startup code in Joseph Yiu's book "the definitive guide to the Cortex M0", but you might have a different Cortex.
You can allow Eclipse to do the startup code for you, and in the main.c program where it says "write your code here" you can call a function which is your assembler.
 
Top