Al 23/10/12 02:19, En/na Johnny Billquist ha escrit:
Nice idea. Or the libc from DECUS C?
Hmm yes. Will there be compiler compatibility issues there? (like
with anything done in assembler, asm/C interface etc?)
You could use the DECUS C libc, but you need to rewrite part of it. I bet the calling
convention for gcc isn't the same as for DECUS C. Also, DECUS C does not expect to run
on bare metal, so some basic I/O functionality needs to be written as well.
But this is all pretty simple if you know your assembler.
Well, gas (the GNU assembler) is not source-compatible with MACRO-11, so there would be
some previous work before even trying to compile the stuff... For a starter, gas uses the
'$' symbol to prefix immediate arguments, while MACRO-11 uses '#'. And
this one is easy, since gas can work in a sort of "compatibility mode". The
macro and symbol handling is also different, and some pseudoinstructions are different...
Nothing that can't be worker around, but it would be a lot of work. The 2.11 BSD libc,
on the other hand, is mostly written inC, and the parts in assembler are written for the
BSD assembler, which is much more compatible with gas, and the calling standard is the
same (R0 and R1 get clobbered, the return value comes in R0 for words and R0:R1 for longs,
the called routine saves R3-R5, R5 is the frame pointer and the caller cleans the stack
after the return). Oh, and the BSD license is liberal enough to not to worry about those
pesky issues; (I have not checked the DECUS-C license though).