[fpc-pascal] x86 asm bswap

Juha Manninen juha.manninen62 at gmail.com
Wed Feb 6 10:58:36 CET 2013

On Wed, Feb 6, 2013 at 10:40 AM, Vincent Snijders
<vincent.snijders at gmail.com> wrote:
> 2013/2/6 Juha Manninen <juha.manninen62 at gmail.com>:
>> I read that bswap is used for converting big-endian (Intel) format to
>> little-endian (Motorolla etc.) format.
>> However this a an old Delphi app, Win32 only.
> I am confused. Intel i386 is little endian. Motorola Powerpc is big endian.

I copied it from here:

I think the author was confused. I am always confused, too, because
the big/little endian thing is named wrong IMO.
In human readable numbers, reading from left to right, big numbers
(MSB) come first and little numbers (LSB) last.
In essense it is a "little endian" notation as it ends with little numbers.
Motorola 68000 and others use the same logic (MSB - LSB) but for some
reason it is called " big endian" while Intel which has it upside
down, is called "little endian".
IIRC the names refer to memory layout, how those registers are written
to memory.

Anyway, I am confused but it does not matter because there are
functions made by someone else and I don't need to think of the
details. :)


More information about the fpc-pascal mailing list