Instruction Set Simulator
The Instruction Set Simulator will work for the following set of Instructions:
|MOV Rn, direct
|MOV direct, Rn
|MOV @Rn, Rm
|MOV Rn, #immed
|ADD Rn, Rm
|SUB Rn, Rm
|JZ Rn, relative
Download all files and run make using the provided Makefile.
Run the simulator by typing at the command line: simm < input file >
- The < input file > should be a text file containing the binary
representations of the Instruction Set and their arguments. Example:
Assume Rn = 1 and direct = 1,
MOV Rn, direct -- must be: 0000000100000001
- Each instruction must be in a separate line.
- The first eight characters represent the first byte: MOV Rn
The second eight characters represent the second byte: direct
- If the second byte represents Rm ( register address ) then the first 4
characters will contain the information, example:
Rm = 3, then second byte = 00110000
- A test file ( fib.txt ) is provided to demonstrate how the simulator
works. The test file calculates the fibonacci number for 10.