-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cc
More file actions
43 lines (37 loc) · 702 Bytes
/
main.cc
File metadata and controls
43 lines (37 loc) · 702 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
31
32
33
34
35
36
37
38
39
40
41
42
#include "Headers.h"
extern Memory Mem;
extern Registers Reg;
int main (int argc,char * argv[])
{
DecodeExec CPU;
Fetch Fet;
if ( argc>1)
{
if (Fet.Open(argv[1])==false)
{
std::cerr<<"\nERROR :: File not loaded/not present";
return 1;
}
}
else
{
if (Fet.Open("test.txt")==false)
{
std::cerr<<"\nERROR :: File not loaded/not present";
return 1;
}
}
if (Fet.loadupmemory()==false)
return 2;
while (1)
{
CPU.QueryIR();
CPU.ResolveOPC();
if ( Reg.S == 1)
break;
}
//system("pause");
std::cout<<"\nPress Enter to Continue. . ."<<std::endl;
cin.get();
return 0;
}