Your idea is not bad and I think in common your code is OK.
It can be made nicer and bit optimized in the part where you transfer command string
to $35, but this is another story. If you need to return to this assembler routine you can
intercept the 'Ready' vector at $1A, but if this is not needed your code will work.

As for hard coding the stack pointer it's just that I don't know exactly what my C program put on the stack before this code. So well it's easier to hard code it. I have made sure the first value on the stack is still 0 as the Basic apparently needs this (at least that's what I understood from "l'Oric à Nu").

Anyway Dbug's solution would be more correct but it's also way more complex so...

As for hard coding the stack pointer it's just that I don't know exactly what my C program put on the stack before this code. So well it's easier to hard code it. I have made sure the first value on the stack is still 0 as the Basic apparently needs this (at least that's what I understood from "l'Oric à Nu").

Anyway Dbug's solution would be more correct but it's also way more complex so...

Normally what your C code put on the stack should be predictable, and no function should left anything on the stack apart from, depending on the ABI (I need to check how the C compiler provide the return value of a function) possibly the return value of a C function.