- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
Latest commit
31 lines (25 loc) · 519 Bytes
/
Copy pathmain.cpp
File metadata and controls
31 lines (25 loc) · 519 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
#include<iostream>
#include<unistd.h>
#include"BUS.hpp"
#include"CPU.hpp"
#include"MEMORY.hpp"
#include"TYPE.hpp"
intmain(void)
{
BUS memBUS;
PORT ports[PORT_SIZE];
CPU cpu = CPU();
MEMORY memory = MEMORY();
cpu.connect_memory_BUS(&memBUS, &ports[0]);
memory.connect_BUS(&memBUS, &ports[1]);
printf("start computer\n");
cpu.reset();
for (int clock = 0; 1; clock++) {
// printf("clock: %d\n", clock);
getchar();
cpu.clock();
memory.Sync();
}
printf("end computer\n");
return0;
}