What is endianism? How to determine machine endianism on Unix ?

What is endianism ?
In other way - What is the byte order of your machine ?
Or in some other way How do u convert the byte order on your UNIX machine ?

Endianism is nothing but the described byte order in ur machine memory, it is of 2 types one is Little and other is Big-Endianism.
simply - ordering of bytes to store a particular data inside ur computer memory

Little Endian means that the lower order byte of the number is stored in memory at the lowest address, and the higher order byte is stored at the highest address. That is, the little end comes first.

For example, a 4 byte, 32-bit integer
Byte3 Byte2 Byte1 Byte0
will be arranged in memory as follows:

Base_Address+0 Byte0
Base_Address+1 Byte1
Base_Address+2 Byte2
Base_Address+3 Byte3

Intel processors use "Little Endian" byte order.


Big Endian means that the higher order byte of the number is stored in memory at the lowest address, and the lower order byte at the highest address. The big end comes first.

Base_Address+0 Byte3
Base_Address+1 Byte2
Base_Address+2 Byte1
Base_Address+3 Byte0

Motorola, Solaris processors use "Big Endian" byte order.

So now How to decide the byte order in ur machine?
here is the Solaris command for you to decide that !

echo abcd | od -t xS

A little-endian machine would output:

0000000 6261 6463 000a

while a big-endian machine would output:
0000000 6162 6364 0a00

Hope this helps - if u come to any other ways please comment it here.

where is od installed on Solaris ?
bash $ which od
/usr/bin/od

Related reference : [1][2][3][4]


0 comments to "What is endianism? How to determine machine endianism on Unix ?"

Post a Comment

Whoever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs, u can at least use Name/URL option which doesn’t even require any sign-in, The good thing is that it can accept your lovely nick name also and the URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")

Popular Posts

Enter your email address:

Buffs ...

Tags


Powered by WidgetsForFree

Archives