A more conveniently reachable (for some) copy of some of the class slides and notes.
- Slides for week 1 lectures (architecture, SPLAB), course introduction (pdf), basic principles (pdf).
- Slides for week 2-3-4 lectures (architecture):
Introduction to computer architecture (pdf), and assembly language (example assembly code, and listing file).
Instruction formats and addressing modes (postscript, pdf).
Instruction categories (postscript, pdf).
- Slides for week 5-6, 8 lectures (architecture), misc low-level prgramming issues (postscript, pdf).
Example assembly code with macros, and resulting listing file.
- Slides for 2nd (week 7) talks for SP lab (Shell (pdf))
- Lecture (week 8) on co-routines (threads)(pdf)
Example co-routine code main.c and co.s.
- Week 9: Files used in class on position-independent code.
- Slides for 3rd (week 10) talk for SP lab (Data files, linking and loading) (pdf)
- Week 11: Introduction to hacking (slides not on-line for legal reasons).
- Slides for week 12: (chapter 2 only) from Patterson and Henessy on performance. See also Performance
- Slides for week 13: class on codes and communication, (pdf). More on Hamming codes.
- Week 14: Specs for lecture on IO programming: Example spec of UART, DMA controller, Disk controller.
Warning: these slides contain some errors, that were left in delibarately, to liven things up a bit in class.
- C examples
- function call
- Array code example: arr.s, main.c
- performance: lecture question solution performance_solutions.pdf
- For documentation on the x86 architecture, I (Mayer) catenated Intel's 3 volume set into this huge file. This is free, legally-distributed material, created and put out by Intel. I catenated their documents because I prefer one, large file. If you want to get the original 3 volume set (or smaller, 9 volumes), check out their website.
- Sample code in x86 assembly:
- Ackermann's function with optimized tail-calls
- A safe readline procedure that allocates memory dynamically
- A brief demonstration of how to use the XLATB instruction
- A brief demostration of how to use the MOVSB instruction
- A brief demonstration of how to use the STOSB instruction
- Converting hex to decimal
- A brief demonstration of the LOOP instruction: Factorial, iteratively
- A brief demonstration of how to access command-line arguments from assembly
- Read two-letter hex values in source string and output the corresponding ASCII string
- stdin, stdout, stderr are just variables that can be accessed via extern!
- A brief demonstration of counting in binary
- A brief demonstration of the gcd function
- A brief demonstration of self-modifying code in assembly
- The new Intel processors (Atom & later) support conversion between Big-Endian and Little-Endian with a single instruction! Check out the examples of using the cool new movbe and bswap instructions!
- An toy-version of printf implemented in assembly language.
- Some C code:
- A simple example of using fork(), exec(), signals Note that I'm not using the deprecated signal() function, but the more up-to-date and portable sigaction(). This is NOT what you are asked to use in your lab, but the idea is the same and the code is very similar.
- A simple example of using fork(), pipe(), dup2(), exec() to create a subprocess running the "bc" calculator (do "man bc" to read about it), and give it some math problems. For the code to work, you MUST have bc installed!