Question: //using System; import java.util.Scanner; //import java.io.Console; //Create the class that would perform the simulation. public class Simulator public static void main(String[] args) //list of SML

 //using System; import java.util.Scanner; //import java.io.Console; //Create the class that would

//using System; import java.util.Scanner; //import java.io.Console; //Create the class that would perform the simulation. public class Simulator public static void main(String[] args) //list of SML instructions /*const int READ_INS = 10; const int WRITE_INS = 11; const int LOAD_INS = 20; const int STORE_INS = 21; const int ADD_INS = 30; const int SUBTRACT_INS = 31; const int MULTIPLY_INS = 32; const int DIVIDE_INS = 33; const int BRANCH_INS = 40; const int BRANCH_NEG_INS = 41; const int BRANCH_ZERO_INS = 42; const int HALT_INS = 43;*/ final int READ INS = 10; final int WRITE_INS = 11; final int LOAD_INS = 20; final int STORE_INS = 21; final int ADD_INS = 30; final int SUBTRACT_INS = 31; final int MULTIPLY_INS = 32; final int DIVIDE_INS = 33; final int BRANCH_INS = 40; final int BRANCH_NEG_INS = 41; final int BRANCH_ZERO_INS = 42; final int HALT_INS = 43; //variabes for storing the instruction and its details. int accumulator; int instruction Counter int op_oprnd; int op_Code; int instructionRegister; //simpletron memArray int[] memArray; /umber of instructions entered in memArray int index = 0; /* Method to run the simpletron simulator / public void Run Simulator // initialize the registers InitializeRegisters(); // Get the instructions from the user as input PrintInstructions(); Load Instructions(); //execute the program and display the memArray //dump when finished //using System; import java.util.Scanner; //import java.io.Console; //Create the class that would perform the simulation. public class Simulator public static void main(String[] args) //list of SML instructions /*const int READ_INS = 10; const int WRITE_INS = 11; const int LOAD_INS = 20; const int STORE_INS = 21; const int ADD_INS = 30; const int SUBTRACT_INS = 31; const int MULTIPLY_INS = 32; const int DIVIDE_INS = 33; const int BRANCH_INS = 40; const int BRANCH_NEG_INS = 41; const int BRANCH_ZERO_INS = 42; const int HALT_INS = 43;*/ final int READ INS = 10; final int WRITE_INS = 11; final int LOAD_INS = 20; final int STORE_INS = 21; final int ADD_INS = 30; final int SUBTRACT_INS = 31; final int MULTIPLY_INS = 32; final int DIVIDE_INS = 33; final int BRANCH_INS = 40; final int BRANCH_NEG_INS = 41; final int BRANCH_ZERO_INS = 42; final int HALT_INS = 43; //variabes for storing the instruction and its details. int accumulator; int instruction Counter int op_oprnd; int op_Code; int instructionRegister; //simpletron memArray int[] memArray; /umber of instructions entered in memArray int index = 0; /* Method to run the simpletron simulator / public void Run Simulator // initialize the registers InitializeRegisters(); // Get the instructions from the user as input PrintInstructions(); Load Instructions(); //execute the program and display the memArray //dump when finished

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!