%begin; !Load new ether firmware

%include "i:util.inc"
%include "i:fs.inc"

%string(255)file
%integer s,l

%constinteger tbe=8
%constinteger boot=3,etx=11,reset=15

%routine putc(%integer x)
  ethc = x; twait
%end

%routine putd(%integer x)
  ethd = x; twait
%end

  file = cliparam; file= "ether:n.bin" %if file=""
  connectfile(file,0,s,l)
  putc(reset)
  putc(boot)
  %while l>0 %cycle
    l = l-1
    putd(byteinteger(s)); s = s+1
  %repeat
  putc(etx)
{}printstring("Done ")
  etheropen(lsap,rdte<<8+rsap)
  newline

%endofprogram
