aboutsummaryrefslogtreecommitdiff
path: root/compiler/README.md
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-02-07 15:29:04 -0500
committerMustafa Quraish <[email protected]>2022-02-07 15:29:04 -0500
commit941df930b0b519cf4b82f5e46ffe49ca75e68619 (patch)
treeb2da7c31710b831201d0ee9a3ee03fdfe7196f07 /compiler/README.md
parent[cup] Self-hosting is now possible! Make some tweaks to match C output (diff)
downloadcup-941df930b0b519cf4b82f5e46ffe49ca75e68619.tar.xz
cup-941df930b0b519cf4b82f5e46ffe49ca75e68619.zip
[cup] Remove unnecessary function from codegen, add info to README
Diffstat (limited to 'compiler/README.md')
-rw-r--r--compiler/README.md15
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/README.md b/compiler/README.md
index 0e58d43..54ab576 100644
--- a/compiler/README.md
+++ b/compiler/README.md
@@ -1,3 +1,16 @@
# CUP Compiler in CUP
-This is the beginnings of a CUP compiler written in itself. \ No newline at end of file
+This is an implementation of the CUP compiler in itself! As of this writing, it can generate identical assembly code to the compiler written in C.
+
+```bash
+$ make
+gcc -Wall -Wextra -Werror -ggdb3 -o build/cupcc <...>
+$ ./build/cupcc compiler/main.cup -o 1.nasm
+$ make 1.out
+nasm -felf64 1.nasm -o 1.o
+ld 1.o -o 1.out
+$ ./1.out compiler/main.cup -o 2.nasm
+$ diff 1.nasm 2.nasm
+$ # no output, same generated code, yay!
+```
+