// PID: 9DigitPidNoSpacesOrDashes // I pledge the COMP 211 honor code. #include #include #include "bit_utils.h" #include "instructions.h" // ------------------------------------ // Determines whether instruct is an // R-type or I-type instruction // // Arguments: an unsigned 32-bit integer // // Return: instruction_type: R_TYPE or I_TYPE (see structures) // instruction_type get_type_of_instruction(uint32_t instruct) { // TODO return NULL; } // end get_type_of_instruction() function // ------------------------------------ // Creates an R-type instruction // based on the integer given (see structures) // // Arguments: an unsigned 32-bit integer // // Return: a pointer to an r_instruction (see structures). // This consists of the following structure members // you will have to set: rs, rt, rd, shamt, func // r_instruction* create_r_instruction(uint32_t instruct) { // TODO return NULL; } // end create_r_instruction() function // ------------------------------------ // Creates an I-type instruction // based on the integer given (see structures) // // Arguments: an unsigned 32-bit integer // // Return: a pointer to an i_instruction (see structures). // This consists of the following structure members // you will have to set: opcode, rs, rt, immediate // i_instruction* create_i_instruction(uint32_t instruct) { // TODO return NULL; } // end create_i_instruction() function