CS208, Friday 11 Feb 2022
Exam and grades (10)
- Scores out of 52: wide range (19-51), lots of 30's and low 40's
- Exam as snapshot + study guide
- Common: high homework scores, lower exam score
- First pass through a course: hard to calibrate point totals
- Later today: I'll send a grade report with a rough grade estimate to you
- Specific issues
- the nature of char pointers
- two's complement
- Monday: start with Q&A on the exam
Why are we mucking about in x86 code? (5)
- What are the instructions our computer hardware can execute directly? (arithmetic (numerical and logical), copy data between registers and memory, compare two numbers, jump to a different instruction based on a comparison, and [we haven't done these instructions] copy data between registers and I/O devices)
- How do our familiar high-level programming constructs get implemented with such tiny instructions?
- types
- conditionals
- loops
- functions
- How do those implementations affect running time and the nature of our bugs?
- Big question: how can one processor run many programs at once?
- Big question: what services do operating systems and hardware need to provide to programs to enable them to do their jobs?
Stuff you need
- Addressing modes
- (%r)
- 0x8(%r)
- 0x8(%r1, %r2, 4)
- Sections 3.7, 3.8 of the book
- Revisit the stack: what happens at the beginning and end of a function call?
Walkthrough
-
...