CS2340 Computer Architecture
Spring 2022

Instructor: John Cole
Section 005 Monday/Wednesday from 1:00 to 2:15
Office and Hours  Room: ECS West 1.315

Teaching Assistant: TBA

Last update: 3/17/2022
Syllabus is on Coursebook Schedule
Textbook: Computer Organization and Design, MIPS Version, sixth edition, by Patterson & Hennesey

Up to this point, all of your programmig courses have used high-level languages with many built-in functions, classes, and other constructs that hid the inner workings of the computer from you.  Those things are great, and make it easy to write code that focuses on the task at hand.  Consider, though, that someone had to write those library functions and the low-level drivers in the operating system, and often at least some of that is written in assembly language.  Also consider that if you are going to understand cybersecurity, this level of comprehension of how processors actually work is essential.  Thus the need for a course in how the computer actually works.  And besides, are you not curious as what is really going on inside the box?

You may have heard that your instructor has not taught computer architecture in this milennium, and that is true. However, I have written a great many programs in various assembly languages, starting with the Univac 1108 mainframe and, most recently, MIPS in preparation for teaching this course.  You may also be aware that at least once a year I give an introductory tutorial on x86 assembly language to the Computer Security Group.  Thus one of the unstated objectives is to teach you how to write good assembly code, not just hack together something that mostly works. This means, among other things:
  • Writing modules that assemble separately.
  • Using the .eqv directive so you don't have magic numbers in your code
  • Optimizing the use of registers to make your code run fast
  • Error handling
As with any course I teach, you will do a lot of programming, which is the only way to learn how to program. This course will also require considerable reading.  If you do not read the textbook, you will most likely fail the course.  Trying to slide by using only the PowerPoint slides is also a really bad idea. 

I will be taking attendance, and although it will not figure directly into your grade, I tend to be unsympathetic to poor students who miss a lot of classes.

Warning!  Warning! DO NOT TAKE THIS COURSE FROM THIS PROFESSOR!  Not unless you are willing to work hard, write moderately difficult programs, read the textbook, and ask questions in class.  Not that the other professors are much easier, but fair warning.  But if you want to not only meet the requirement of taking this course but become competent in writing assembly code, by all means, sign up.

Course Topics in Detail

This course will teach you how to understand and write programs in assembly language.  While this is specific to the MIPS processor, the general techniques will be applicable to most machines.  Topics include:

  1. Basic design of modern stored-program digital computers
  2. Numbering systems and numeric formats, including floating-point numbers represented in binary
  3. Instruction set architecture
  4. Register set
  5. Assembly-language directives (also called pseudo-operations)
  6. System calls for operating system functions
  7. Translation from C to assembly language
  8. Translation from assembly language to machine code
  9. Performance calculation
  10. Memory hierarchy
  11. Processor data path and pipelining
Assembly language coding conventions

1. Use tabs.  Labels should be in column 1.  Instructions and directives should be tabbed to column 10 or 11.  Operands should be tabbed to column 18.

2. Comments on individual instructions should be tabbed to about column 30, and on the same line, not the line above.

3. Do not indent assembly code.  There is no structuring the way you would structure C++ or Java, and it makes it less readable, not more

4. Use meaningful labels.  "Do" and "while" and "loop" are not meaningful.

5. Re-read the slides from Appendix A.

For more information, see Documentation Standards


Get the MIPS simulator here: http://courses.missouristate.edu/kenvollmar/mars/

Exam Rules