aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml3
-rw-r--r--README.md7
-rw-r--r--cheatsheet.cls6
-rw-r--r--linux-x64.tex2
-rw-r--r--mac.tex2
-rw-r--r--microsoft-x64-contents.tex8
-rw-r--r--microsoft-x64.tex19
-rw-r--r--overview.tex37
-rw-r--r--system-v-abi-contents.tex8
-rw-r--r--system-v-abi.tex19
-rw-r--r--windows-x64.tex2
11 files changed, 82 insertions, 31 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2b684f9..0608e36 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -5,10 +5,13 @@ pdf:
- pdflatex linux-x64.tex
- pdflatex mac.tex
- pdflatex mac.tex
+ - pdflatex overview.tex
+ - pdflatex overview.tex
- pdflatex windows-x64.tex
- pdflatex windows-x64.tex
artifacts:
paths:
- linux-x64.pdf
- mac.pdf
+ - overview.pdf
- windows-x64.pdf
diff --git a/README.md b/README.md
index 48e9cce..585f6f8 100644
--- a/README.md
+++ b/README.md
@@ -5,9 +5,15 @@ run-time system. Clone the repository to build the PDFs or download them here:
## Download links
+**Platform-specific:**
+
- [Linux (x64)][linux-x64]
- [Mac][mac]
- [Windows (x64)][windows-x64]
+
+**Other:**
+
+- [Overview (A5 paper)][overview]
- [Zip with all cheat sheets][zip]
## Naming conventions
@@ -22,5 +28,6 @@ run-time system. Clone the repository to build the PDFs or download them here:
[linux-x64]: https://gitlab.science.ru.nl/cstaps/clean-rts-cheat-sheet/-/jobs/artifacts/master/raw/linux-x64.pdf?job=pdf
[mac]: https://gitlab.science.ru.nl/cstaps/clean-rts-cheat-sheet/-/jobs/artifacts/master/raw/mac.pdf?job=pdf
+[overview]: https://gitlab.science.ru.nl/cstaps/clean-rts-cheat-sheet/-/jobs/artifacts/master/raw/overview.pdf?job=pdf
[windows-x64]: https://gitlab.science.ru.nl/cstaps/clean-rts-cheat-sheet/-/jobs/artifacts/master/raw/windows-x64.pdf?job=pdf
[zip]: https://gitlab.science.ru.nl/cstaps/clean-rts-cheat-sheet/-/jobs/artifacts/master/download?job=pdf
diff --git a/cheatsheet.cls b/cheatsheet.cls
index dfe1191..abdaa43 100644
--- a/cheatsheet.cls
+++ b/cheatsheet.cls
@@ -26,3 +26,9 @@
\par\bigskip
\scriptsize
\url{https://gitlab.science.ru.nl/cstaps/clean-rts-cheat-sheet}}
+
+\def\CallingConventionHeader{Calling Convention}
+\newif\iftabularwrapping
+\tabularwrappingtrue
+
+\long\def\cheatsheetbox#1{\fcolorbox{black}{white}{#1}}
diff --git a/linux-x64.tex b/linux-x64.tex
index d8e3c96..4caa812 100644
--- a/linux-x64.tex
+++ b/linux-x64.tex
@@ -4,5 +4,5 @@
\input{registers}
\bigskip
-\input{system-v-abi}
+\cheatsheetbox{\input{system-v-abi}}
\end{document}
diff --git a/mac.tex b/mac.tex
index 0c1e909..edd6272 100644
--- a/mac.tex
+++ b/mac.tex
@@ -4,5 +4,5 @@
\input{registers}
\bigskip
-\input{system-v-abi}
+\cheatsheetbox{\input{system-v-abi}}
\end{document}
diff --git a/microsoft-x64-contents.tex b/microsoft-x64-contents.tex
new file mode 100644
index 0000000..e1e50a3
--- /dev/null
+++ b/microsoft-x64-contents.tex
@@ -0,0 +1,8 @@
+Arguments: & rcx & rdx & r8 & r9 &&&& \\
+ & A0 & A1 & A2 & scr &&&& \\
+\hline
+Result: & rax &&&&&&& \\
+ & B0 &&&&&&& \\
+\hline
+Callee-saved: & rbx & rbp & rdi & rsi & r12 & r13 & r14 & r15 \\
+ & B1 & scr & hp & asp & B4 & B5 & B6 & free
diff --git a/microsoft-x64.tex b/microsoft-x64.tex
index 59ce87e..70f2521 100644
--- a/microsoft-x64.tex
+++ b/microsoft-x64.tex
@@ -1,14 +1,5 @@
-\fcolorbox{black}{white}{%
- \setlength{\tabcolsep}{.2em}%
- \begin{tabular}{lcccccccc}
- \multicolumn{7}{c}{\textbf{Function Calls}}\\\hline
- Arguments: & rcx & rdx & r8 & r9\\
- & A0 & A1 & A2 & scr\\
- \hline
- Result: & rax \\
- & B0 \\
- \hline
- Callee-saved: & rbx & rbp & rdi & rsi & r12 & r13 & r14 & r15 \\
- & B1 & scr & hp & asp & B4 & B5 & B6 & free \\
- \end{tabular}%
-}%
+\setlength{\tabcolsep}{.2em}%
+\begin{tabular}{lcccccccc}
+ \multicolumn{7}{c}{\textbf{\CallingConventionHeader}}\\\hline
+ \csname @@input\endcsname microsoft-x64-contents %
+\end{tabular}%
diff --git a/overview.tex b/overview.tex
new file mode 100644
index 0000000..d448579
--- /dev/null
+++ b/overview.tex
@@ -0,0 +1,37 @@
+\documentclass{cheatsheet}
+
+\geometry{a5paper,landscape}
+
+\begin{document}
+\begin{center}
+ \textbf{Clean RTS Cheat Sheet}
+\end{center}
+
+\hfill
+\begin{minipage}[t][][b]{.3\textwidth}%
+ \centering%
+ \textbf{Registers}
+ \bigskip
+
+ \input{registers}
+\end{minipage}%
+\hfill
+\begin{minipage}[t][][b]{.5\textwidth}%
+ \tabularwrappingfalse%
+ \setlength{\tabcolsep}{.2em}%
+ \begin{tabular}{|lcccccccc|}%
+ \multicolumn{9}{c}{\textbf{{\CallingConventionHeader}s}}\\
+ \multicolumn{1}{c}{}\\[-1em]
+ \multicolumn{9}{c}{\textit{System V}}\\\hline
+ \csname @@input\endcsname system-v-abi-contents \\\hline
+
+ \multicolumn{1}{c}{}\\
+ \multicolumn{9}{c}{\textit{Microsoft x64}}\\\hline
+ \csname @@input\endcsname microsoft-x64-contents \\\hline
+ \end{tabular}%
+\end{minipage}%
+\hfill
+
+\bigskip
+
+\end{document}
diff --git a/system-v-abi-contents.tex b/system-v-abi-contents.tex
new file mode 100644
index 0000000..16cfc27
--- /dev/null
+++ b/system-v-abi-contents.tex
@@ -0,0 +1,8 @@
+Arguments: & rdi & rsi & rdx & rcx & r8 & r9 && \\
+ & hp & asp & A1 & A0 & A2 & scr && \\
+\hline
+Result: & rax & rdx &&&&&& \\
+ & B0 & A1 &&&&&& \\
+\hline
+Callee-saved: & rbx & rbp & r12 & r13 & r14 & r15 && \\
+ & B1 & scr & B4 & B5 & B6 & free &&
diff --git a/system-v-abi.tex b/system-v-abi.tex
index fccfab5..72142db 100644
--- a/system-v-abi.tex
+++ b/system-v-abi.tex
@@ -1,14 +1,5 @@
-\fcolorbox{black}{white}{%
- \setlength{\tabcolsep}{.2em}%
- \begin{tabular}{lcccccc}
- \multicolumn{7}{c}{\textbf{Function Calls}}\\\hline
- Arguments: & rdi & rsi & rdx & rcx & r8 & r9\\
- & hp & asp & A1 & A0 & A2 & scr\\
- \hline
- Result: & rax & rdx \\
- & B0 & A1 \\
- \hline
- Callee-saved: & rbx & rbp & r12 & r13 & r14 & r15 \\
- & B1 & scr & B4 & B5 & B6 & free \\
- \end{tabular}%
-}%
+\setlength{\tabcolsep}{.2em}%
+\begin{tabular}{lcccccccc}
+ \multicolumn{9}{c}{\textbf{\CallingConventionHeader}}\\\hline
+ \csname @@input\endcsname system-v-abi-contents %
+\end{tabular}%
diff --git a/windows-x64.tex b/windows-x64.tex
index 88561f7..c5aa155 100644
--- a/windows-x64.tex
+++ b/windows-x64.tex
@@ -4,5 +4,5 @@
\input{registers}
\bigskip
-\input{microsoft-x64}
+\cheatsheetbox{\input{microsoft-x64}}
\end{document}