isa: more callingconv & stuff
authorBernhard Urban <lewurm@gmail.com>
Wed, 27 Oct 2010 17:52:57 +0000 (19:52 +0200)
committerBernhard Urban <lewurm@gmail.com>
Wed, 27 Oct 2010 17:52:57 +0000 (19:52 +0200)
2_isa/Makefile
2_isa/callingconv.tex

index 4f9406c45c411b9730e3a0c47cd23c6f06f2027a..b36762345761c55ec4190227bc125df5b7ff2bca 100644 (file)
@@ -17,8 +17,8 @@ $(TARGET): $(FILES) $(ISA_BUILD)
        $(PDFGEN)
        $(PDFGEN)
 
-%.tex: %.ptex
-       ./gentex.pl $^
+%.tex: %.ptex gentex.pl
+       ./gentex.pl $<
 
 .PHONY: clean html
 
index 794edf79665b1e63083486d1ff3aaeb1749d4ff6..ade1f8262783999ffa4d6b0ba186f7bb4ba7c26d 100644 (file)
        \caption{Register save \ldots}
 %      \label{tab:<+label+>}
 \end{table}
+
+\subsection{Assembler Syntax}
+\begin{itemize}
+\item \textbf{Immediates}: decimal \texttt{12345}, hex \texttt{0xabcde123},
+binary \texttt{0b10101110}\\
+If an immediate is to large for the given instruction the assembler terminates
+with an error
+
+\item \textbf{High and Low Half Word}: you can use the suffix \texttt{@hi} to
+access the upper 16 bit of an immediate, or \texttt{@lo} to access the lower 16
+bit.
+
+\item \textbf{Memory access}: to access data on an address which is located in a
+register, you have to write \texttt{0(rS)}. Alternatively you can specify
+a signed displacement.
+
+\item \textbf{Expressions}: Usual expressions like \texttt{+}, \texttt{-},
+\texttt{*} or \texttt{<<} will be evaluated by the assembler, e.g. \texttt{ldw
+r1, 0x20-8(r3)} is a valid instruction
+\end{itemize}
+
+\subsubsection{Directives}
+In order to gain extra comfort, several directives are interpreted by the
+assembler:
+\begin{table}[ht]
+       \centering
+       \begin{tabular}{|l|p{10cm}|} \hline
+               Name & Description \\ \hline
+               \texttt{.data} & subsequent data is desired for the data memory\\ \hline
+               \texttt{.text} & subsequent code is desired for the instruction memory\\ \hline
+               \verb+.include "file.s"+ & include a further file \\ \hline
+               \texttt{.define <name> <value>} & define a constant. Note that a define
+               isn't equal to a label\\ \hline
+               \texttt{label: <instr/data>} & label an instruction or data. The label
+               can be used as an alias for the address of this instruction in the
+               instruction memory or as a reference in the data memory, depending on
+               the current section\\ \hline
+               %TODO: those are maybe handy: .fill(
+               %http://www.myri.com/scs/L3/doc/as_7.html#SEC85)
+       \end{tabular}
+       \caption{supported directives by the assembler}
+%      \label{tab:<+label+>}
+\end{table}
+