Differences in output from hexdump and hexedit

716 views Asked by At

I have been experimenting in arm assembly, and looking at the hexedecimal output produced by the assembler. Now when I assembled this:

.byte 0xff
.word 0x11111111

I was expecting an output of ff11 1111 11 but looking at in hexdump showed me this: 11ff 1111 0011 at first I was confused, and thought maybe I had discovered some obscurity in my assembler (obviously I have not used the .align directive here, so this code would be incorrect in a real-life usage, and I thought the assembler might be doing something weird because of this). However when I went and checked the output using the program hexedit (if you are unfamiliar with this it is just a simple command line hexeditor), and it showed me what I expected (ff 11 11 11 11). Does anyone know why I am receiving this odd output? Is this a bug in hexdump, or does hexdump not behave like I am expecting it to for some other reason?

1

There are 1 answers

0
vzhilin On BEST ANSWER

Hexdump show content ff11 as 11ff because of little-endian byte order.