On Mon, 19 Oct 2015 15:32:00 +0200, Jonas Maebe
wrote:
>
>Bo Berglund wrote on Mon, 19 Oct 2015:
>
>> Is there a function or such to interrogate the byte order of the
>> platform FPC runs on? So that I could add a test at the start of
>> download to check if swapping is needed?
>
>Use the http://
Am 19.10.2015 16:23 schrieb "Bo Berglund" :
>
> On Mon, 19 Oct 2015 15:30:36 +0200 (CEST), Michael Van Canneyt
> wrote:
>
> >There are compiler defines that give you the endianness.
> >{$IFDEF ENDIAN_BIG}
> >{$IFDEF ENDIAN_LITTLE}
> >
> >And
> >{$IFDEF FPC_LITTLE_ENDIAN}
> >{$IFDEF FPC_BIG_ENDIAN}
On Mon, 19 Oct 2015 15:30:36 +0200 (CEST), Michael Van Canneyt
wrote:
>There are compiler defines that give you the endianness.
>{$IFDEF ENDIAN_BIG}
>{$IFDEF ENDIAN_LITTLE}
>
>And
>{$IFDEF FPC_LITTLE_ENDIAN}
>{$IFDEF FPC_BIG_ENDIAN}
Good, that would probably be what I need. Thanks!
Example:
pro
Hi,
On Mon, 19 Oct 2015, Jonas Maebe wrote:
> Bo Berglund wrote on Mon, 19 Oct 2015:
>
> > Is there a function or such to interrogate the byte order of the
> > platform FPC runs on? So that I could add a test at the start of
> > download to check if swapping is needed?
>
> Use the http://www.free
Hi,
On Mon, 19 Oct 2015, Bo Berglund wrote:
> I am making a control program for a data collection system using FPC +
> Lazarus on a Raspberry Pi2 platform. I will use a number of Delphi
> units, which implement the communications and data handling needs in a
> way that works fine on a Windows pla
Bo Berglund wrote on Mon, 19 Oct 2015:
Is there a function or such to interrogate the byte order of the
platform FPC runs on? So that I could add a test at the start of
download to check if swapping is needed?
Use the http://www.freepascal.org/docs-html/rtl/system/ntobe.html
function and yo
On Mon, 19 Oct 2015, Bo Berglund wrote:
I am making a control program for a data collection system using FPC +
Lazarus on a Raspberry Pi2 platform. I will use a number of Delphi
units, which implement the communications and data handling needs in a
way that works fine on a Windows platform.
W
I am making a control program for a data collection system using FPC +
Lazarus on a Raspberry Pi2 platform. I will use a number of Delphi
units, which implement the communications and data handling needs in a
way that works fine on a Windows platform.
While looking over existing code I see that th
>> > If not, how can I determine the current processor byte order?
>>
>> {$ifdef FPC_BIG_ENDIAN}
>> {$ifdef FPC_LITTLE_ENDIAN}
>
> Thanks.
Oops... this was 1.1 only. For 1.0.x (and still supported by 1.1, but
deprecated) it is ENDIAN_LITTLE and ENDIAN_BIG
___
On Fri, 4 Jul 2003 11:42:59 +0200 (CEST)
"Peter Vreman" <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I need to read 2, 4 or 8 bytes in a processor independent way. For
> > example:
> > I have 4 bytes ($12 $34 $56 $78), starting with the most signifikant
> > (like the 68k processor). Reading a DWord
The word you are looking for is 'Big Endian'. Have a google on 'Big Endian'
and 'Little Endian' on google.
this is a delphi routine, it may not work in FPC, certainly I would try it
first in Delphi compatibility mode, and with Intel style assembler syntax:
function Swap32(value : dword) : dword
> Hi,
>
> I need to read 2, 4 or 8 bytes in a processor independent way. For
> example:
> I have 4 bytes ($12 $34 $56 $78), starting with the most signifikant (like
> the 68k processor). Reading a DWord under i386 swaps the bytes
> ($78563412).
> Is there a fast way/procedure to read a word/dword/q
Hi,
I need to read 2, 4 or 8 bytes in a processor independent way. For example:
I have 4 bytes ($12 $34 $56 $78), starting with the most signifikant (like
the 68k processor). Reading a DWord under i386 swaps the bytes ($78563412).
Is there a fast way/procedure to read a word/dword/qword independen
13 matches
Mail list logo