\documentclass{article}[10pt]
\usepackage{listings}

        \oddsidemargin  -0.1in
        \evensidemargin -0.1in


\lstdefinelanguage[x8051]{Assembler}
[x86masm]{Assembler}
{morekeywords={clr, movc, movx, ljmp, sjmp, lcall, cjne, djnz, swap, orl, subb, rl, anl, xch},
sensitive=false,
deletekeywords={loop,low,dl}
}

\lstset{% Default options for all algorithm listings read
  language=[x8051]Assembler,
  %labelstep=5,
  %frame=trbl,
  %indent=15pt,
  %indent=12pt,
  showlines=false,
  stringstyle=\itshape%,
  %basicstyle=\ttfamily\footnotesize
}

\author{Nada Amin\\
\texttt{namin@mit.edu}
}

\title{6.115 Final Project -- Code Listing}

\begin{document}

\date{May 2006}

\maketitle

\section*{{\tt R31JP} serial interface ({\tt minmon.asm})}

I simply extended {\tt MINMON} with commands {\tt F}, {\tt B}, {\tt L}, {\tt
K}, {\tt H}, {\tt S} which instruct the robot to move around or send
sensory information.

\lstinputlisting{minmon.asm}

\section*{{\tt Python} library serial interface ({\tt librobot.py})}

{\tt librobot.py} provides the basic functionality to command the
robot from Python. It uses {\tt pySerial}, a {\tt Python} module to
access the serial port, freely available at {\tt
http://pyserial.sourceforge.net}.
\lstset{
  language=Python,
  %labelstep=5,
  %frame=trbl,
  %indent=15pt,
  %indent=12pt,
  showlines=false,
  stringstyle=\itshape%,
  %basicstyle=\ttfamily\footnotesize
}

\lstinputlisting{librobot.py}

\section*{Sample programs ({\tt demorobot.py})}

{\tt demorobot.py} showcases a few sample programs. In particular, the
{\tt DemoRobot} class extends the library interface to record and
replay or undo sequences of moves, while also optionally avoiding obstacles.

\lstinputlisting{demorobot.py}

\end{document}

