Summary Files Commits Branches @commit @diff @stats
path: root / Year 3 / Compilers, Introduction / coolc-spim / my-code / README.md
diff options
context:
space:
mode:
Commitc43a57130601e63ccdd70b0dfd0a5d2bf5bef3a6 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-10-18 18:26:05 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-10-18 18:26:05 +0300
Filesc47c0efa808971c2569bb6ed25707747853b380e /Year 3/Compilers, Introduction/coolc-spim/my-code/README.md
uni-projects-c43a57130601e63ccdd70b0dfd0a5d2bf5bef3a6.tar
uni-projects-c43a57130601e63ccdd70b0dfd0a5d2bf5bef3a6.tar.gz
uni-projects-c43a57130601e63ccdd70b0dfd0a5d2bf5bef3a6.zip
Parent3ba593c0c4da762969a48a5c89c4a096e93680a5 (diff)
[CI] Added docker setup
1 files changed, 36 insertions, 0 deletions
-rw-r--r--Year 3/Compilers, Introduction/coolc-spim/my-code/README.md36
diff --git a/Year 3/Compilers, Introduction/coolc-spim/my-code/README.md b/Year 3/Compilers, Introduction/coolc-spim/my-code/README.md
new file mode 100644
index 0000000..6b78621
--- /dev/null
+++ b/Year 3/Compilers, Introduction/coolc-spim/my-code/README.md
@@ -0,0 +1,36 @@
+This is a shared directory between the docker container and the hosting machine.
+Edit the files at your convenience on the host machine and then compile and run
+from the container.
+
+To try the included code, do the following:
+
+Copy the `atoi.cl` file provided by the course materials
+(`/usr/class/cs143/assignments/PA1/atoi.cl`) in the same working directory as
+where you copy these three files and run them as follows:
+
+```
+$ # This runs the first implementation of factorial
+$ coolc factorial1.cl atoi.cl
+$ spim factorial1.s
+```
+
+The program waits for a number input and then outputs the factorial.
+
+```
+$ # This runs the second implementation of factorial
+$ coolc factorial2.cl atoi.cl
+$ spim factorial2.s
+```
+
+The UI is the same.
+
+```
+$ # This runs the program implementing a linked list
+$ coolc list.cl atoi.cl
+$ spim list.s
+```
+
+The program waits for no input, but prints "Hello World! 42".
+
+If `list.cl` is modified to uncomment the two lines that add the `abort`
+variable to the list, running the program will abort and not print anything.