|
|
CS2340 Computer Architecture
|
|
Instructor: John Cole |
Section 005 Monday/Wednesday from 1:00 to 2:15 |
Office and Hours | Room: RH West 2.401 |
Teaching Assistant: None |
Last update: 12/23/2022 |
Syllabus is on Coursebook | Schedule |
Textbook: Computer Organization and
Design, MIPS Version, sixth edition, by
Patterson & Hennesey | |
Some consider this to be a difficult course, in part because of the low level of abstraction. It requires a lot of work and a different way of looking at computers and programming. On the plus side, your instructor is available outside of class, conducts review sessions, and is very knowledgeable and helpful. So get ready to work right down on the bare metal! Given the low level of abstraction, a 32-bit value represents exactly one thing: a 32-bit value. What it "means" is entirely up to you. It may be a counter, the address of the start of a list of numbers, a subroutine return address, anything. One of the things you will figure out quickly in this class is that if you don't understand C++ pointers you will be at a serious disadvantage. If you are not clear on binary arithmetic or basics like how many bits are in a byte, take some time to review. Up to this point, all of your programming 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, or the low-level drivers in the operating system, or the embedded code in your thermostat, 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 the details of computer architecture. And besides, are you not curious as what is really going on inside the box? As to background, 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:
Spend the time early in the semester when you are not as busy. Learn MIPS. Refresh yourself on the basics. Learn how to use your study time efficiently. It WILL pay off. This course will require at least 6 hours per week outside of the classroom. Since assembly language has no built-in functions the way Java and C++ do, you will have to write these. The good news is that if you write, say, a string copy function, you can reuse it if you need it in another assignment for this class. (You still can't use one someone else wrote.) 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. I begin every class with a breathing exercise to get you centered. If you are late, please do not disturb the class if we are in the middle of it. Wait until we are done to enter or to sit down, and make as little noise as possible. Some observations: There are three things which most students seem nto to know that are a serious problem in this class. If you are not intimately familiar with these concepts, now is a good time for a review. Scroll down for some videos I recorded. They are:
The Night Watch Interesting video on What's inside a .EXE file? Good explanation of what happens between compiling a high-level language program and running it, as well as why we have machine code at all. | |
Course Topics in DetailThis 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:
| |
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/ Some Mac users have had trouble getting MARS to run. Thanks to Josh Brown, a former student, we have this: You need to allow Full Disk Access in your System Preferences in macOS. Here they mention that you need to search for 'JavaLauncher.app'. This is an issue due to macOS changes with security management. To give Full Disk Access to JAR files on macOS: 1. Go to System Preferences.
|