[Info-vax] Hex display order option for DUMP ?

Hein RMS van den Heuvel heinvandenheuvel at gmail.com
Thu Jul 22 23:03:00 EDT 2021


On Thursday, July 22, 2021 at 4:11:09 PM UTC-4, Simon Clubley wrote:
> Can we please have an option in DUMP to display the hex values from 
> left to right (instead of from right to left), just like every other 
> hex dump program I have used does ? 

You can't take that away, it makes us so special!

Yes, Seems like a reasonable request to me.

In the mean time, as a workaround, I offer this PERL script.


use strict;
use warnings;
my $space = q( );
while (<>) {
	if (/^$space/){  # looks like actual dump data line: space at start of line?
		my $len = (length > 72) ? 72 : 36; # wide or narrow dump?
		my $hex = substr($_, 0, $len);
		my $txt = substr($_, $len );
		my $xeh;
		my @hex = ($hex =~ / [ 0-9A-F]{8}/g ); # match words 8 HEX chars or spaces lead by a space.
		for my $hex (reverse @hex) { # loop over each word reversing the nibbles glueing into result.
			$xeh .= substr($hex,7,2) . substr($hex,5,2) . substr($hex,3,2) . substr($hex,1,2) . $space;
		}
		$_ = $space . $xeh . $txt; # reconstruct the line
	}
	print; # the line
}

Use as : perl reverse_hex_in_dump.pl input.dmp [ > output.txt ]
Enjoy,
Hein



More information about the Info-vax mailing list