LC-3b Project Source Code

Stage 1 - LC-3b Assembler

Translates assembly language source code into the machine language (ISA) of the LC-3b.

Download stage1-assembler.c

Stage 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.

Download stage2-lc3bsim2.c

Stage 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.

Download stage3-lc3bsim3.c

Stage 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.

Download stage4-pipelinedlc3bsim4.zip