-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: clean up, athena is now a 64bits architecture
- Loading branch information
Showing
42 changed files
with
235 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
\chapter{Examples} | ||
|
||
\input{base/examples/basic} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
\section{Basic operations} | ||
|
||
\subsection{Simple loop} | ||
|
||
\lstinputlisting[language={[Athena]Assembler}]{base/examples/loop.S} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
addi r1, r0, loop_count | ||
loop: | ||
subi r1, r1, 1 | ||
bnez r1, loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
\subsection{ADDU} | ||
\subsection{ADDW} | ||
|
||
\Rinstr{000000}{ra}{rb}{rc}{00000}{000010} | ||
|
||
\paragraph{Format} ADDU ra, rb, rc | ||
\paragraph{Format} ADDW ra, rb, rc | ||
|
||
\paragraph{Purpose} Add word | ||
|
||
\begin{lstlisting}[language=c] | ||
GPR[ra] = GPR[rb] + GPR[rc]; | ||
GPR[ra] = SEXT((GPR[rb] + GPR[rc])<31:0>); | ||
\end{lstlisting} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
\subsection{JSR} | ||
|
||
\Jinstr{001010}{ra}{offset} | ||
|
||
\paragraph{Format} JMP ra, offset | ||
|
||
\begin{lstlisting}[language=C] | ||
PC = GPR[ra] + (SEXT(offset) * 4); | ||
\end{lstlisting} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
\subsection{LD} | ||
|
||
\LSinstr{001100}{ra}{rb}{11}{offset} | ||
|
||
\paragraph{Format} LD ra, offset(rb) | ||
|
||
\paragraph{Purpose} Loads a 64bit value from memory then store to `ra` | ||
|
||
\begin{lstlisting}[language=C] | ||
GPR[ra] = *(int32_t)(GPR[rb] + offset); | ||
\end{lstlisting} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
\subsection{LDA} | ||
|
||
\Iinstr{XXXX}{ra}{rb}{imm} | ||
|
||
\paragraph{Format} LDA ra, rb, imm | ||
|
||
\begin{lstlisting}[language=C] | ||
GPR[ra] = GPR[rb] + SEXT(imm); | ||
\end{lstlisting} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
\subsection{LDAH} | ||
|
||
\Iinstr{XXXX}{ra}{rb}{imm} | ||
|
||
\paragraph{Format} LDAH ra, rb, imm | ||
|
||
\begin{lstlisting}[language=C] | ||
GPR[ra] = GPR[rb] + SEXT(imm*65536); | ||
\end{lstlisting} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
\subsection{LWU} | ||
|
||
\LSinstr{001100}{ra}{rb}{10}{offset} | ||
|
||
\paragraph{Format} LWU ra, offset(rb) | ||
|
||
\paragraph{Purpose} Loads a 32bit value from memory then store to `ra` | ||
|
||
\begin{lstlisting}[language=C] | ||
vaddr = GPR[rb] + SEXT(offset); | ||
GPR[ra] = ZEXT(*vaddr<31:0>); | ||
\end{lstlisting} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.