Digital
Digital copied to clipboard
Little vs Big Endian with 8 bits memory.
with intel hex file :0400000072746E4563 :0400040075207A6584
If data are 32 bits (big endian) memory load correctly that mean 0x72746E4563 and 75207A6584. Your change work perfectly
If data are 8 bits (and big endian) memory load incorrectly that mean 0x72,0x74,0x6E,0x45,0x63... According hex file 0x63 is for lower memory and is 0x72 for highter memory
Thank
In such a case, when loading a file, it must be specified how many bytes should make up a data word, because if you map bytes to bytes, endiness makes no sense otherwise.
Just to give you more details
.data msg : .asciiz "Entrez chaine:\n" msg2 : .asciiz "Chaine lue:\n"
is translate in hex file :0400000072746E4563 => 'r',t','n','E' :0400040063207A6596 etc....
Data are 8 bits, but as it is big endian string char are reversed.
A simple solution is inverting (not) two LSB bits of address
