Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Now, let's walk through execution of the first SML instruction, + 1 0 0 9 in memory location oo . This procedure is called an
Now, let's walk through execution of the first SML instruction, in memory location oo
This procedure is called an instructionexecution cycle.
The instructionCounter tells us the location of the next instruction to be performed.
fetch the contents of that location from memory by using the Java statement
instructionRegister memory instructionCounter;
The operation code and the operand are extracted from the instruction register by the statements
operationCode instructionRegister ;
operand instructionRegister ;
Now the Simpletron must determine that the operation code is actually a read versus a write, a
load, and so on A switch differentiates among the operations of SML In the switch state.
ment, the behavior of various SML instructions is simulated as shown in Fig. We discuss
branch instructions shortly and leave the orhers to you.
rend:
Display the prompt "Enter an integer", then input the integer and store it
in location memory operand
load:
accumulator memory ;
add:
accumulator memoryoperand;
halt: Terminate the SML program's execution and display the following message:
Simpletron execution terminated
Fig. Behavior of several SML instructions in the Simpletron.
When the SML program completes execution, the name and contents of each register as well
as the complete contents of memory should be displayed. Such a printout is often called a com
puter dump no a computer dump is not a place where old computers go To help you program
your dump method, a sample dump format is shown in Fig. A dump after executing a
Simpletron program would show the actual values of instructions and data values at the moment
execution terminated.
REGISTERS :
MEMORY:
Fig. A sample dump.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started