Question

Suppose a certain computer has ten registers and a maximum of 1000 words of RAM. Each register or RAM location holds a three-digit integer between 0 and 999. Instructions are encoded

as three-digit integers and stored in RAM. The instruction set includes: 100 means halt 2dn means set register d to the value n 3dn means multiply register d by the value n 4dn means add the value n to register d 5ds means set register d to the value in register s 6ds means multiply register d by the value in register s 7ds means add the value in register s to register d 8da means set register d to the value in RAM whose address is in register a 9sa means set the value in RAM whose address is in register a to that of register s Ods means go to the location in register d unless register s contains 0 All registers should initially contain 000. The initial content of RAM is read from an input file. The first instruction to be executed is at RAM address 0. All arithmetic results are reduced modulo 1000 (the remainder upon division by 1000 ... j.e. three- digit values). Write a program in Java which reads the contents of an input file (ie a program containing three-digit integer instructions), interprets the program, and (at program conclusion) outputs the values of the registers and the number of instructions executed (including the halt instruction) - see output example. Input files may consist of up to 1000 three-digit unsigned integers, representing the contents of consecutive RAM Locations starting at 6. Unspecified RAM locations are initialized to 000. Note that multiple input data sets will require you to execute your program multiple times. You are encouraged to create additional program inputs for supplemental testing of your assignment. Be sure to follow the techniques of good programming style and use extensive comments to provide for internal documentation of your source program. You will be required to separately provide your source program file(s), your input data files, and your output files (or screenshots of the output) via Canvas submission. Please submit these deliverables on or before the assignment due date./n

Question image 1Question image 2