-
Notifications
You must be signed in to change notification settings - Fork 0
/
registry.h
66 lines (49 loc) · 1.37 KB
/
registry.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
/**
* @file registry.h
* @breif main header file containing structs #define statements and any functions that have to do with filling registrys
* @author Elijah Johnson
* @date 11/15/16
* @bug none known
*/
#ifndef _REGISTRY_H
#define _REGISTRY_H
#define MALLOC 1000
#define SIZE 4096
#define MAX_WORD_SIZE 64
#define MIN_WORD_SIZE 1
#define INVALID_ENTRY 8008 /*defines used for errors and checking values */
#define ADDITION 1
#define SUBTRACTION 2
#define OR 3
#define AND 4
#define XOR 5
struct bit_t {
unsigned char n;
struct bit_t *next;
struct bit_t *prev;
};
struct cpu_t {
int word_size;
int unsign;
int overflow;
int carry;
int sign;
int parity;
int zero;
struct bit_t *r1_head;
struct bit_t *r1_tail;
struct bit_t *r2_head;
struct bit_t *r2_tail;
struct bit_t *r3_head;
struct bit_t *r3_tail;
};
void insert_tail(struct bit_t **tail, struct bit_t *node);
void fill_registry_tail(char *exprssion, struct bit_t **head, struct bit_t **tail, int word_size);
void fill_registry_head(char *exprssion, struct bit_t **head, struct bit_t **tail, int word_size);
struct bit_t *create_node(unsigned char n);
void insert_head(struct bit_t **head, struct bit_t *node);
#endif