%begin; !badanal

%routine skipto(%integer x)
%integer y
  readsymbol(y) %until y=x
%end

%integer block,cyl,track,sec

%on 3,4,9 %start; %stop; %finish

openinput(1,"bad.dat"); selectinput(1)
openoutput(1,"xbad.dat"); selectoutput(1)
skipto(nl)
%cycle
  skipto('k'); read(block)
  write(block,7)
  write(block>>(5+4),4)
  write(block>>5&15,2)
  write(block&31,2)
  newline
%repeat

%end
