PDA

View Full Version : HELP... CPU instructions, Little-Endian or Big-Endian?


psycho_cyclone
November 23rd, 2003, 00:24
please help,
i'm writing a PS2 emu and i just came to the part of interpreting CPU instructions, i want to extract, for instance, the opcode num from the instruction set, BUT:
should i treat the instruction as Little-Endian byte order, or Big-Endian?
i mean, for instance, is the opcode in the FIRST byte in the ELF file, or in the FOURTH one???
PLEASE help me out! thanx.

Chrono Archangel
November 23rd, 2003, 03:07
psycho_cyclone this is just a little advice. you would probably have better luck asking these kind of questions directly to an emu author. most authors dont visit the board (there are some exceptions of course) and you would probably get a faster answer by contacting via email an author :)

bcrew1375
November 23rd, 2003, 03:25
I saw on a site somewhere that the PS2 has the same endianness(is that a word?) as the PC. If that's true, it would of course be little endian.

zenogais
November 23rd, 2003, 03:29
These questions really should be simple to find out, just look around for documentation. Also I'm fairly certain that it is little-endian byte order, meaning no byte-order conversion need be done.

bcrew1375
November 24th, 2003, 22:27
Hmm, zenogais, excuse me if I sound stupid, but I thought little-endian was having the higher bytes after the low bytes. Wouldn't it be big-endian that needs no conversion? Again, excuse me if I sound stupid, I'm no expert. :lol:

GiGaHeRz
November 25th, 2003, 00:02
Hmm, zenogais, excuse me if I sound stupid, but I thought little-endian was having the higher bytes after the low bytes. Wouldn't it be big-endian that needs no conversion? Again, excuse me if I sound stupid, I'm no expert. :lol:
PCs are little endian ;)