LC-3b Assembler and Micro-Architecture Emulator

A C-based simulator for LC-3b assembly programming language

Background

Little Computer 3b, or LC-3b, is a type of computer educational assembly language (low level programming language). It features a relatively simple instruction set, but can be used to write moderately complex assembly programs, and is a theoretically viable target for a C compiler. The language is less complex than x86 assembly but has many features similar to those in more complex languages.

Note

This project involved building an assembler in C for the LC-3b instruction set. Since this is an educational project currently used by many universities around US for teaching computer architecture, I will not release the source code openly which I developed to solve this problem. If you are interested to learn more about this solution from an experienced developer standpoint or just a curious individual, you can let me know. If you are currently a student in any class which uses this, I will not release the source code to you.

Summary

This project was developed in 4 stages:

  1. LC-3b Assembler - Translates assembly language source code into the machine language (ISA) of the LC-3b.
  2. Instruction Simulator - Takes as input a file which is an assembled LC-3b program. The simulator then executes the input LC-3b program, one instruction at a time, modifying the architectural state of the LC-3b after each instruction. The simulator is partitioned into two main sections: the shell and the simulation routines.
  3. Cycle-Level Simulator - A cycle-level simulator for the LC-3b. The simulator takes two inputs: a file entitled ucode3 which holds the control store, and a file which is an assembled LC-3b program. The simulator executes the input LC-3b program, using the microcode to direct the simulation of the microsequencer, datapath, and memory components of the LC-3b.
  4. Pipelined Simulator - The final part of the simulator involved building a pipelined simulator for the LC-3b instruction set which executes the program in a parallel/pipelined fashion.