[fpc-devel] FPC and Windows Phone 8

Sven Barth pascaldragon at googlemail.com
Tue Mar 11 07:50:39 CET 2014


On 11.03.2014 03:10, Vsevolod Alekseyev wrote:
> Let me reintroduce back each of the problematic lines and see what happens.
>
> Uncommenting DGROUP causes the following error message:
> error A2214: GROUP directive not allowed with /coff option
> I don't know what does DGROUP do, but Nikolay knows :) It's a DOS remnant,
> and makes no sense in Win32.
>
> Uncommenting ASSUME causes the following:
> error A2074: cannot access label through segment registers
> And it makes sense, too; who cares for segment registers on a flat model
> platform.
>
> .i386 works on VS2012, but on VS2005 (where I debugged initially) it'd give
> me the following error on every ALIGN 16 line:
> error A2189: invalid combination with segment alignment : 16

You could report these as bugs. I bet the MASM writer didn't get that 
much love in the past. ;)

> Anyways, as far as I can see, the biggest hurdle to implementing a Windows
> Phone target in FPC would be the ARM dialect. It's strictly Thumb-2 with
> hardware floating point and hard-float ABI. Some time ago, I've tried for a
> short while to make classic, 32-bit ARM code work on a device, and I
> couldn't. I've tried several assembly sequences that would branch and switch
> mode; they all would cause an exception. I'm not sure if non-support for ARM
> code is a feature in newer ARM cores; I'll ask around. FPC, as of now
> doesn't support Thumb-2 with hard FP.

I don't have a Windows Phone 8 device, so I can't test. But as FPC is in 
theory capable of generating Thumb code it should be "just" a matter of 
wiring the correct settings together inside the compiler for a winrt target.

> For the record, the native subsystem of Windows RT (AKA Windows 8 for ARM)
> and that of Windows Phone 8 are not identical - there's no binary
> compatibility.

They are API compatible (though WP8 is a subset of WRT). In how far they 
could really be treated as one target needs to be seen. At first I would 
nevertheless implement i386/x86_64-winrt, because that will lay the API 
ground work which all winrt/wp8 platforms will share and is far easier 
to debug than WP8.

Regards,
Sven



More information about the fpc-devel mailing list