-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
374 lines (318 loc) · 13.7 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--Imports-->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<script src="scripts/themes.js" defer></script>
<script src="scripts/colors.js" defer></script>
<script src="scripts/commands.js" defer></script>
<script src="scripts/lang.js" defer></script>
<script src="scripts/codes.js" defer></script>
<script src="scripts/main.js" defer></script>
<script src="scripts/setup.js" defer></script>
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="style.css">
<title>Little Man Computer</title>
</head>
<body>
<!--Header-->
<div class="toolbar hText">
<span class="title hText"> Little Man Computer</span>
<span class="spacer"></span>
<a href="javascript:Overlay()">
<span class="commands hText"></span>
</a>
<span class="spacer"></span>
<a href="https://github.com/xarss/LMC" target="_blank">
<span style="font-size: small; padding-right: 40px;" class="documentation hText"></span>
</a>
<span class="spacer"></span>
<a class="hText aboutus" href="https://github.com/xarss/LMC#about-us"></a>
<span class="spacer"></span>
<span class="version hText"></span><span class="hText">: 1.0 </span>
<span class="spacer"></span>
<span class="by hText"></span><span class="hText">:</span>
<a style="margin-left: 10px;" href="https://github.com/xarss" target="_blank" class="hText">
Guilherme Schwarz
</a>
<a style="margin-left: 10px;" href="https://github.com/tuzapeno" target="_blank" class="hText">
Arthur Salerno
</a>
<span class="spacer"></span>
<button id="portuguese" class="switch-left-inactive" onclick="setLang('portuguese')">
PT-BR
</button>
<button id="english" class="switch-right-active" onclick="setLang('english')">
EN-US
</button>
<span class="spacer"></span>
<button id="theme-button" class="material-symbols-outlined roundButton hText" onclick="changeTheme()">
light_mode
</button>
</div>
<!--Body-->
<div class="lmc">
<!--CPU-->
<div class="cpu">
<div class="cardHead">
<span class="cpuname"></span>
</div>
<!--Controls-->
<div class="cardHead">
<button class="material-symbols-outlined roundButton has-border" onclick="run()">
play_arrow
</button>
</div>
<!--Clockspeed-->
<div class="cardLine">
<span class="clockspeed tooltip" style="width: 45%; margin-left: 5%"><span class="tooltiptext clkExp"></span></span>
<div style="width: 50%;">
<input
type="range"
min="1"
max="10"
value="1"
step="1"
id="slider"
onchange="setClockSpeed()"
/>
<span id="current-clock-speed"></span>
</div>
</div>
<!--Accumulator-->
<div class="cardLine">
<span class="accumulator tooltip" style="width: 45%; margin-left: 5%;"> </span>
<input id="accum" value="000" class="clearInput" style="width: 50%; margin: 0 20px">
</div>
<!--PC, SIR, MAR & MDR-->
<table class="cpu-table">
<tbody>
<tr>
<th class="tooltip">PC <span class="tooltiptext pcExp"> </span></th>
<th class="tooltip">CIR<span class="tooltiptext cirExp"></span></th></th>
<th class="tooltip">MAR<span class="tooltiptext marExp"></span></th></th>
<th class="tooltip">MDR<span class="tooltiptext mdrExp"></span></th></th>
</tr>
<tr>
<td>
<div class="centered">
<input id="program-counter" value="000" class="clearInput">
</div>
</td>
<td>
<div class="centered">
<input id="current-instruction-register" value="000" class="clearInput">
</div>
</td>
<td>
<div class="centered">
<input id="memory-address-register" value="000" class="clearInput">
</div>
</td>
<td>
<div class="centered">
<input id="memory-data-register" value="000" class="clearInput">
</div>
</td>
</tr>
</tbody> </table>
<!--Terminal-->
<div class="cardHead texteditor"></div>
<div id="terminal" class="switch-active">
<!--Text Editor-->
<div class="cardFlow">
<textarea name="code"
id="code"
cols="30"
rows="10"
class="code"
defaultValue=""
spellcheck="false"></textarea>
</div>
</div>
<!--Console-->
<div class="cardHead">
<span> Console </span>
<button type="submit" onclick="conso.clear()" class="runButton clear"></button>
<button id="console-resize" class="material-symbols-outlined roundButton">
height
</button>
</div>
<div class="console">
<textarea name="code"
id="console"
cols="30"
rows="10"
class="code"
style="height: 50px;"
readonly>
</textarea>
</div>
<!--Input / Output-->
<div class="cardHead input"></div>
<input name="code" id="input" class="input-output" autocomplete="off" />
<div class="cardHead output"></div>
<input name="code" id="output" class="input-output" autocomplete="off" readonly>
<div class="cardHead">
<label class="curcode"></label>:
<select id="code-examples" onclick="getPreviousCode()" onchange="pasteCodeExample()">
<option value="custom" class="custom" selected></option>
<option value="add2" class="addtwonum"></option>
<option value="sort3" class="sortthree"></option>
<option value="countdown" class="countdown"></option>
<!--<option value="countdownALT">Countdown ALT</option>-->
</select>
</div>
</div>
<!--Cache & Pipeline-->
<div id="switch" class="switch">
<!--Cache-->
<div id="cache" class="switch-active">
<div class="cardHead">
<span class="usecache tooltip"></span>
<input class="useCache"
type="checkbox"
name="using-cache"
id="using-cache" />
</div>
<div class="cardHead">
<label>
<input type="radio" id="opcao" name="opcao" value="2" checked>
2
</label>
<label>
<input type="radio" id="opcao" name="opcao" value="4">
4
</label>
<label>
<input type="radio" id="opcao" name="opcao" value="8">
8
</label>
</div>
<!--Cache Table-->
<div class="cache">
<table id="cache-table" class="cache-table">
<tbody id="cache-body"></tbody>
</table>
<div id="no-cache">
<div class="cardHead nocache"></div>
</div>
</div>
<div class="cardHead">
<span class="cacheconsole"></span>
<button type="submit" onclick="clearCacheTerminal()" class="runButton clear"></button>
</div>
<!--Cache Console-->
<div style="height: 20%;">
<textarea name="code"
id="cache-console"
cols="30"
rows="10"
class="code"
readonly>
</textarea>
</div>
<!--Pipeline-->
<div class="cardHead">
<span class="usepipeline tooltip"></span>
<input class="usePipeline"
type="checkbox"
name="using-pipeline"
id="using-pipeline">
</div>
<div class="pipeline-steps">
<!--Fetch-->
<div class="step">
<div class="cardHead">
<div style="color:#cfbf6e">■</div> <span class="fetch tooltip"></span>
</div>
<div class="step-body">
<input class="pipeline-input" value="000" id="fetch-display" />
</div>
</div>
<!--Decode-->
<div class="step">
<div class="cardHead">
<div style="color:#464d7b">■</div> <span class="decode tooltip"></span>
</div>
<div class="step-body">
<input class="pipeline-input" value="000" id="decode-display" />
</div>
</div>
<!--Execute-->
<div class="step">
<div class="cardHead">
<div style="color:#467b49">■</div> <span class="execute tooltip"></span>
</div>
<div class="step-body">
<input class="pipeline-input" value="000" id="execute-display" />
</div>
</div>
<!--WriteBack-->
<div class="step">
<div class="cardHead">
<div style="color:#83558a">■</div> <span class="writeback tooltip"></span>
</div>
<div class="step-body">
<input class="pipeline-input" value="000" id="writeback-display" />
</div>
</div>
</div>
<div class="cardHead"></div>
</div>
</div>
<!--RAM-->
<div class="randomAcessMemory">
<div class="cardHead">
<span class="ramname tooltip"></span>
</div>
<div class="cardBody">
<table id="slots" class="ramTable"></table>
</div>
<div class="cardHead">
</div>
</div>
</div>
</body>
</html>
<!--Extras-->
<!--Overlay-->
<div id="overlay" class="overlay">
<div id="overlay-content" class="overlay-content">
<div class="toolbar">
<h2 class="commandlist"></h2>
<span class="spacer"></span>
<button class="material-symbols-outlined roundButton" onclick="Overlay()">
close
</button>
</div>
<table class="info-table">
<thead id="info-table-head">
</thead>
<tbody id="info-table-body">
</tbody>
</table>
</div>
</div>
<!--Inactives-->
<!--Color Picker-->
<!--
<span style="font-size: small;"> Color: </span>
<input type="color" id="colorPicker" value="#464d7b" onchange="changeColor()" class="color">
-->
<!--
<div style="color:#7b4657">■</div> <span class="updatecache"></span>
-->
<!--
<div class="halfRow">
</div>
<div class="halfRow">
</div>
-->