-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexec.h
More file actions
23 lines (21 loc) · 743 Bytes
/
exec.h
File metadata and controls
23 lines (21 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
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#if __linux__
#include <string.h>
#else
#include <strings.h>
#endif
#include "structures.h"
int exec_code(symbol_table *code, int opt,short int mode);
short int hexToInt(char *hex);
int powz(int base, int exp);
int regNum(char reg);
int binToInt(char *bin);
short int numToInt(char *num);
short int lc2And(short int one, short int two);
void toCa2(short one, char *first);
void printRegisters(short int reg[], short int base,char cc);
char checkCC(short int result);
void printInstr(short int pc, short int base, symbol_table *code, short int shift);
const char opcodes[16][5]={"BR","ADD","LD","ST","JSR","AND","LDR","STR","RTI","NOT","LDI","STI","JSRR","RET","LEA","TRAP"};