# Assignment 3, due June 16

## Machine Problem 1, due June 18

### Machine Problem 1, due June 18

#### Modifications to EAL

Create a working directory called mp1, and then install the source code from

http://www.cs.uiowa.edu/~jones/syssoft/hw/mp0.txt

Having done this, note that the assembler, as currently configured, supports only the following forms of literals:

• decimal numbers, for example 99
• hexadecimal numbers, for example #FF
• numbers in other bases, for example 9#88 (in base 9)

These are, no doubt, useful, but some applications demand character literals. The following notation is widely accepted in other programming languages:

• character literals, for example '@'

Modify the lexical analyzer for EAL so that it accepts such literals. From the lexical standpoint, such a literal should be considered to be a number, where the value of the number is the ASCII representaton of the character. Fortunately, this is exactly the same interpretation of character values that C and C++ use, so you need no fancy translation tables to support this.

Make sure your modified version of EAL claims to be written by you and that it claims to be a solution to MP1 (by default, it claimed to be MP0). These are settings in the Makefile.

Make sure that all of your code conforms to the style guidelines

http://www.cs.uiowa.edu/~jones/syssoft/style.html
Pay close attention to indenting (depending on how you downloaded your code, tab-to-space conversion may have seriously damaged the indenting), and pay close attention to the commenting rules for documenting revisions. Specifically, use comments of the form /*MP1*/ to mark any line you added, and add an appropriate revision line to the header block of any file you change.

#### Testing

Write an EAL program that thoroughly tests your modified code, specifically, this should show that character literals work in various contexts (including in the context of expressions with various operators), it should test out a reasonable subset of the character set, and it should show what happens when you make incorrect use of character literals or when you make an error in their construction.

Comments and organization in test files are just as important as they are in the programs they test, so your test data should be well documented! Comments in the test data should document what is being tested and what the expected results of the test are.

#### Turn in

Paper listings of every file from the EAL source code that you changed (obviously, lexical.c will be one of these). and a paper listing of the listing file produced by EAL when it processes your test data.

### Assignment 3, due June 16

1. Write an EAL program that demonstrates the different forms of expressions supported by the EAL assembler distributed as MP0. To do this, you'll need to read the expression parser in parser.c.

2. Do problem 4 at the end of Chapter 2 of the notes.

3. Do problem 5 at the end of Chapter 2 of the notes.