Solved the above yesterday - however, I can't make any variant of variable access work on procedure MyProc(var1,var2:string);assembler; - I have to put the variables outside and use a local (.Ltest: .long var1) label.

Upon reading the compiled asm source, I see FPC puts var1 and var2 in r0 and r1 before calling MyProc. However, I also see that the start of MyProc absolutely trashes those registers and don't save them anywhere.

Should it work just by accessing r0 and r1. And if so, where can I read up on which registers FPC uses, so I don't have to save it on the stack? (And if possible, which registers are preserved/untouched by SWI calls.)