-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpu.py
More file actions
39 lines (27 loc) · 814 Bytes
/
cpu.py
File metadata and controls
39 lines (27 loc) · 814 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
class CPU:
def __init__(self):
self.pc = bytearray(2)
self.l = bytearray(2)
self.stack = [] # .append for push, .pop for
self.V0 = bytearray(1)
self.V1 = bytearray(1)
self.V2 = bytearray(1)
self.V3 = bytearray(1)
self.V4 = bytearray(1)
self.V5 = bytearray(1)
self.V6 = bytearray(1)
self.V7 = bytearray(1)
self.V8 = bytearray(1)
self.V9 = bytearray(1)
self.VA = bytearray(1)
self.VB = bytearray(1)
self.VC = bytearray(1)
self.VD = bytearray(1)
self.VE = bytearray(1)
self.VF = bytearray(1)
def instruction():
pass
#Fetch
instruction_first_byte = 1
instruction_second_byte = 1
#Decode / Execute