Assignment 4, due Feb 17

Part of the homework for 22C:50, Spring 2003
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list!

Homework

Do problems 7 (1.0), 8 (1.0) and 11 (2.0) at the end of chapter 5 of the notes.

Machine Problem 2

Due February 21

Copy the material from your mp1 directory to a new directory, mp2. and, do the following:

a) Fix the lexical analyzer so it accepts underscore as a legal character within an identifier. This is a lightweight problem that will make you do a very localized job in the lexical analyzer.

b) Modify the assembler so it accepts and properly processes expressions with the grammar in Figure 5.8, but with the following change: The operators it accepts should be + and - (the usual arithmetic operators) plus & and |, defined for integers as they are in C and C++.

c) Write a test program that demonstrates that your code works.

Turn in listings of any source files you had to change, along with an assembly listing of your test program. All changes should be documented with comments indicating that they are additions for MP2. As with MP1, do not modify files in your mp2 directory after you turn in your work. We reserve the right to check the on-line copy of your work or to grade your work entirely on the basis of the on-line copy. Your on-line copy and the date-of-last-modification information for each file are insurance against lost or stolen paper copies, and the on-line date-stamp will be inspected if there is any suspicion of academic misconduct.