Is anyone here familiar with hex conversion? I'm practicing and just converted the ASCII string MEMES to hex by hand and got 0x454d454d53
I tested with an online ASCII to hex converter and it came out EMEMS
I have a feeling it's something to do with "endiness" - if so I was hoping someone could enlighten me. The wiki article on it isn't compatible with my brain right now
You can tell the sequence of letters by reading the hex characters in pairs, dummy.
The bytes are in reverse order in a word
>>58974361
yeah I know e.g. 4D = M, but I don't want to memorize all that. I've already got A-Za-z ASCII memorized and of course 10-15 hex is A-F. Obviously I"ll have a conversion chart on hand for any "real world" situations, I'm just doing this for learning purposes. Do you have the pairs of 2 hex to ASCII conversions memorized?
>>58974364
wait so why isn't S first then? SEMEM instead of EMEMS
>>58974344
>I have a feeling it's something to do with "endiness"
Endianness? It might, yes. Explain how you got that 0x454d454d53, please.
>>58974467
Using:
M = 77 ASCII
E = 69 ASCII
S = 83 ASCII
I converted each ASCII number to binary, then split the bytes in half (nibbles) then converted each nibble to a hex symbol. Then wrote the hex number in order e.g.
M (45) E (4D) M(45) E(4d) S(83)
but online ASCII to hex converters have it being
4D 45 4D 45 83 instead
Intel arch is little-endian which means it stores numbers like 0x11223344 as 0x44332211. It seems counter-intuitive at first but it makes addressing easier. Say if you want the low byte you can just use the same address [n] whereas on big-endian systems you need to shift the address manually to [n+3].
>>58974531
How do you get 0x45 for M? 77 is 0x4d. 69 is 0x45.
Your problem does not appear to have anything to do with endianness, despite superficially looking like that.
>>58974617
AH! I know what I did wrong now, thanks. I messed up my bits:
Was doing M as (69)
0100 0101
instead of M as (77)
0100 1101
and doing E as (77)
0100 1101
instead of E as (69)
0100 0101
I shouldn't known since EMEMS just looks like the 2 characters are reversed