CS计算机代考程序代写 data structure computer architecture mips /***************************************************************/

/***************************************************************/
/* */
/* MIPS Instruction Level Simulator */
/* */
/* CMSC-22200 Computer Architecture */
/* University of Chicago */
/* */
/***************************************************************/

/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/* DO NOT MODIFY THIS FILE! */
/* You should only change sim.c! */
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */

#ifndef _SIM_SHELL_H_
#define _SIM_SHELL_H_

#include
#define FALSE 0
#define TRUE 1

#define MIPS_REGS 32

typedef struct CPU_State_Struct {
uint32_t PC; /* program counter */
int32_t REGS[MIPS_REGS]; /* register file. */
int FLAG_N; /* negative flag or sign flag*/
int FLAG_Z; /* zero flag */
int FLAG_V; /* overflow flag */
int FLAG_C; /* carry flag */
} CPU_State;

/* Data Structure for Latch */

extern CPU_State CURRENT_STATE, NEXT_STATE;

extern int RUN_BIT; /* run bit */

uint32_t mem_read_32(uint32_t address);
void mem_write_32(uint32_t address, uint32_t value);

/* YOU IMPLEMENT THIS FUNCTION */
void process_instruction();

#endif