**Computer Organization and Assembly Language Programming**

Brian Parks (bparks AT vast DOT uccs DOT edu)

Office: ENGR 176 ("CS Graduate Students") or ENGR 148 (inside ENGR 149, VAST Lab)

Office Hours: TR 3:00 - 4:00 PM (after class) in ENGR 176 or by appointment

Syllabus: (pdf)

Emailed files should be named using the following syntax (all lowercase):

<last_name>_hw<#>.<extension>

The course catalog has the following to say about this course:

Provides an introduction to the concepts of computer architecture, functional logic, design and computer arithmetic. It presents material on the mechanics of information transfer and control within a computer system. Also included are symbolic programming techniques, implementing high level control structures, addressing modes and their relation to arrays, subprograms, parameters, linkage to high level languages and the assembly process. Prer., C S 1450 and C S 2060.

- December 6: Review for final exam.
- November 22: Final exam is scheduled for 13 December, 1:40 - 4:10 PM in ENGR 101
- November 22: Homework #11 is posted below.
- November 16: Homework #10 is posted.
- November 13: Reference implementation for Division MIPS
and
`atof()`

MIPS. - November 10: Homework #9 due at midnight tonight
- November 5: Homework #9 is posted.
- October 30: A simple implementation of
`atoi()`

in MIPS and a version of multiplication that uses it to process integers from the command line. - October 30: A working version of Factorial MIPS that was started in Thursday's class, as well as an implementation of Multiplication MIPS, both of which will be discussed in class on Tuesday.
- October 28: Yesterday's multiplication algorithm, division algorithm, and factorial C implementations. Homework 8 is also posted below.
- October 26: The base C program from yesterday's lecture.
- October 20: For Homework 7, implement the multiplication algorithm discussed in class and in Chapter 3 in C. Assume two decimal numbers will be provided as arguments on the command line and print ONLY the answer. Do not use the multiplication (*) operator. Use only bitshifts and addition (Hint: atoi() may be useful). Due October 27 at the beginning of class. Late submissions will not be accepted.
- October 7: A MIPS selection sort implementation comparable to the one done live in class
- September 28: Topics for midterm review.
- September 27: Today's selection sort implementation in C and an updated version of bubble sort MIPS.
*NO CLASS*6 October. - September 23: Yesterday's C bubble sort and corresponding MIPS implementation, along with a "perfect implementation" of Homework #4.
- September 20: Homework 5 is posted below.
- September 14: Yesterday's assembly program and pseudo-C for Homework 4
- September 13: Homework 4 posted below
- September 8: C file for homework 3
- September 1: Today's lecture notes and the first assembly language program.
- August 28: Homework #2 will comprise Exercises C.5, C.6, C.7, C.8 on page C-80, due 8 September.
- August 22: Handout on change of base and representing negative numbers. Corresponding homework. Homework is due 30 August.
- August 15: MARS (MIPS Assembler and Runtime Simulator) links:
[main
page]
[download]
[command line]

To create an alias in your environment on the CS UNIX machines suitable for use in this course, use `wget' to obtain the jar file, save it in ~/mars/, and add the following line to your .bashrc as demonstrated in class:alias mars='java -jar ~/mars/Mars_4_1.jar nc'

- May 14: Web site is up with some preliminary information

- Homework #1: (pdf) due 30 August.
- Homework #2: Exercises C.5, C.6, C.7, C.8 due 8 September.
- Homework #3: Find the issue in the C file. (1) Write short description of why it's an issue. (2) Submit a fixed version. Submit by email, with "CS2160 HW3" in the subject. Text is preferable. DO NOT SUBMIT A WORD DOCUMENT. Due 13 September.
- Homework #4: Write a MIPS Assembly program that calls a procedure to prompt
the user for their name and retrieve the string, then prints "Hello,
*name*." Email as before with "CS2160 HW4" in the subject. Due 20 September. - Homework #5: Exercises 1.3.1-3 and 1.4.1-5 (pp. 59, 60) due 27 September.
- Homework #6: Implement Selection Sort in MIPS (convert from C). Due 4 October.
- Homework #7: implement the multiplication algorithm discussed in class and in Chapter 3 in C. Assume two decimal numbers will be provided as arguments on the command line and print ONLY the answer. Do not use the multiplication (*) operator. Use only bitshifts and addition (Hint: atoi() may be useful). Due October 27 at the beginning of class. Late submissions will not be accepted.
- Homework #8: Convert the division algorithm C implementation to MIPS. For now, test with
hard-coded numbers. More details on how I will test the program will come Tuesday.
**Use command line arguments like in the updated multiplication MIPS and as discussed in lecture for the dividend and divisor.**Due November 3 at the beginning of class. Late submissions will not be accepted. - Homework #9: Extend the atoi MIPS implementation to account for floating point
(essentially, implement a stripped-down version of
`atof()`

). Program should take a single command-line argument, convert it to a floating-point representation in one of the "f" registers, and print it out using syscall 2 (print float). Program should be able to handle numbers like "3.14159" and "2.71828". Program should not attempt to process scientific notation. Submit as an attachment named appropriately. Due 10 November at midnight. Program will not be discussed in class. - Homework #10: Written. Due 22 November at the beginning of class in hard copy. Follow instructions from class 15 November, also posted here.
- Homework #11: Identify opportunities to optimize MSIL in this code. Hard copy due 29 November at the beginning of class.
- Homework #12: Instructions. Due at class time 8 December.

Dr. Shub's web site for this course from Spring 2011

Intel 64 and IA-32 Architectures Software Developer's Manuals