[ RCOS.java Home | RCOS Home | David's Home ]

Instruction CRC

Name:

Instruction

Comment:

The following class defines an instruction, represented in both
  • undecoded binary form
  • decoded to identify
  • operation to do
  • registers to act on
  • any immediate operand value
  • Collaborators:

    Responsibilities:

    class Instruction {
      public:
        void Decode();      // decode the binary representation of the instruction
    
        unsigned int value; // binary representation of the instruction
    
        char opCode;     // Type of instruction.  This is NOT the same as the
                         // opcode field from the instruction: see defs in mips.h
        char rs, rt, rd; // Three registers from instruction.
        int extra;       // Immediate or target or shamt field or offset.
                         // Immediates are sign-extended.
    };