\def\uncatcodespecials{\def\do##1{\catcode`##1=12 }\dospecials}
\def\setupverbatim{\tt %
\setlength{\parskip}{0pt}
\def\par{\leavevmode\egroup\box0\endgraf} 
\obeylines \uncatcodespecials \obeyspaces
\catcode`\`=\active \catcode`\^^I=\active
\everypar{\startbox}} 
\newdimen\w \setbox0=\hbox{\tt\space} \w=8\wd0
\def\startbox{\setbox0=\hbox\bgroup}
{\catcode`\^^I=\active
\gdef^^I{\leavevmode\egroup
\dimen0=\wd0
\divide\dimen0 by\w
\multiply\dimen0 by\w
\advance\dimen0 by\w
\wd0=\dimen0 \box0 \startbox}}
{\obeyspaces\global\let =\ }
{\catcode`\`=\active \gdef`{\relax\lq}}

\def\listing#1{\par\begingroup\setupverbatim\input#1 \endgroup}
