Question
Write a Java/C/Javascript program that will translate the Little Man Computer's instructions from input into machine code output. Please use the LMC Simulator to check
Write a Java/C/Javascript program that will translate the Little Man Computer's instructions from input into machine code output. Please use the LMC Simulator to check your output. The instructions of Little Man Computer are listed above, please review it. Your program need to:
1. Declare an array of two dimensions, 10 rows and 2 columns. Fill the array, the first column would be instruction, the second column will be the machine op code.
2. Take input one line at a time.
3. For each line, read the first three characters.
4. Loop through the array comparing the three characters with the data on the first column
5. get the second column data once you find the match in the first column.
6. Output the matched data.
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