-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
108 lines (99 loc) · 2.83 KB
/
index.html
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>8bit CPU Simulator</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="8b-asm-prism/highlight.css">
</head>
<body>
<div class="page-wrapper">
<div class="row">
<div class="column">
<h3>Enter your assembled code here:</h3>
<textarea id="asm-assembled-input"></textarea>
<br>
<div>
<input type="button" value="Run" id="run-btn" class="btn">
<input type="button" value="Reset" id="reset-btn" class="btn">
</div>
<div id="registers">
<div id="reg-0-div">
<h3>R0</h3>
<div class="reg-val">
<span class="reg-val-hex">0x00</span>
<input class="reg-val-dec editable" data-regid="0" value="0" type="text">
</div>
</div>
<div id="reg-1-div">
<h3>R1</h3>
<div class="reg-val">
<span class="reg-val-hex">0x00</span>
<input class="reg-val-dec editable" data-regid="1" value="0" type="text">
</div>
</div>
<div id="reg-2-div">
<h3>R2</h3>
<div class="reg-val">
<span class="reg-val-hex">0x00</span>
<input class="reg-val-dec editable" data-regid="2" value="0" type="text">
</div>
</div>
<div id="reg-3-div">
<h3>R3</h3>
<div class="reg-val">
<span class="reg-val-hex">0x00</span>
<input class="reg-val-dec editable" data-regid="3" value="0" type="text">
</div>
</div>
<div id="reg-inp-div">
<h3>INP</h3>
<div class="reg-val">
<span class="reg-val-hex">0x00</span>
<input class="reg-val-dec editable" data-regid="inp" value="0" type="text">
</div>
</div>
</div>
<div id="memory">
<h3>Memory</h3>
<table>
</table>
</div>
</div>
<div class="column">
<h3>Enter your assembly code here:</h3>
<div class="asm-highlight-parent">
<textarea id="asm-input" class="prism-textarea" spellcheck="false" oninput="update(this.value); sync_scroll(this);" onscroll="sync_scroll(this);" onkeydown="check_tab(this, event);"># Fib code displayed in R3
# multiple labels working :)
LI R0, 0x01 ; R0 = 1
LI R1, 0x01 ; R1 = 1
MOV R3, R1 ; R3 = R1
loop:
MOV R2, R0
ADD R2, R1
MOV R0, R1
MOV R1, R2
MOV R3, R2
JMP loop
end:
JMP end</textarea>
<pre id="highlighting" aria-hidden="true">
<code class="language-asm6502" id="highlighting-content">
</code>
</pre>
</div>
<br>
<div>
<button id="assemble-btn" class="btn">Assemble</button>
</div>
<h3>Copy your assembled code from here:</h3>
<textarea id="asm-output"></textarea>
</div>
</div>
</div>
<script src="8b-asm-prism/prism-asm.js"></script>
<script src="script.js" type="module"></script>
<script src="assembler.js" type="module"></script>
</body>
</html>