Progress [fpc-pascal]m68k port for Palm OS
memsom at interalpha.co.uk
Wed Nov 1 11:10:21 CET 2000
Just to prove that I'm not just talking, but also doing ;) here is an update.
There's not a great deal to report. What I can report is encouraging however.
> 3. taken a good look at Pila (Palm Assembler) with a view to using this as
The M68K FPC compiler is capable of compiling valid code!! I took the headers
that Florian kindly sent me, and altered then until I could get assembler output.
This took a good hour or so (all the Functions/Procedures that were in the Pilot
unit that were declared with a 'syscall' had to be moved into the implementation
section, and prototypes had to be declared.) A few other changes seemed to be
necessary - mainly that there were a few declarations along the lines of 'foo:
packed integer' and FPC didn't like the 'packed' identifier being used in this
way. (Does anybody know a way round this???)
The most unfortunate aspect though is that the assembler file output by the
compiler is fairly useless at the moment. All of the assembler file outputs
were incorrect for Pila. The Motorola was close (and will undoubtably be the
one used if the port uses Pila as the assembler), but because Pila is fairly
simplistic, but wholey Palm orientated I believe certain things aren't implememted
fully, and others will save a lot of development headaches.
Not to worry I thought, and I decided to give the assembler provided by PRC-Tools2.0
(C++, gnu based compiler package.) I got things to compile!! I build a PRC!!!
But, of course, it crashed the PalmOS emulator (expected ;)
The main problem seems to now be that whilst I can compile simple apps along
the lines of:
If I try to put any more complexity into them (such as an event loop) the compiler
goes mad, and the output has assembler errors. I don't have them to hand, but
they're along the lines of 'missing opperands', and anywhere where the line:
DBRA D2, .Label
the assembler complains.
I think I'll probably continue to use the GNU assembler until I'm convinced
something can't be done about the problem. I do however think that Pila may
be the way to go. This will mean a new Code Generator geared up for Pila.. based
on the Motorola one I spose :(
> 4. looked ant what RTL there was on the M68K port page.. started again from
> scratch, borrowing the units that a guy called Swartjes (sorry, can't remember
> first name) did for a Macintosh Pascal Compiler (Think Pascal 4.X)
Gonna look more into this. Because of the Palm's size, most of what we would
traditionally call RTL is simply calls to PalmOS, and would be better accomplished
in this way.. Though another way of approaching the problem may be to develop
a simple RTL that wraps the most important 'Start up' PalmOs calls. They could
therefore be written in straight assembler, rather than trying to use a mechanism
to call systraps.
I'll try and take another look tonight ;)
More information about the fpc-pascal