Homework 5
A Simulator for the LC-1: an LC-3 Assembly Language Program

Due on Tuesday, December 11, 2007 at 11:59 pm

Outcomes

After successfully completing this assignment, you will be able to...

Before Starting

Read Chapters 9 and 10.

Description of Problem

(This is adapted from a programming assignment written by Yale Patt, University of Texas at Austin.)

In this assignment, you will write a simulator for a machine called the LC-1, using LC-3 assembly language instructions.

The LC-1 ISA

The LC-1 is an accumulator-based architecture (i.e. there is only one register, referred to as the "accumulator"). Since there is only one register, there is no need to explicitly specify the accumulator in an LC-1 instruction.

The LC-1 ISA specifies eight instructions, described below. Three bits in the instruction, bits <15:13>, are used to represent the opcode. The remaining 13 bits, bits <12:0>, may be used to represent a 13-bit address.

The memory space being simulated contains 2^^13 locations, and the addressibility is 16 bits. The addressing mode is direct. (So, for example, if an instruction contains the bits 0 0000 0000 1100 in its address field, word 12 (decimal) of the program would be accessed.)

The LC-1 ISA has one condition register which is modified by three of the eight instructions: ADD, SUBTRACT, and LOAD. The condition register is set when a negative value is stored in the accumulator, otherwise, it is cleared.

LC-1 Instruction Set

Design Considerations

Documentation Guidelines

Follow the same documentation guidelines as you did for HW4. In addition, subroutines should come with their own documentation including a list of inputs and outputs, and a brief description of the subroutine's purpose.

Deliverables

Name your file simulator.asm. Turn in your file using web-based turnin.