Resources
x86-64 assembly language resources
- Brown x64 cheat sheet
- Brown gdb cheat sheet
- CMU summary of gdb commands for x86-64
- JHU CSF x86-64 assembly language guide
Example code
Precedence climbing example
prec-climb.zip is an example implementation of precedence
climbing. The Parser::parse_work
function in prec_climb.cpp
is the implementation
of the algorithm. It’s written in a purely-recursive way, which might make it easier
to understand than the pseudo-code in the
Wikipedia article on precedence climbing.
Note that the lexer requires spaces between tokens. (E.g., a+b
would be considered one
token, so you should type a + b
instead.)
Example run (user input in bold):
$ ./prec_climb
a + b * 3 - 4 * 2 ^ b ^ 3
OP_MINUS[-]
+--OP_PLUS[+]
| +--IDENT[a]
| +--OP_TIMES[*]
| +--IDENT[b]
| +--NUMBER[3]
+--OP_TIMES[*]
+--NUMBER[4]
+--OP_EXP[^]
+--NUMBER[2]
+--OP_EXP[^]
+--IDENT[b]
+--NUMBER[3]
Please let me know if you find bugs in this code!
Exam review materials
Note that in Fall 2020 the exams were take-home exams, so the format is different than what you will see when you take Exam 1 in class. However, the questions should still be useful for review purposes. The Fall 2021 exams were in-person, and the questions are more representative of the kinds of questions you will see in this course’s exams.
For Exam 1:
- Fall 2020 Exam 1, Solution (All questions are relevant)
- Fall 2020 Exam 2, Solution (Questions 1–5 are relevant)
- Fall 2021 Exam 1, Solution (All questions are relevant)
For Exam 2:
- Fall 2020 Exam 2, Solution (Question 6 is relevant)
- Fall 2021 Exam 2, Solution (Questions 3 and 4 are relevant)
For Exam 3:
- Fall 2020 Exam 3, Solution (Question 2–3 are relevant)
- Fall 2020 Exam 4, Solution (Questions 1–4 are relevant)
- Fall 2021 Exam 3, Solution (All questions are relevant)
- Fall 2022 Exam 3, Solution (All questions are relevant)