isa/examples: include them into the pdf
authorBernhard Urban <lewurm@gmail.com>
Thu, 28 Oct 2010 10:46:06 +0000 (12:46 +0200)
committerBernhard Urban <lewurm@gmail.com>
Thu, 28 Oct 2010 10:46:06 +0000 (12:46 +0200)
2_isa/Makefile
2_isa/common.sty
2_isa/example.tex [new file with mode: 0644]
2_isa/isa.tex

index 3a500dc1f5bf0a71c3e774577b94aa101344b19d..a6e07936139f16869f02c71fc5a84834c05fa5fc 100644 (file)
@@ -1,7 +1,7 @@
 SHELL := bash
 
 FILES  = isa.tex conds.tex flags.tex callingconv.tex cmp.tex desdis.tex
-FILES += Makefile
+FILES += Makefile $(shell ls src/*.c src/*.s) example.tex
 TARGET = isa.pdf
 
 ISA_FILES = arith.ptex logic.ptex data.ptex misc.ptex
index 0887eb33f59046d7474a306573c71d681b64d8a9..f237c0c387970c9f155fbb7da12b9f761b954be0 100644 (file)
@@ -45,6 +45,22 @@ tabsize=4
        \large\textcolor{red}{TODO: #1}
 }
 
+\lstset{%
+       basicstyle=\footnotesize,
+       frame=single,
+       breaklines=true,
+       tabsize=4
+}
+
+\newcommand{\listingS}[2] {
+       %wtf, no "Assembler" exists??
+       %\lstinputlisting[language=Assembler,caption=#1]{#2}
+       \lstinputlisting[caption=#1]{#2}
+}
+\newcommand{\listingC}[2] {
+       \lstinputlisting[language=C,caption=#1]{#2}
+}
+
 \newcommand{\allauthors}{
        \author{
                \addauthor{Markus Hofst\"atter}{0725034}{markus.manrow@gmx.at}\and
diff --git a/2_isa/example.tex b/2_isa/example.tex
new file mode 100644 (file)
index 0000000..7c12131
--- /dev/null
@@ -0,0 +1,19 @@
+\subsection{\texttt{strncmp}}
+\listingC{\texttt{strncmp} C-Code}{src/strncmp.c}
+\listingS{\texttt{strncmp} ASM-Code}{src/strncmp.s}
+
+\subsection{\texttt{bittwiddling}}
+\listingC{\texttt{bittwiddling} C-Code}{src/bittwiddling.c}
+\listingS{\texttt{bittwiddling} ASM-Code}{src/bittwiddling.s}
+
+\subsection{\texttt{palindrom}}
+\listingC{\texttt{palindrom} C-Code}{src/palindrom.c}
+\listingS{\texttt{palindrom} ASM-Code}{src/palindrom.s}
+
+\subsection{\texttt{bootrom}}
+\listingC{\texttt{bootrom} C-Code}{src/bootrom.c}
+\listingS{\texttt{bootrom} ASM-Code}{src/bootrom.s}
+
+\subsection{\texttt{umul}}
+\listingC{\texttt{umul} C-Code}{src/umul.c}
+\listingS{\texttt{umul} ASM-Code}{src/umul.s}
index e333f4fd2d127c9a6e2021ce10bb85e151bd4ad0..85940cddd4d61ffa804ca741806ba9bb1e8fffc9 100644 (file)
@@ -40,5 +40,7 @@ When not stated otherwise the following instructions will not modify any flag.
 \subsection{miscellaneous instructions}
 \input{misc}
 
+\section{Examples}
+\input{example}
 
 \end{document}