Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2000-11

Progress m68k port for Palm OS

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Matt Emson

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

Assembler.

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:

program Test;
begin
end.

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 :(

Show quoted text 5 lines
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 ;)

Matt

Peter Vreman
Show quoted text 8 lines
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 :(

I think that only a new assembler generator is needed to output Pila code, becuase the m68k instructions are the same. It's just like that for i386 we've a nasm,masm and gnu as output.

Matt Emson
I think that only a new assembler generator is needed to output Pila code, becuase

the

m68k instructions are the same. It's just like that for i386 we've a nasm,masm

and gnu as

output.

Yeah, that's what I meant ;) The part that decides what the assembler should look like needs a Pila re-write. Based on the way the '-Am' (Motorola style) mode assembler output works, but altered for Pila.

Matt

Florian Klaempfl
to Matt Emson: Just to prove that I'm not just talking, but also doing ;) here is an update. There's not…
you wrote 8 lines
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 think you should remove most rtl calls if they can't be simulated easily, a Palm
doesn't have that much memory ..