vavrdisasm icon indicating copy to clipboard operation
vavrdisasm copied to clipboard

hex output backwards

Open petesoper opened this issue 7 years ago • 1 comments
trafficstars

While I'm at it, I should also point out that for a two word instruction like jmp or call, the hex output for each word is in a peculiar order. That is, if the instruction is "jmp 0x1234" we see this: 0: 00 5d 94 0c jmp 0x005d instead of this: 0: 94 0c 00 5d jmp 0x005d or this (reality): 0: 0c 94 5d 00 jmp 0x005d The target word address clearly isn't in memory at the address implied by this output: it's in the following word. The instruction word is positively, absolutely at address zero. Again, I can get along with this OK, it's just another impedance bump that makes me have to swap the words to make sense out of what I'm looking at. If I find myself using this disassembler a lot I'll probably submit pull requests for these and any similar issues, assuming making the changes are straight forward. Best Regards, Pete

petesoper avatar Dec 20 '17 00:12 petesoper

Honestly, I forgot the original rationale behind formatting it this way. Today, I would be inclined to format bytes as they appear in binary, with an optional argument to show them as little endian words. In terms of your examples, the two forms:

0: 0c 94 5d 00  jmp 0x005d
0: 940c 005d    jmp 0x005d

I think that would offer a useful choice between reality and readability.

Sure, pull requests are always welcome.

vsergeev avatar Apr 06 '18 06:04 vsergeev