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

Hein RMS van den Heuvel heinvandenheuvel at gmail.com
Fri Jul 23 07:36:22 EDT 2021


On Thursday, July 22, 2021 at 11:03:02 PM UTC-4, Hein RMS van den Heuvel wrote:
> 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 
:
> In the mean time, as a workaround, I offer this PERL script. 

When I wrote the Perl script last night, I initially though I could simply use a string match for a space followed by 8 hex characters or a spaces to find the hex 'words'  / [ 0-9A-F]{8}/ and with that use Perl's special powers.
However I soon realized it could over-reach into the 'text' area of dump line and needed to length or occurrence control it.
After I submitted I realized that at that point you might just as well use the length to chop the line up.
This could also easily be done in DCL, albeit not so fast.
Here is another version.
It's just silliness - but I can't rest until it's fixed. :-) :-)

use strict;
use warnings;
my $space = q( );
while (<>) { # walk the lines
	if (/^$space/){  # looks like actual dump data line: space at start of line?
		my $len = (length > 72) ? 72 : 36; # wide or narrow dump?
		my $txt = substr($_, $len );
		my ($hex, $xeh);
		while ($len)  {
			$len -= 9;
			$hex = substr ($_, $len, 9); # grab the space and next 8 characters
			$xeh .= $space . substr($hex,7,2) . substr($hex,5,2) . substr($hex,3,2) . substr($hex,1,2);
			}
		$_ = $xeh . $txt; # reconstruct the line
	}
	print $_; # print the (result) line
}


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



More information about the Info-vax mailing list