Click here to Skip to main content
16,007,885 members
Home / Discussions / C#
   

C#

 
AnswerRe: Endian Pin
Luc Pattyn31-May-07 9:41
sitebuilderLuc Pattyn31-May-07 9:41 
GeneralRe: Endian Pin
lost in transition 31-May-07 9:51
lost in transition 31-May-07 9:51 
GeneralRe: Endian Pin
Luc Pattyn31-May-07 10:03
sitebuilderLuc Pattyn31-May-07 10:03 
GeneralRe: Endian Pin
lost in transition 31-May-07 10:21
lost in transition 31-May-07 10:21 
GeneralRe: Endian Pin
Luc Pattyn31-May-07 10:51
sitebuilderLuc Pattyn31-May-07 10:51 
GeneralRe: Endian Pin
lost in transition 31-May-07 11:47
lost in transition 31-May-07 11:47 
GeneralRe: Endian Pin
Luc Pattyn31-May-07 12:00
sitebuilderLuc Pattyn31-May-07 12:00 
GeneralRe: Endian Pin
lost in transition 1-Jun-07 4:58
lost in transition 1-Jun-07 4:58 
Okay, its a new day lets look at this again.

using hex 0x12345678 = 305419896 that
gives us an array of bytes:
Byte: 120
Byte: 86
Byte: 52
Byte: 18

(If I am thinking correctly)Switching this from little endian to big endian
we would need to basically reverse the order of the bytes:
Byte: 18
Byte: 52
Byte: 86
Byte: 120
which is hex 0x78563412 = 2018915346

val = (val >> 8) | (val << 8) gives us:
Byte: 86
Byte: 124
Byte: 86
Byte: 52
which is hex 0x34567C56 = 878083158

Using your -val = (val >> 8) | (val << 8)- we are shifting bits, but I didn't think that is what
the problem is. For assumption was that big and little endian determined which way the bytes were
laid out. For example: 0x12345678 has 4 bytes(32-bits)-bytes:Z=120,Y=86,X=52,W=18. Now this is in
little endian basically because this machine uses little endian. Or in other words the bytes are read right to left in a least to greatest manner. Say that big endian is the opposite, then big read left to right in a least to greatest manner also. Big endian byte arrangement to 0x12345678 would be: W=18, X=52, Y=86, Z=120.

I am questioning things not to be a pain, but to make sure I understand. It seems to me that your are trying to shift bits when what is need is the bytes' order to be reversed. Yes/NoConfused | :confused:


God Bless,
Jason

DavidCrow wrote:
It would not affect me or my family one iota. My wife and I are in charge of when the tv is on, and what it displays.
I do not need any external input for that.

GeneralRe: Endian Pin
Luc Pattyn1-Jun-07 6:14
sitebuilderLuc Pattyn1-Jun-07 6:14 
GeneralRe: Endian Pin
lost in transition 1-Jun-07 8:52
lost in transition 1-Jun-07 8:52 
GeneralRe: Endian Pin
Luc Pattyn1-Jun-07 10:08
sitebuilderLuc Pattyn1-Jun-07 10:08 
GeneralRe: Endian Pin
lost in transition 31-May-07 11:52
lost in transition 31-May-07 11:52 
GeneralRe: Endian Pin
Luc Pattyn31-May-07 12:05
sitebuilderLuc Pattyn31-May-07 12:05 
AnswerRe: Endian Pin
lost in transition 31-May-07 9:43
lost in transition 31-May-07 9:43 
QuestionPlease Help: ClickOnce Technology Pin
salman_syed_0131-May-07 4:14
salman_syed_0131-May-07 4:14 
AnswerPlease do not double post Pin
leckey31-May-07 4:38
leckey31-May-07 4:38 
AnswerRe: Please Help: ClickOnce Technology Pin
mikker_1232-Jun-07 17:08
mikker_1232-Jun-07 17:08 
QuestionLog4 Net SMS Appender Pin
Cape Town Developer31-May-07 4:04
Cape Town Developer31-May-07 4:04 
AnswerRe: Log4 Net SMS Appender Pin
Cape Town Developer31-May-07 20:48
Cape Town Developer31-May-07 20:48 
AnswerRe: Log4 Net SMS Appender Pin
Cape Town Developer31-May-07 20:54
Cape Town Developer31-May-07 20:54 
QuestionPlease Help Me: ClickOnce Technology Pin
salman_syed_0131-May-07 4:02
salman_syed_0131-May-07 4:02 
Questionremove the datagridview "pointer" Pin
FernandoMartin31-May-07 3:54
FernandoMartin31-May-07 3:54 
AnswerRe: remove the datagridview "pointer" Pin
Not Active31-May-07 5:22
mentorNot Active31-May-07 5:22 
GeneralRe: remove the datagridview "pointer" Pin
FernandoMartin31-May-07 5:31
FernandoMartin31-May-07 5:31 
AnswerRe: remove the datagridview "pointer" Pin
Tarakeshwar Reddy31-May-07 6:44
professionalTarakeshwar Reddy31-May-07 6:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.