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

2010-11-05 Thread Bo Berglund
On Fri, 05 Nov 2010 11:07:55 +0100, Bo Berglund wrote: >On Wed, 03 Nov 2010 10:50:10 +0100, Thomas Schatzl > wrote: > >>Coming back to the suggestion from jonas: >> >>function BEtoN(const AValue : single) : single; >>type >> TData = packed record >>case integer of >> 0 : (s : single); >

[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 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 > d.s :

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 wrote: > On Tue, 02 Nov 2010 22:53:21 +0100, Vinzent Höfler > wrote: > >>On Tue, 02 Nov 2010 21:39:31 +0100, Felipe Monteiro de Carvalho >> wrote: >> >>> On Tue, Nov 2, 2010 at 7:04 PM, Bo Berglund >>> wrote: Thanks, that helps a lot

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 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.

[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 wrote: >On Tue, 02 Nov 2010 21:39:31 +0100, Felipe Monteiro de Carvalho > wrote: > >> On Tue, Nov 2, 2010 at 7:04 PM, Bo Berglund >> wrote: >>> Thanks, that helps a lot! Are there also overloaded BEtoN functions >>> for floating point values

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 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. That's i

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 wrote: On Tue, Nov 2, 2010 at 7:04 PM, Bo Berglund 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. Mo

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 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 ___

[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 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 Linux on

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 http://en.wikiped

[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 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 semantics to deal wit