What's new

Is the SPC700 big or little endian?

OP
Toasty

Toasty

Sony battery
BGNG said:
I believe it's big-endian, but don't hold me to that.
That's what I thought too, but the docs on the instruction set have me a little confused - this one inparticular:

Code:
MOV    A, (dp+X)  E7    2[bytes]     6[cycles]     A <- ((dp+X+1)(dp+X))     N......Z

(This is just describing the E7 version of the MOV instruction.) What confuses me is that dp+X+1 is written before dp+X, implying that the MSB is the second byte in memory, not the first (which of course would mean little-endian). Anybody know what's what here?
 

BGNG

New member
Well, the ((dp+X+1)(dp+X)) is transferring to the Accumulator, which would imply that whatever byte ordering the data is stored as is the inverse of the byte ordering the processor uses. So if the SPC data is big-endian, according to this instruction, then the processor uses little-endian.
 

BGNG

New member
Depends on the processor. I've not done research on the SPC chip. But I would say the SPC file data is stored in big-endian... but again, I'm not sure.

Try it out. One will work and one won't. That's an easy way to tell.
 
OP
Toasty

Toasty

Sony battery
BGNG said:
Try it out. One will work and one won't. That's an easy way to tell.
Good point. (After all I have an inline function that does all the 16-bit memory reads. If it turns out wrong I only have to change a couple lines of code. :p) Thanks for the suggestion.
 

Doomulation

?????????????????????????
Hmm yes, endianess is very easy to detect in c/c++. Just a few lines of code. Good luck on your project.
 

Top