blob: 9294d7d811d2842019e629322ad4d1b5daaab626 (
plain) (
tree)
|
|
#ifndef _CPU_H
#define _CPU_H
#include <stdint.h>
#include <stdbool.h>
#include "opc.h"
/* cpu traps */
enum {
TRP_UNALIGNED,
TRP_DIVBYZERO,
TRP_SYSCALL,
TRP_ILL,
};
void trap(int num);
/* stack pointer */
extern uint32_t SP;
/* base pointer */
extern uint32_t BP;
/* return value */
extern uint32_t RV;
/* instruction pointer */
extern uint32_t IP;
/* status bits */
extern bool N, Z;
/* general purpose registers */
extern uint32_t *GPR;
/* main cpu execution function */
void execute(inst_t IR);
#endif
|