# Week 8 notes

Comp 264-002, Spring 2019,MWF, 11:30-12:20, Cuneo 218

Readings (from BOH3)

Chapter 1 (though we haven't covered much of
section 9 yet, on concurrency)

Section 2.1 (you can skip 2.1.7 for now, on
bitwise operations, and 2.1.9 on shift operations)

Section 2.2 (don't sweat the B2Uw notation for now, though all it's doing
is formally defining the conversion from strings of bits to integers)

Section 2.3 on integer arithmetic

Section 2.4 on floating-point arithmetic

Section 3.1

Section 3.2

Section 3.3

Section 3.4

Section 3.5

Study guide

## Machine code

My x64 summary sheet

3.6: Conditional execution (not on midterm)

branch-prediction examples:

branchpredict.c

ssort() vs isort() in Sort.java

Pipeline stages (RISC; some intel cpus have 20-stage pipelines)

- Instruction fetch
- Instruction decode and register fetch
- Execute
- Memory access
- Register write back

### while loops

dofact.c: there is only one label

while.c: Note that the condition has been moved to the bottom. Does this
improve anything? This is an example of the *jump-to-middle*
format.

whilefact.c

whilefact.Og.s: jump-to-middle

whilefact.O1.s: guarded-do example

forfact.c: jump-to-middle.

sdir.c