|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcomputer.Instruction
public class Instruction
Represents an instruction cell in the memory of the toy computer. An instruction has an opcode and an operand. T he operand might not be used by every instruction
Field Summary | |
---|---|
private int |
opcode
|
private int |
operand
|
Constructor Summary | |
---|---|
Instruction(int operation,
int onWhat)
Create an insctuction cell that may be placed in the memory of a toy computer |
Method Summary | |
---|---|
int |
opcode()
Retrieve the opcode of this instruction |
int |
operand()
Retrieve the operand of this instruction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int opcode
private int operand
Constructor Detail |
---|
public Instruction(int operation, int onWhat)
operation
- the opcodeonWhat
- the operandMethod Detail |
---|
public int opcode()
public int operand()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |