-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_um.h
More file actions
30 lines (23 loc) · 743 Bytes
/
run_um.h
File metadata and controls
30 lines (23 loc) · 743 Bytes
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
#include <stdio.h>
#include <stdint.h>
#include "seg.h"
#ifndef RUN_UM_INCLUDED
#define RUN_UM_INCLUDED
// used to break down instruction codes into its components
typedef struct Op_Instruction {
uint32_t opcode;
uint32_t a, b, c;
uint32_t value;
} Op_Instruction;
// loads the program into the zero segment
// this is ran first, as to gather the program into the
// zero seg for manipulation
extern void load_zero (FILE *stream, Segs memory);
// returns a struct containing instruction details
// such as opcode and register IDs
extern Op_Instruction get_opcode (uint32_t word);
// runs the universal machine
// makes calls to the execute module and
// and manages memory
extern void run (FILE *stream);
#endif