Question
Use the Little Man Computer instruction set and the LMC Simulator : write a program that: 1. input 3 numbers 2. output the largest of
Use the Little Man Computer instruction set and the LMC Simulator: write a program that:
1. input 3 numbers
2. output the largest of the 3 numbers
Once you run your program, take a screen shot and submit the screenshot as your test result.
Helpful Information:
LMC Instruction set
Data movement:
o LOAD - op code 5 LDA
o STORE - op code 3 STA (STA)
Arithmetic:
o ADD - op code 1 (ADD) o SUBTRACT - op code 2 (SUB)
Input/Output:
o INPUT - op code 901 (INP)
o OUTPUT - op code 902 (OUT)
Machine/Program control:
o BRANCH - op code 6 (BRA)
o BRANCH ON ZERO - op code 7 (BRZ)
o BRANCH ON POSITIVE - op code 8 (BRP)
o BREAK - op code 0 (HLT)
Hint:
Play with the simulator, and learn how it works from the video first. Enter the program in the video into the LMC simulator and run it yourself.
The advanced video has more programs you can use.
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