-
-
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
37 changed files
with
204 additions
and
126 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 @@ | ||
li r1, 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,11 @@ | ||
\subsection{LQ} | ||
|
||
\LSinstr{001001}{ra}{rb}{11}{offset} | ||
|
||
\paragraph{Format} LQ 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
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{LW} | ||
|
||
\LSinstr{001001}{ra}{rb}{10}{offset} | ||
|
||
\paragraph{Format} LW 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.
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,12 @@ | ||
\subsection{SQ} | ||
|
||
\LSinstr{001000}{ra}{rb}{11}{offset} | ||
|
||
\paragraph{Format} SQ offset(ra), rb | ||
|
||
\paragraph{Purpose} Store the 64bit value from the low bits of register `rb` into memory | ||
|
||
\begin{lstlisting}[language=C] | ||
vaddr = GPR[ra] + SEXT(offset); | ||
*vaddr = rb; | ||
\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
Oops, something went wrong.