It is currently Fri Dec 06, 2019 2:13 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Little Endian Big Endian?
PostPosted: Sun Oct 30, 2005 9:18 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 13, 2005 11:45 pm
Posts: 1017
Location: Germany
Ok Mac OS X is Big Endian and Windows is little Endian so what problems to fear when doing a Filetransfer system based on PBs Network libary communicating between Mac OS X and Windows? (All Apps in PB)
bye Nik

_________________
Visit www.sceneproject.org


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 31, 2005 11:17 am 
Offline
Always Here
Always Here

Joined: Mon Sep 22, 2003 6:45 pm
Posts: 7439
Location: Norway
Nothing, I think.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 31, 2005 11:22 am 
Offline
Moderator
Moderator

Joined: Sat Dec 27, 2003 3:55 am
Posts: 3321
Location: Great Southern Land
I think the actual transfer won't mess with the byte sequence. So the issue, if anything, will be the "endian-ness" of the source data, as this will be retained and therefore either has to be fixed before or after transfer.

But I am guessing.

_________________
@}--`--,-- A rose by any other name ..


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 31, 2005 11:56 am 
Offline
Addict
Addict
User avatar

Joined: Fri May 13, 2005 11:45 pm
Posts: 1017
Location: Germany
If you also have to send the length of the content i would have to make sure that for example both sides use little endain.
Right?

_________________
Visit www.sceneproject.org


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 31, 2005 1:12 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13638
Location: France
Yes, it's true. I don't think it will work for now, i will fix that ASAP.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 31, 2005 2:50 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 13, 2005 11:45 pm
Posts: 1017
Location: Germany
What do you mean it ins't working now? No function for conversion or no network support :wink:

_________________
Visit www.sceneproject.org


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 31, 2005 4:06 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 13, 2005 11:45 pm
Posts: 1017
Location: Germany
Code:
Procedure LittleToBig(Long.l)
  PokeB(@LongBig+2,PeekB(@Long+3))
  PokeB(@LongBig+3,PeekB(@Long+2))
  PokeB(@LongBig,PeekB(@Long+1))
  PokeB(@LongBig+1,PeekB(@Long))
ProcedureReturn LongBig.l
EndProcedure


Is this correct?
I also noticed that 'UNIX' is not the same as PokeS(@Address,"UNIX") Why?
And thats te point that makes us think that it should be called XINU Problem instead of NUXI Problem *confused*

_________________
Visit www.sceneproject.org


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 31, 2005 7:57 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1797
Location: Pas-de-Calais, France
A little code used for a value from a file...
Code:
nb.l=ReadLong()
MOV eax,nb
BSWAP eax
MOV nb,eax


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 01, 2005 1:22 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 13, 2005 11:45 pm
Posts: 1017
Location: Germany
Well it musst be correct but
Code:

nb.l=0
PokeS(@nb,"UNIX",4)
MOV eax,nb
BSWAP eax
MOV nb,eax

Debug PeekS(@nb,4)


Debuges XINU and it's called the NUXI Problem so wtf

_________________
Visit www.sceneproject.org


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 01, 2005 2:04 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1797
Location: Pas-de-Calais, France
Sorry, I don't understand. :?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 01, 2005 2:29 pm 
Offline
Moderator
Moderator

Joined: Sat Dec 27, 2003 3:55 am
Posts: 3321
Location: Great Southern Land
Not 100% sure what we are getting at here, but ...

"UNIX" is 4 bytes long, respresenting here, I think, a 4 byte integer?

XINU is how a 4 byte (long) reversal would appear
NUXI is how 2x2 byte (words) reversal would appear.

Also, are you reversing all data sent one side to the other? I think (stress, think) you would only need to reverse words/longs where those were stored as words/longs in the original data.

So
>> [long]+"ABC"+[word]+[word]+[byte] - or - [1234]ABC[12][34][1]
would go across as
>> [gnol]+"ABC"+[drow]+[drow]+[byte] - or - [4321]ABC[21][43][1]


If you are sending "UNIX" and then, on fixing it on the other side, you are ending up with "XINU" then you don't need to be fixing it.

If you are ending up with "NUXI" (unfixed) on other side, need to be fixing word reversals.

If you are ending up with "XINU" (unfixed) on other side, need to be fixing long reversals.

But I am not really sure what it is that we are talking about. :D What exactly are we trying to address? What are you getting on the "other side"?

_________________
@}--`--,-- A rose by any other name ..


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 01, 2005 2:50 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 13, 2005 11:45 pm
Posts: 1017
Location: Germany
It was a theoretical Problem :lol: Haven't got a Mac yet but was interested in it and maybe it was good because it seems like it reminded fred at something :lol:
Well maybe I can get my Hands on a Mac then I will test this Theorey in practice. But nice to know how the made this NUXI problem up. Because who the hell would stroe a 4 byte String in 2 words :oops:
Thanks a lot for your efford

_________________
Visit www.sceneproject.org


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 01, 2005 3:00 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1797
Location: Pas-de-Calais, France
In theory, no. For more details:
http://en.wikipedia.org/wiki/Endian


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye