|
|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1920 (0x780)
Types: TextFile
Names: »HEXDUMP.PAS«
└─⟦42acf21c3⟧ Bits:30005716 PolyPascal-80 v. 3.10 (RC703)
└─⟦this⟧ »HEXDUMP.PAS«
└─⟦6367c43c0⟧ Bits:30004325 PolyPascal vers. 3.10 for Butler
└─⟦this⟧ »HEXDUMP.PAS«
└─⟦725a95225⟧ Bits:30003287 PolyPascal v. 3.10 med eksempler for RC700
└─⟦this⟧ »HEXDUMP.PAS«
└─⟦f03928158⟧ Bits:30005922 PolyPascal 3.10 (RC700)
└─⟦this⟧ »HEXDUMP.PAS«
└─⟦fff6648c2⟧ Bits:30004194/disk3.imd Data i Folkeskolen (Comet)
└─⟦this⟧ »HEXDUMP.PAS«
PROGRAM hexdump; æ$A+,R-,S+å
æ This program will output a hex dump af any disk file. Each å
æ line shows the address of the first byte of the line, then 16 å
æ bytes in hex, and then the same bytes in ASCII, if they are å
æ printable. On running the program, you must specify the name å
æ of the file to be dumped, and the name of the file or logical å
æ device (CON:, LST:, etc.), which is to receive the dump. å
TYPE
sector = ARRAYÆ0..7,0..15Å OF byte;
hexstring = STRINGÆ4Å;
filename = STRINGÆ14Å;
VAR
address,l,p,i,j,n: integer;
ch: char;
inname,outname: filename;
buffer: sector;
infile: FILE;
outfile: text;
FUNCTION hex(number,digits: integer): hexstring;
CONST
hexdigit: ARRAYÆ0..15Å OF char = '0123456789ABCDEF';
VAR
d: integer;
h: hexstring;
BEGIN
hÆ0Å:=chr(digits);
FOR d:=digits DOWNTO 1 DO
BEGIN
hÆdÅ:=hexdigitÆnumber AND 15Å;
number:=number SHR 4;
END;
hex:=h;
END;
BEGIN
write('Input file name? '); readln(inname);
IF inname='' THEN halt;
write('Output file name? '); readln(outname);
IF outname='' THEN halt;
assign(infile,inname); æ$I-å reset(infile) æ$I+å;
IF iores>0 THEN
BEGIN
writeln(inname,' does not exist'); halt;
END;
assign(outfile,outname); rewrite(outfile);
address:=0;
REPEAT
blockread(infile,buffer,1,n);
IF n<>0 THEN
FOR l:=0 TO 7 DO
BEGIN
write(outfile,hex(address,4),' ');
FOR p:=0 TO 15 DO
BEGIN
IF p=8 THEN write(outfile,' ');
write(outfile,hex(bufferÆl,pÅ,2):3);
END;
write(outfile,' ');
FOR p:=0 TO 15 DO
BEGIN
ch:=chr(bufferÆl,pÅ);
IF (ch>=@32) AND (ch<=@126) THEN
write(outfile,ch) ELSE write(outfile,'.');
END;
writeln(outfile);
address:=address+16;
END;
UNTIL n=0;
close(infile); close(outfile);
END.
«eof»