Question
Identify the opcode and operand for the instruction 117. Explain what the instruction 117 does. How would we write this using mnemonics (dont forget that
- Identify the opcode and operand for the instruction 117.
- Explain what the instruction 117 does.
- How would we write this using mnemonics (dont forget that instruction requires both an opcode and an operand)?
This is the instruction set for the Little Man Computer by Dr. Stuart Madnick (Little Man Computer.). The opcode is 1 decimal digit; the operand is 2 decimal digits.
* XX refers to a memory address.
Instruction | Mnemonic | Opcode | Operand | Description |
Halt | HLT | 0 | 00 | Stop running |
Add | ADD | 1 | XX * | Add the contents of the memory address to the Accumulator |
Subtract | SUB | 2 | XX * | Subtract the contents of the memory address from the Accumulator |
Store | STA | 3 | XX * | Store the contents in the Accumulator in the memory address |
Load | LDA | 5 | XX * | Load Accumulator with contents of memory address |
Branch always | BRA | 6 | XX * | Set the PC to the value in the operand |
Branch if zero | BRZ | 7 | XX * | Set the PC to the operand if the Accumulator is zero |
Branch if zero or positive | BRP | 8 | XX * | Set the PC to the operand if the contents of the Accumulator is zero or positive |
Input | INP | 9 | 01 | Retrieve user input and store in the Accumulator |
Output | OUT | 9 | 02 | Output the contents of the Accumulator |
Data storage | DAT |
|
| Label for a memory address; also can have a contents specified |
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