-
Notifications
You must be signed in to change notification settings - Fork 4
/
InstructionsBRI12.tex
25 lines (24 loc) · 1.84 KB
/
InstructionsBRI12.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
\section{Instructions encoded with BRI12 format}
\begin{smalltables}
\begin{longtable}{llllllllllllllllllllllll p{1cm} p{7cm} | }
\caption{Encoding\label{long}}\\
23 & & & & & & & & & & & 12 & 11 & & & 8 & 7 & & & 4 & 3 & & & 0 & &
\multicolumn{1}{c}{}\\
\hline
%BEQZ
\multicolumn{12}{|c|}{imm[11..0]} & \multicolumn{4}{c|}{s} & \multicolumn{4}{c|}{0001} & \multicolumn{4}{c|}{0110} & \multicolumn{1}{c|}{$BEQZ$} & $offset \leftarrow sign\_extend(imm)$ \newline $condition \leftarrow (AR[s] = 0^{32})$ \newline if condition then \newline $PC \leftarrow PC + offset + 4$ \newline endif\\ \hline
\multicolumn{12}{|c|}{imm[11..0]} & \multicolumn{4}{c|}{s} & \multicolumn{4}{c|}{1101} & \multicolumn{4}{c|}{0110} & \multicolumn{1}{c|}{$BGEZ$} & $offset \leftarrow sign\_extend(imm)$ \newline $condition \leftarrow (AR[s] >= 0^{32})$ \newline if condition then \newline $PC \leftarrow PC + offset + 4$ \newline endif\\ \hline
\multicolumn{12}{|c|}{imm[11..0]} & \multicolumn{4}{c|}{s} & \multicolumn{4}{c|}{1001} & \multicolumn{4}{c|}{0110} & \multicolumn{1}{c|}{$BLTZ$} & $offset \leftarrow sign\_extend(imm)$ \newline $condition \leftarrow (AR[s] < 0^{32})$ \newline if condition then \newline $PC \leftarrow PC + offset + 4$ \newline endif\\ \hline
\multicolumn{12}{|c|}{imm[11..0]} & \multicolumn{4}{c|}{s} & \multicolumn{4}{c|}{0101} & \multicolumn{4}{c|}{0110} & \multicolumn{1}{c|}{$BNEZ$} & $offset \leftarrow sign\_extend(imm)$ \newline $condition \leftarrow (AR[s] \neq 0^{32})$ \newline if condition then \newline $PC \leftarrow PC + offset + 4$ \newline endif\\ \hline
\end{longtable}
\begin{longtable}{|p{5cm}|p{5cm}|}
\caption{Assembler\label{long}}\\
\hline
Instruction & \\
\hline
BEQZ & beqz as, imm\\ \hline
BGEZ & bgez as, imm\\ \hline
BLTZ & bltz as, imm\\ \hline
BNEZ & bnez as, imm\\ \hline
\end{longtable}
\end{smalltables}