forked from lowesyang/Assembler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
144 lines (143 loc) · 4.88 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>汇编器</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
<div class="container">
<h1>汇编指令</h1>
<textarea id="input">
ADD $t0,$a0,$zero
ADD $t0,$t0,$a0
SUB $t1,$t0,$a0
SW $t1,16($t2)
LW $t2,16($t2)
</textarea>
<form>
<p>命令(回车键执行)</p>
<input type="text" id="order" placeholder="R/D/U/A/T">
<button type="submit" id="submitBtn"></button>
<ul>
<li>D-数据方式看内存</li>
<li>U-指令方式看内存</li>
<li>A-写汇编指令到内存中</li>
<li>T-单步执行内存中的指令</li>
</ul>
</form>
<table width="300" height="300">
<caption>程序运行中自动监视所有寄存器</caption>
<tr>
<td>$zero</td>
<td>$at</td>
<td>$v0</td>
<td>$v1</td>
<td>$a0</td>
<td>$a1</td>
</tr>
<tr>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
</tr>
<tr>
<td>$a2</td>
<td>$a3</td>
<td>$t0</td>
<td>$t1</td>
<td>$t2</td>
<td>$t3</td>
</tr>
<tr>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
</tr><tr>
<td>$t4</td>
<td>$t5</td>
<td>$t6</td>
<td>$t7</td>
<td>$s0</td>
<td>$s1</td>
</tr>
<tr>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
</tr><tr>
<td>$s2</td>
<td>$s3</td>
<td>$s4</td>
<td>$s5</td>
<td>$s6</td>
<td>$s7</td>
</tr>
<tr>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
</tr><tr>
<td>$t8</td>
<td>$t9</td>
<td>$k0</td>
<td>$k1</td>
<td>$gp</td>
<td>$sp</td>
</tr>
<tr>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
</tr><tr>
<td>$fp</td>
<td>$ra</td>
<td>$pc</td>
<td>$hi</td>
<td>$lo</td>
</tr>
<tr>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><input type="text" class="register" value="0"/></td>
<td><button type="button" class="submitReg">保存</button></td>
</tr>
</table>
<br>
<button type="button" class="compile">编译</button>
<button type="button" class="run">执行</button>
<button id="clearBtn">重置</button>
<div class="subCon">
<div class="result">
<p>机器码</p>
<div class="mcCode"></div>
</div>
<div class="pointer"></div>
<div class="result">
<p>反汇编指令</p>
<div class="deComp"></div>
</div>
<div class="orderRes"></div>
</div>
</div>
<script src="assembler.js"></script>
<script src="order.js"></script>
</body>
</html>