CS208 Introduction to Computer Systems Wednesday, 22 October 2025 + Assembly questions - "I don't get what lea is for" - "What's going on with a(b,c,d)?" - "This whole thing is making my head hurt" - ...?... - Why? - Making a device that adds computer architecture electrical engineering digital logic - Making a device that does programmable computations computer architecture: datapath the instructions for these programs have to be arcane, fiddly combos of 1's and 0's these instructions, which physically drive the datapath to execute its program, are called "machine language" machine language is hard to work with - So, let's make synonyms of machine language instructions to make it easier for people to think about programs e.g., mov, add, jmp, etc. -- i.e., assembly language also need to write "assembler" -- i.e., a program that translates from assembly language to machine language - Later, since assembly language is also hard to think about, people develop higher-level languages. (1950s FORTRAN, COBOL, LISP, Algol,...). When you do this, you have to also write a compiler or an interpreter. - Why us and assembly? - How does it work? -- important for experts to know - Security -- buffer overflow, in particular - More understanding of layers of abstraction - It's fun - Flags: the EFLAGS register EFLAGS is 64 bits, and each bit represents some boolean memory addl $4, %eax Suppose this instruction results in a negative number. Then, it sets a bit in EFLAGS to 1 to indicate negativity - LEA, LEAL, LEAQ, etc. "load effective address" (ugh.) better "do a little arithmetic" (1) compute a number (2) put it somewhere + The system stack + Using gdb in assembly language + The next homework