microsoft / vscode-hexeditor

VS Code Hex Editor
https://marketplace.visualstudio.com/items?itemName=ms-vscode.hexeditor
MIT License
532 stars 89 forks source link

Adding a mode to dump from right to left #151

Open hirooih opened 4 years ago

hirooih commented 4 years ago

Thank you for your great extension.

Please consider to add a mode to dump from right to left.

From: DAV's Endian FAQ (a famous article on comp.arch):

From: John R Pierce <pierce at diamondmm.com>
Cc: "'pci-sig at znyx.com'" <pci-sig at znyx.com>
Subject: RE: Big Endian question
Date: Thu, 25 Jan 1996 14:51:14 -0800
...

Ya know that article misses one 'cute' tweak that DEC was doing with the
VAX to resolve the
'backwardness' of ascii printed in little-endian words...  They did their
HEX dumps with
byte 0 on the right, but the *-A-x-xxx-A-* stuff on the right was left to
right....  They put the address between the two.  This way words and dwords
read l-r, and you could read the ascii too...

 F E D C  B A 9 8  7 6 5 4  3 2 1 0    -ADDR-   0123456789ABCDEF
504F4E4D 4C4B4A49 48474645 44434241   00230040 *ABCEDFGHIJKLMNOP*
706F6E6D 6C6B6A69 68676665 64636261   00230050 *abcdefghijklmnop*

It took a little getting used to (about 5 minutes ;)

This helps little-endian users and can be another solution for #44.

tommai78101 commented 4 years ago

Oooh, reversed byte groups. This may also help with reading Big Endian UTF-16BE characters too.