%option "-nodiag-nocheck"
%include "inc:util.imp"
%begin
%string(255)in1="prefix.mob",in2="loader.mob",out="x"
%integer p1,p2,s1,s2,room
%constinteger base=16_1000,limit=16_3f00-6*64
  defineparam("Prefix",in1,0)
  defineparam("Loader",in2,0)
  defineparam("Image",out,pamnewgroup)
  processparameters(cliparam)
  connectfile(in1,0,p1,s1)
  connectfile(in2,0,p2,s2)
  room = limit-base-s1-s2
  write(room,0); printstring(" spare bytes"); newline
  %stopif room<0
  openoutput(1,out); selectoutput(1)
  s1 = s1-1 %and printsymbol(byte(p1)) %and p1 = p1+1 %while s1>0
  s2 = s2-1 %and printsymbol(byte(p2)) %and p2 = p2+1 %while s2>0
%end
