[fpc-devel] FPC and Windows Phone 8

Vsevolod Alekseyev sevaa at sprynet.com
Mon Mar 10 13:52:56 CET 2014


> Please elaborate in how far the calling convention does not match. This
might be a bug in FPC then 

I'm talking about my replacement for the subset of the Pascal RTL. The
calling code assumes the Pascal convention, the implementation is in C. They
don't match on Intel.

> i386 FPC has support for MASM. Use -Amasm for that.

I do already. I don't now remember the exact history behind each
replacement, but here they are. 

 - DGROUP is a problem; I comment it out
 - So is ASSUME
 - The syntax of SEGMENT is different
 - Instead of .386p I want .686p
 - Instead of _CODE I want _TEXT



-----Original Message-----
From: fpc-devel-bounces at lists.freepascal.org
[mailto:fpc-devel-bounces at lists.freepascal.org] On Behalf Of Sven Barth
Sent: Monday, March 10, 2014 2:50 AM
To: fpc-devel at lists.freepascal.org
Subject: Re: [fpc-devel] FPC and Windows Phone 8

On 10.03.2014 00:20, Vsevolod Alekseyev wrote:
> Enter Windows Phone 8. In order to have a good debugging experience, you
need to build the code both for Intel x86 (for the emulator), and for ARM
(for devices). The flavor of ARM that WP8 uses is strictly Thumb-2, with
hard floating point and hard-float calling convention (i. e. parameters in
floating point registers). Also, on Intel, even the integer calling
convention doesn't match between C and Pascal. Here's what I do.

Please elaborate in how far the calling convention does not match. This
might be a bug in FPC then.

> I compile my FPC sources to assembly for Win32/Intel (with -a option). I'm
applying some search-replace fixes so that the generated assembly works with
MASM. Then I copy the assembly into the WP8 project, where it's assembled
and put into a static library.

i386 FPC has support for MASM. Use -Amasm for that.

> As you see, I've never meant to implement a whole application, or even a
whole native layer in Pascal. It's just an algorithm library. Also, I'm
heavily relying on the fact that RTL use is limited in the library.
Reimplementing a large body of FPC RTL from scratch would be unimaginably
hard.

winrt (i386-winrt, x86_64-winrt and arm-winrt) should become a full target
of FPC in the future. It "just" needs to be done.

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel at lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel




More information about the fpc-devel mailing list