[fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-05 Thread Bo Berglund
On Wed, 03 Nov 2010 10:50:10 +0100, Thomas Schatzl tom_at_w...@gmx.at wrote: Coming back to the suggestion from jonas: function BEtoN(const AValue : single) : single; type TData = packed record case integer of 0 : (s : single); 1 : (l : longint); end; var d : TData; begin

Re: [fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-03 Thread Bernd Mueller
Jonas Maebe wrote: On 02 Nov 2010, at 21:39, Felipe Monteiro de Carvalho wrote: On Tue, Nov 2, 2010 at 7:04 PM, Bo Berglund bo.bergl...@gmail.com wrote: Thanks, that helps a lot! Are there also overloaded BEtoN functions for floating point values? I think that single and double have always

Re: [fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-03 Thread Thomas Schatzl
Hi, On Tue, 02 Nov 2010 23:49:03 +0100, Bo Berglund bo.bergl...@gmail.com wrote: On Tue, 02 Nov 2010 22:53:21 +0100, Vinzent Höfler jellyfish.softw...@gmx.net wrote: On Tue, 02 Nov 2010 21:39:31 +0100, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: On Tue, Nov 2,

[fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-02 Thread Bo Berglund
On Tue, 02 Nov 2010 09:09:05 +0100, Bo Berglund bo.bergl...@gmail.com wrote: OK, I see that there are functions to convert a known BE or LE integer value to the *native* order. This would in principle work across all platforms where FPC is implemented so that is good news! However now I have the

Re: [fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-02 Thread Jonas Maebe
On 02 Nov 2010, at 12:41, Bo Berglund wrote: The end to me is the last (the right-most) byte. And that is the LSB. So the end is LSB, the little part... Little endian means the little end comes first (with the little end referring to the least significant byte). See

[fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-02 Thread Bo Berglund
On Tue, 02 Nov 2010 09:32:36 +0100, Thomas Schatzl tom_at_w...@gmx.at wrote: Hi, Or maybe this is a moot question if FPC is only so far running on platforms that have the same endian as x86 CPU:s? I have no information on this though... I can see at least these targets: - Windows and

Re: [fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-02 Thread Felipe Monteiro de Carvalho
On Tue, Nov 2, 2010 at 7:04 PM, Bo Berglund bo.bergl...@gmail.com wrote: Thanks, that helps a lot! Are there also overloaded BEtoN functions for floating point values? I think that single and double have always the same binary layout. -- Felipe Monteiro de Carvalho

Re: [fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-02 Thread Vinzent Höfler
On Tue, 02 Nov 2010 21:39:31 +0100, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: On Tue, Nov 2, 2010 at 7:04 PM, Bo Berglund bo.bergl...@gmail.com wrote: Thanks, that helps a lot! Are there also overloaded BEtoN functions for floating point values? I think that

Re: [fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-02 Thread Jonas Maebe
On 02 Nov 2010, at 21:39, Felipe Monteiro de Carvalho wrote: On Tue, Nov 2, 2010 at 7:04 PM, Bo Berglund bo.bergl...@gmail.com wrote: Thanks, that helps a lot! Are there also overloaded BEtoN functions for floating point values? I think that single and double have always the same binary

[fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-02 Thread Bo Berglund
On Tue, 02 Nov 2010 22:53:21 +0100, Vinzent Höfler jellyfish.softw...@gmx.net wrote: On Tue, 02 Nov 2010 21:39:31 +0100, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: On Tue, Nov 2, 2010 at 7:04 PM, Bo Berglund bo.bergl...@gmail.com wrote: Thanks, that helps a lot!