[fpc-devel] FPC and Windows Phone 8
pascaldragon at googlemail.com
Mon Mar 10 07:50:09 CET 2014
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.
More information about the fpc-devel