! Null Device Driver

%option "-low-nocheck-nodiag-noline-nostack"
%include "mouse.inc"

%externalrecord(scb fm)%map open %alias "n_open" -
  (%integer mode, %string(255)file)
%record(scb fm)%name scb
%integer x

  %routine refresh(%record(scb fm)%name scb)
    %signal 9,,,"End of file" %if scb_p>=scb_l {which it will be}
  %end

  %routine flush(%record(scb fm)%name scb,%integer sym)
  %end

  %routine service(%record(scb fm)%name scb,%integer op,parm)
  %switch sw(0:7)
    ->sw(op&7)
sw(serrefresh): refresh(scb)
sw(*):
  %end

  scb == newscb(file)
  scb_mode = mode
  scb_gla = a4
  *lea service,a0; *move.l a0,x
  scb_serpc = x
  %if mode=inputmode %start
    *lea refresh,a0; *move.l a0,x
    scb_fastpc = x
  %else
    *lea flush,a0; *move.l a0,x
    scb_fastpc = x
  %finish
  %result == scb
%end
