!Utility to take a 68000 binary image and split it up into MS and LS halves.
!Needed for blowing EPROMS for machines with a 16-bit word.

%begin
%include "inc:util.imp"
%integer sym

%routine go
%integer sym,count=0
  %onevent 3,9 %start
    selectoutput(0); write(count,0); newline; %stop
  %finish
  %cycle
    selectoutput(1); readsymbol(sym); printsymbol(sym); count = count+1
    selectoutput(2); readsymbol(sym); printsymbol(sym); count = count+1
  %repeat
%end

%onevent 3,9 %start
  selectoutput(0); printline(event_message); %stop
%finish
  openinput(1,cliparam)
  openoutput(1,"$m")
  openoutput(2,"$l")
  go
%endofprogram
