-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmicrode.mif
52 lines (47 loc) · 2.51 KB
/
microde.mif
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
DEPTH = 256;
WIDTH = 29;
ADDRESS_RADIX = HEX;
DATA_RADIX = BIN;
CONTENT
BEGIN
[0..FF] : 00000010000000000000000000000; -- blanket assignment: NOP, PCINC
10 : 01000000000000000000000010001; -- FETCH1: MAR <= PC
11 : 00001010000000000000000010010; -- FETCH2: DR <= M[MAR] PC <= PC + 1
12 : 00000000000000000100100000000; -- FETCH3: IR <= DR
00 : 00000000000000000000000010000; -- NOP1:
20 : 01000000000000000000000100001; -- LOAD1: MAR <= PC
21 : 00001010000000000000000100010; -- LOAD2: DR <= M[MAR] PC <= PC + 1
22 : 00100000000000000000000100011; -- LOAD3: MAR <= DR
23 : 00000010000000000000000100100; -- LOAD4: DR <= M[MAR]
24 : 00000000100000000000000010000; -- LOAD5: A <= DR
30 : 01000000000000000000000110001; -- STORE1: MAR <= PC
31 : 00001010000000000000000110010; -- STORE2: DR <= M[MAR] PC <= PC + 1
32 : 00100000000000000000000110011; -- STORE3: MAR <= DR
33 : 00000001000000000000000110100; -- STORE4: DR <= A
34 : 10000000000000000000000010000; -- STORE5: M[MAR] <= DR
40 : 00000000000000001000000010000; -- MOVE1: R <= A
50 : 00000000010000000000000010000; -- ADD1: A <= A+R
60 : 00000000001000000000000010000; -- XOR1: A <= A xor R
70 : 00000000000100000000000010000; -- TESTNZ1: Z <= V'
71 : 00000000000010000000000010000; -- TESTZ1: Z <= V
80 : 01000000000000000000010000001; -- JUMPX1: MAR <= PC
81 : 00000010000000000000010000010; -- JUMPX2: DR <= M[MAR]
82 : 00000000000000000010000010000; -- JUMPX3: PC <= DR
90 : 01000000000000000000010010001; -- JUMPZX1: MAR <= PC
91 : 00001010000000000000010010010; -- JUMPZX2: DR <= M[MAR] PC <= PC + 1
92 : 00000000000000000001000010000; -- JUMPZX3: IF(Z=1) THEN PC <= DR
B0 : 01000000000000000000010110001; -- LOADSPX1: MAR <= PC
B1 : 00001010000000000000010110010; -- LOADSPX2: DR <= M[MAR] PC <= PC + 1
B2 : 00000000000001000000000010000; -- LOADSPX3: SP <= DR
C0 : 00010000000000000000011000001; -- PEEK1: MAR <= SP
C1 : 00000010000000000000011000010; -- PEEK2: DR <= M[MAR]
C2 : 00000000100000000000000010000; -- PEEK3: A <= DR
D0 : 00000000000000100000011010001; -- PUSH1: SP <= SP-1
D1 : 00010001000000000000011010010; -- PUSH2: MAR <= SP DR <= A
D2 : 10000000000000000000000010000; -- PUSH3: M[MAR] <= DR
E0 : 00010000000000000000011100001; -- POP1: MAR <= SP
E1 : 00000010000000000000011100010; -- POP2: DR <= M[MAR]
E2 : 00000000100000000000011100011; -- POP3: A <= DR
E3 : 00000000000000010000000010000; -- POP4: SP <= SP+1
F0 : 00000100000000000000000010000; -- HALT: PC <= 0
END;