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

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!