blob: 7f5ad675e8c62b5947bd90c1eb2b97376c237561 (
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
30
31
32
33
34
35
36
37
|
#include <cpu.h>
#include <mem.h>
#include <log.h>
#include <gui.h>
static struct cpu_interface cpu = {
.reg_names = gui_reg_names,
.reg_update = gui_reg_update,
.instr_push = gui_instr_push,
.instr_pop = gui_instr_pop,
};
static struct gui_interface gui = {
.step_next = cpu_next,
.step_prev = cpu_prev,
};
int main(int argc, char *argv[])
{
if (argc != 2) {
logln("invalid arguments");
return 1;
}
cpu_register_interface(&cpu);
cpu_exec(argv[1]);
/* while (cpu_next() == OK) */
/* ; */
gui_register_interface(&gui);
gui_init();
cpu_destroy();
mem_destroy();
return 0;
}
|