CS208 Introduction to Computer Systems Monday, 13 October 2025 + Today - Assembly language intro & experiments - New assignment due Friday - (Soon: a few little additions to data representation discussions) - (Exam: I'm hoping to return it Wednesday) + Compiler Explorer - https://godbolt.org/ - C sources --> assembly language - Settings - A maximum function int maximum(int x, int y) { int result = x; if (y > x) { result = y; } return result; } What does the corresponding assembly look like? - Write a function int f(int a, int b) that does: return a * b - Try some more return a + b return 5 * a + 9 * b try other formulas - Try an if-statement return the smaller of and b min (very similar to max) - Try a for-loop return 1 + 2 + 3 + ... + a + Between now and Wednesday - Get the assignment package - Read the assignment - Read the readme - Start looking at the code - See if you can solve one or two puzzles ======= + Layers of abstraction + Intel chip/instruction-set history ~1970: 4004 1970s-1980s: 8008, 8080, 8086 : 8-bit machines every instruction was some # of bytes registers were 8 bits registers were named a, b, c, etc. 1982: 80186 16-bit registers registers were named ax, bx, cx, etc. (x = "extended") 80286 1985: 80386 32-bit registers registers were named eax, ebx, ecx, etc. (e, x = "extended") much later... 64-bit registers: rax, rbx, etc. (r = register) + Notes on those experiments ... - mov vs. movl vs. movq movl -- l = long = 32 bits (I'm sorry, not the C "long") movq -- q = quad = 64 bits (still sorry) movb -- b = byte etc. eax = 32 bits (goes with l) rax = 64 bits (goes with q) - keep your eyes on eax vs. rax vs. ax etc. - Intel vs. AT&T notation - oh no, the documentation is backwards! + Look at the assignment + What's going on? - C compiles to machine language -