%&pdflatex
\documentclass[a4paper,12pt]{report}

\usepackage{phdthesis}
\usepackage{booktabs}
\usepackage{makeidx}
%\usepackage{subfigure}
\usepackage{tabularx}
\usepackage{url}
\usepackage{verbatim}
\usepackage{wrapfig}
\usepackage{xspace}
\usepackage{listings}
\usepackage[toc,page]{appendix}
\usepackage{pdflscape}
\usepackage{parskip}
\usepackage{bold-extra}
\usepackage{float}
\restylefloat{table}
\usepackage[T1]{fontenc}
\usepackage{inconsolata}
\usepackage{tikz}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{dingbat}
\usepackage{pifont}
\newcommand{\xmark}{\ding{55}}
\usepackage{color,colortbl}
\usepackage{longtable}
\usepackage[pdfpagelabels,colorlinks,linkcolor=black,citecolor=brown,plainpages=false]{hyperref}
\usepackage{adjustbox}
\usepackage{colortbl}

\setlength{\headheight}{15pt}

% define \mono for all "computery" stuff
\let\mono\texttt
\renewcommand{\texttt}[1]{\mono{\textbf{\textcolor{fgreen}{#1}}}}

% if you don't like hyphenation...
\pretolerance=5500
\tolerance=1000 
\emergencystretch=10pt

\definecolor{darkGreen}{rgb}{0,0.4,0}
\definecolor{gley}{rgb}{0.92,0.92,0.92}
\definecolor{brack}{rgb}{0.8,0.8,0.8}
\definecolor{pale}{rgb}{0.95,0.95,1}
\definecolor{gleen}{rgb}{0.95,1,0.95}
\definecolor{fgreen}{rgb}{0.45,0.6,0.45}
\definecolor{bug}{rgb}{0.9,0.3,0.3}
\definecolor{todo}{rgb}{0.5,0.5,0.1}
\definecolor{illegal}{rgb}{0.75,1,0.75}
\definecolor{unimplemented}{rgb}{1,0.2,0.2}
\definecolor{unstable}{rgb}{0.9,0.9,0.5}
\definecolor{unstablecertain}{rgb}{1,0.6,0}
\definecolor{ghost}{rgb}{0.65,0.65,0.65}
\definecolor{ghost2}{rgb}{0.85,0.85,0.85}
\definecolor{missing}{rgb}{0.85,0.85,1}
\definecolor{bblue}{rgb}{0,0,1}

% Define the assembler name as a command so it is consistent and easily changed
\newcommand{\dasm}{{\color{brown}\mono{\textbf{dasm}}}\xspace}

% define a "language" for dasm's directives and 6502 code
\lstset{ 
	basicstyle=\ttfamily\linespread{1}\small,
	backgroundcolor=\color{gleen},
	frame=single,
	breakatwhitespace=false, 
%
% build a "language" for 6502 and the directives of dasm
% so that we get nice syntax highlighting of any code listings
% I've only added the ones I've needed - if anything is not highlighted, add it here
%
	emph={%  
% directives...	
		DC, dc, DS, ds, DV, dv%
		HEX, hex, BYTE, byte, WORD, word, LONG, long,
		REPEAT, repeat, REPEND, repend, %
		SET, set, SETSTR, setstr, %
		EQU, equ, EQM, eqm, EQV, eqv, %
		SEG, seg, U, u, ORG, org, RORG, rorg, %
		MAC, mac, MACRO, macro, MEXIT, mexit, ENDM, endm, %
		INCLUDE, include, INCBIN, incbin, INCDIR, incdir, %
		PROCESSOR, processor, SUBROUTINE, subroutine, %
		IF, if, ELSE, else, EIF, eif, ENDIF, endif, IFCONST, ifconst, IFNCONST, ifnconst, %
		ALIGN, align, ECHO, echo, ERR, err, %	
% 6502 (very partial)...		
		ldx, stx, dex, inx, cpx, ldy, sty, dey, iny, cpy,%
		lda, sta, pha, pla, cmp, 
		php, plp, rts, jsr, jmp, inc, dec, ora, eor, sbc, clc, sec, adc,%
		sed, cli, sei, rti, bne, beq, bpl, bmi, bvc, bvs, bit, ror, rol, lsr, asl,%		
	},
	emphstyle={\color{fgreen}\bfseries},
	frameround=tttt,
}

\lstnewenvironment{code}[1][]%
{\noindent\minipage{\linewidth}\medskip 
	\lstset{framesep=5pt,xleftmargin=0pt,xrightmargin=0pt,basicstyle=\ttfamily\small,morecomment=[n][\color{gray}]{;}{\^^M},frame=single}}
{\endminipage}

\lstnewenvironment{outputx}[1][]%
{\noindent\minipage{\linewidth}\medskip 
	\lstset{framesep=5pt,xleftmargin=0pt,xrightmargin=0pt,basicstyle=\ttfamily\small\color{black},morecomment=[n][\color{gray}]{;}{\^^M},frame=single,backgroundcolor=\color{brack}}}
{\endminipage}

\lstnewenvironment{outputx2}[1][]%
{\noindent\minipage{\linewidth}\medskip 
	\lstset{framesep=5pt,xleftmargin=0pt,xrightmargin=0pt,basicstyle=\ttfamily\footnotesize\color{black},morecomment=[n][\color{gray}]{;}{\^^M},frame=single,backgroundcolor=\color{brack}}}
{\endminipage}

\lstnewenvironment{usage}[1][]%
{\noindent\minipage{\linewidth}\medskip 
	\lstset{framesep=5pt,xleftmargin=0pt,xrightmargin=0pt,basicstyle=\ttfamily\small,backgroundcolor=\color{pale},frame=single}}
{\endminipage}

\newcommand*{\authorimg}[1]{%
  \raisebox{-.3\baselineskip}{%
    \includegraphics[
      height=\baselineskip,
      width=\baselineskip,
      keepaspectratio,
    ]{#1}%
  }%
}



\makeindex

\begin{document}

	\pagenumbering{gobble}


	\include{titlepage}
	\include {changelog}
		
	\cleardoublepage
	\pagenumbering{roman} %i,ii,iii etc
	\tableofcontents
		
	\cleardoublepage
	\pagenumbering{arabic} %1,2,3,4 ...

	
	\include{introduction}
	\include{manual}
	\include{6502}
	\include{68HC11}
	\include{68705}
	\include{6803}
	\include{HD6303}
	\include{F8}
	\include{mc68hc908}
	\include{machines}
	\phantomsection
	\addcontentsline{toc}{chapter}{Index}
	\printindex

\end{document}












