floats (normalized, etc) not on the exam endian, when it matters multibyte values ←→ byte arrays (like memory) MBV: registers, immediates, byte array: data memory, instruction memory integer overflow officially: undefined behavior in practice: drops the extra bits 0x7fffffff + 0x7fffffff = 0xfffffffe masks / bit fiddling binary numbers as vectors of smaller numbers fetch... F - get an instruction and know what pieces it has D - read registers E - do math M - read or write memory (we never do both) W - write registers (PC Update) push/call/ret speedup old speed / new speed speeding up part of program speeds up whole program only a little [RC]ISC ideas, not reality about instruction sets Reduced fewer: instructions, addressing modes, work per instruction more: registers fixed-length encodings Complex: more: instructions, addressing modes, work per instruction fewer: registers variable-length (different instructions have different byte lengths) shorter assembly code for some task arrays and pointers int a[24]; // a is 24 ints back-to-back (96 bytes) -- array int *b; // b is the address to one or more ints -- pointer (8 bytes) b = &(a[0]); // b is the address of the first element of a b = a; // exactly the same as the previous line a = b; // illegal code a[3] = 5; // sets the 4th element of a b[3] = 5; // sets the 4th element of a b+4 == &(a[4]) "hi" // pointer (const char *) to array containing {'h', 'i', '\0'} char *c = "hi"; c[0] = 'a'; // probably fail char *d = 'h'; // not what you think: error char e = 'h'; char *f = &e; // pointer to h on the stack labels usually: control construct in C → goto + labels in C → jmp + labels in assembly → jmp + immediate in binary 00 jmp foo // this foo will become a immediate foo: // this foo will disapear after determining the value of uses of foo 09 halt jmp 09 halt