Issue storing program

I am trying to program a Arduino due in ARM assembly and have myself a fine program:

        .asm

        .text
        .global	changeworkingio
	.type changeworkingio, %function
        .global startup
        .type startup, %function
        .global main

        .type main, %function

main:
bl startup
        ldr r7,  #0x400E1230
        adr r7, #3
        ldr r6, #0b1
        str r7, [r6]

BX LR


startup:

        ldr r7,  #0x0
        str r7, #0x400E12E4     ;allows PIOC to be modified :)                 

        ldr r7, #0b1
        ldr r6, #0x400E1200     ;writes                                        
        adr r6, r6, #3
        str r7, [r6]
        ldb r3, #3
        ldb r4, #3
        stb r3, workingio
        stb r3, [workingio + #1]
BX LR
        .data
.word workingio

        .end












My issue is sending it to the board as all tutorials show how to write functions in asm and call from C. Boiled down my question is this: How do I write a compiled ARM program into the boards memory and have it run.

you cannot just write an .asm file and somehow “send it raw” to the chip. Right now your program is just a fragment of ARM assembly without the structure the microcontroller requires to boot..

The toolchain and boot process expect a proper ELF or binary image, with a vector table at the beginning, a reset handler, and the code placed at the correct addresses in flash etc

If you embed your ARM assembly inside a normal Arduino sketch (C++), you let the existing Arduino build system handle the vector table, the reset handler, the memory initialization, and the upload process. The toolchain already produces the right ELF with the right linker script and flashes it.

You can just drop your assembly inside functions using GCC inline assembly (asm volatile(...)) or by writing a separate .S file and letting the Arduino IDE compile it along with your sketch.

This is by far easier than the alternative where you need to do it all « by hand ».