label
no_str, no_file;
var
fi:text;
fo:file;
i,j,k:integer;
dat:array [0..3] of byte;
s,sn:string;
ch:char;
begin
assign(fi,'micro');
reset(fi);
if IOresult<>0 then goto no_file;
i:=0;
while (not EoF(fi)) do
begin
s:='';
repeat
read(fi,ch);
s:=s+ch;
until ((ord(ch)=$0A) or EoF(fi));
if s='' then goto no_str;
if ((s[1]='/') and (s[2]='*')) then
begin
if i<>0 then close(fo);
str(i,sn);
assign(fo,sn);
rewrite(fo,1);
i:=i+1;
end;
if ((s[1]='0') and (s[2]='x')) then
begin
for j:=0 to 3 do
begin
for k:=0 to 3 do
begin
dat[k]:=0;
ch:=s[2*k+j*12+3];
case ch of
'0'..'9': dat[k]:=ord(ch)-$30;
'a'..'f': dat[k]:=ord(ch)-$57;
end;
dat[k]:=dat[k] shl 4;
ch:=s[2*k+j*12+4];
case ch of
'0'..'9': dat[k]:=dat[k] or (ord(ch)-$30);
'a'..'f': dat[k]:=dat[k] or (ord(ch)-$57);
end;
end;
for k:=3 downto 0 do
blockwrite(fo,dat[k],1);
end;
end;
no_str:
end;
close(fo);
close(fi);
no_file:
end.
Пример на Пасквиле (для любителей напильников):