Created
December 28, 2010 17:10
-
-
Save luelista/757423 to your computer and use it in GitHub Desktop.
prints IBM hex files in a formatted way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/perl | |
# view_hexfile.pl | |
# prints IBM hex files in a formatted way | |
# Max Weller, http://max-weller.de | |
while(<>) { | |
if($_=~/^\s*:([A-F0-9]+)\s*$/) { | |
my @data = unpack("(A2)*", $1); | |
print $_," " for (@data); | |
print " | "; | |
for(@data) { | |
my $d = hex; | |
print ($d<32||$d>128?".":chr $d)," "; | |
} | |
print "\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment