I'm trying this out on Linux x86_64, to see what is involved for getting the minimum viable sized pascal app.
My first attempt results in something about half the size of an equivalent C app, but with some reduced maintainability.
(4440 bytes versus 8544 bytes).
I have several files and a discussion involved, so I put in it a gist here:
https://gist.github.com/bogen85/4e24f5e6d1b8ad3ea2ec97af4f2d3172The basic questions I need answers to are:
1) How does one reference literal strings from other units in free pascal in inline assembler?
2) How to I get access to fpc_shortstr_to_shortstr while still maintaining a fairly small size? (Yes, I understand each added item witll cause the app size to grow).
3) Or addition of things like writeln? (assuming I'll have to the needed output routines, in pascal, assembly, from some existing c code, or a combination of those).
In my example gist I'm linking with gcc. I assume to get things like fpc_shortstr_to_shortstr I'd need to link with fpc, as I was not finding that symbol in any library.
I'd like to keep the size small, 10s of kb, versus hundreds...