-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.html
196 lines (187 loc) · 8.42 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
<html>
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Droid+Sans" />
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Droid+Sans+Mono" />
<link rel="stylesheet" type="text/css" href="css/materialize.min.css" media="screen,projection"/>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css" />
<link rel="stylesheet" type="text/css" href="css/page.css" />
<link rel="stylesheet" type="text/css" href="css/codemirror.css" />
<link rel="stylesheet" type="text/css" href="css/dracula.css" />
<script type="text/javascript" src="js/codemirror.js"></script>
<script type="text/javascript" src="js/gas.js"></script>
<title>Online RISC-V Assembler</title>
<!-- Global -->
<link rel="canonical" href="https://riscvasm.lucasteske.dev/">
<meta name="author" property="author" content="Lucas Teske">
<meta name="description" property="description" content="RISC-V Online Assembler">
<!-- Open Graph -->
<meta name="og:locale" property="og:locale" content="en">
<meta name="og:type" property="og:type" content="article">
<meta name="og:title" property="og:title" content="RISC-V Online Assembler">
<meta name="og:url" property="og:url" content="https://riscvasm.lucasteske.dev/">
<meta name="og:image" property="og:image" content="https://riscvasm.lucasteske.dev/riscv-logo.png">
<meta name="og:site_name" property="og:site_name" content="RISC-V Online Assembler">
<meta name="og:description" property="og:description" content="RISC-V Online Assembler. This is a very crude online assembler for RISC-V assembly (all variants that gas supports)">
<!-- Twitter -->
<meta name="twitter:card" property="twitter:card" content="summary_large_image">
<meta name="twitter:title" property="twitter:title" content="RISC-V Online Assembler">
<meta name="twitter:site" property="twitter:site" content="@lucasteske">
<meta name="twitter:creator" property="twitter:creator" content="@lucasteske">
<meta name="twitter:description" property="twitter:description" content="RISC-V Online Assembler. This is a very crude online assembler for RISC-V assembly (all variants that gas supports)">
<meta name="twitter:image" property="twitter:image" content="https://riscvasm.lucasteske.dev/riscv-logo.png">
<meta name="twitter:image:alt" property="twitter:image:alt" content="RISC-V Foundation Logo">
</head>
<body>
<a class="github-fork-ribbon" href="https://github.com/racerxdl/riscv-online-asm" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
<nav class="light-blue lighten-1" role="navigation">
<div class="nav-wrapper container">
<a href="#" class="brand-logo">RISC-V Online Assembler</a>
</div>
</nav>
<div class="container" id="loading">
<p>Please wait while everything is loading</p>
<div class="progress">
<div class="indeterminate"></div>
</div>
</div>
<div class="container" id="content">
<div class="row">
<div class="col s6">
<p>Type the assembly code below and click <b>Build</b></p>
<form>
<div class="input-field">
<textarea id="sourceCodeBox">.global _boot
.text
_boot: /* x0 = 0 0x000 */
/* Test ADDI */
addi x1 , x0, 1000 /* x1 = 1000 0x3E8 */
addi x2 , x1, 2000 /* x2 = 3000 0xBB8 */
addi x3 , x2, -1000 /* x3 = 2000 0x7D0 */
addi x4 , x3, -2000 /* x4 = 0 0x000 */
addi x5 , x4, 1000 /* x5 = 1000 0x3E8 */
la x6, variable
addi x6, x6, 4
.data
variable:
.word 0xdeadbeef
</textarea>
</div>
</form>
</div>
<div class="col s6">
<p>Linker Script</b></p>
<form>
<div class="input-field">
<textarea id="linkerCodeBox">/* Thanks https://github.com/darklife/darkriscv */
__heap_size = 0x200; /* required amount of heap */
__stack_size = 0x800; /* required amount of stack */
MEMORY
{
ROM (rwx) : ORIGIN = 0x00000000, LENGTH = 0x10000
RAM (rwx) : ORIGIN = 0x00010000, LENGTH = 0x08000
}
SECTIONS
{
.text :
{
*(.boot)
*(.text)
*(.text)
*(.rodata*)
} > ROM
.data :
{
*(.sbss)
*(.data)
*(.bss)
*(.rela*)
*(COMMON)
} > RAM
.heap :
{
. = ALIGN(4);
PROVIDE ( end = . );
_sheap = .;
. = . + __heap_size;
. = ALIGN(4);
_eheap = .;
} >RAM
.stack :
{
. = ALIGN(4);
_estack = .;
. = . + __stack_size;
. = ALIGN(4);
_sstack = .;
} >RAM
}
</textarea>
</div>
</form>
</div>
</div>
<div style="text-align: center"><a href="#" class="btn" onClick="buildStuff(window.editor.getValue(), window.ldeditor.getValue())">Build</a></div>
<div class="container" id="building">
<p>Please wait while building</p>
<div class="progress">
<div class="indeterminate"></div>
</div>
</div>
<pre class="code code-res"><label>Console</label><code id="output">Waiting for build</code></pre>
<div class="divider"></div>
<p>
<pre class="code code-res"><label>Code<BR/>Hex Dump</label><code id="binaryBox">Waiting for build</code></pre>
<div class="divider"></div>
<pre class="code code-res"><label>Data<BR/>Hex Dump</label><code id="binaryDataBox">Waiting for build</code></pre>
<div class="divider"></div>
<pre class="code code-res"><label>Objdump Code<BR/>Disassembly</label><code id="objDumpBox">Waiting for build</code></pre>
<div class="divider"></div>
<pre class="code code-res"><label>Objdump<BR/>Full Hex</label><code id="objDumpFullBox">Waiting for build</code></pre>
<div class="divider"></div>
</p>
</div>
</div>
</div>
<!--JavaScript at end of body for optimized loading-->
<script data-main="js/app" src="js/require.js" async></script>
<script type="text/javascript" src="js/materialize.min.js" async></script>
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script>
<link rel="preload" href="js/as-new.wasm" as="script" crossorigin="anonymous">
<link rel="preload" href="js/objcopy.wasm" as="script" crossorigin="anonymous">
<link rel="preload" href="js/objdump.wasm" as="script" crossorigin="anonymous">
<link rel="preload" href="js/ld-new.wasm" as="script" crossorigin="anonymous">
<script>
$( document ).ready(() => {
$('i[rel="pre"]').replaceWith(function() {
return $('<pre><code>' + $(this).html() + '</code></pre>');
});
var pres = document.querySelectorAll('pre,kbd,blockquote');
for (var i = 0; i < pres.length; i++) {
pres[i].addEventListener("dblclick", function () {
var selection = getSelection();
var range = document.createRange();
range.selectNodeContents(this);
selection.removeAllRanges();
selection.addRange(range);
}, false);
}
$('#loading').hide();
$('#content').show();
window.editor = CodeMirror.fromTextArea(document.getElementById('sourceCodeBox'), {
lineNumbers: true,
theme:"dracula",
mode: {name: "gas", architecture: "riscv"},
});
window.ldeditor = CodeMirror.fromTextArea(document.getElementById('linkerCodeBox'), {
lineNumbers: true,
theme:"dracula",
mode: {name: "gas", architecture: "riscv"},
});
})
</script>
<!-- Cloudflare Web Analytics -->
<script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "6fdff3f05d2847b58d553381bb1e8115"}'></script>
<!-- End Cloudflare Web Analytics -->
</body>
</html>