blob: 43ccf0055396ab0516a67d0951c9c2ae8381fcb0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#ifndef _CPU_H
#define _CPU_H
#include <stdint.h>
#include <stdbool.h>
/* cpu traps */
enum {
TRP_UNALIGNED,
TRP_DIVBYZERO,
TRP_SYSCALL,
TRP_ILL,
};
void trap(int num);
/* program counter */
extern uint32_t PC;
/* status bits */
extern bool N, Z;
/* 32 general purpose registers */
extern uint32_t GPR[32];
/* main cpu execution function */
void execute(uint32_t IR);
#endif
|