Using C programming language write a program that simulates a variant of the Tiny Machine… 1 answer below »

The Problem Using C programming language write a program that simulates a variant of the Tiny Machine Architecture. In this implementation memory (RAM) is split into Instruction Memory (IM) and Data Memory (DM). Your code must implement the basic instruction set architecture (ISA) of the Tiny Machine Architecture: 1 ? LOAD 2 ? ADD 3 ? STORE 4 ? SUB 5 ? IN 6 ? OUT 7 ? END 8 ? JMP 9 ? SKIPZ Each piece of the architecture must be accurately represented in your code (Instruction Register, Program Counter, Memory Address Registers, Instruction Memory, Data Memory, Memory Data Registers, and Accumulator). Data Memory will be represented by an integer array. Your Program Counter will begin pointing to the first instruction of the program. For the sake of simplicity Instruction Memory (IM) and Data Memory (DM) may be implemented as separate arrays. Hint: Implementing a struct for your Instructions and an array of these structs as your Instruction Memory greatly simplifies this program. Example: typedef struct { int opCode, device Or Address; } Instruction; Instruction IM[MAXPROGRAMSIZE]; Note: IM, MDR1, and IR are of type Instruction. All other CPU registers and Data Memory (DM) are of type int. Input Specifications Your simulator must run from the command line with a single input file as a parameter to main. This file will contain a sequence of instructions for your simulator to store in “Instruction Memory” and then run via the fetch/execute cycle. In the input file each instruction is represented with two integers: the first one represents the opcode and the second one a memory address or a device number depending on the instruction.


"Is this question part of your assignment? We can help"