Assembling Cortex-M assembly language by Arm GNU Toolchain Aug 15, 2022 Build step arm-none-eabi-as -g test.s -o test.o arm-none-eabi-ld test.o -o test.elf arm-none-eabi-objcopy -O binary test.elf test.bin .syntax unified .cpu cortex-m0 .thumb .long 0x20000400 @ Main Stack Pointer 4-byte .long 0x00000001 @ Reset vector 4-byte .global _start b _start @ Jump to _start 2-byte .org 0x0A _start: ldr r0, =0x0000dfff @ PB13=0 ldr r1, =0x50004048 @ GPIOB_DOUT str r0, [r1] @ Store the value to GPIOB_DOUT b . @ Endless loop References ARM-ASM-Tutorial – Mikrocontroller.net How to boot a Cortex-M3 or Cortex-M4 processor with uninitialized memory at address zero Cortex-M0 Devices Generic User Guide Version 1.0