263 lines
8.5 KiB
HTML
263 lines
8.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" class="no-tui-scroll">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>IA64 Main</title>
|
|
<script src="../dist/tuicss.min.js"></script>
|
|
<script src="../dist/jquery-2.2.0.min.js"></script>
|
|
<link rel="stylesheet" href="../dist/tuicss.min.css">
|
|
</head>
|
|
|
|
<body style="height: 100vh;">
|
|
<div class="tui-screen bordered tui-bg-blue-black" style="height: 100vh;">
|
|
|
|
<!-- Sidenav -->
|
|
<nav class="tui-sidenav absolute">
|
|
<ul>
|
|
<li>
|
|
<a href="/main.html">Main program <span class="tui-shortcut">F1</span></a>
|
|
</li>
|
|
<li>
|
|
<a href="/assembler.html">Assembler <span class="tui-shortcut">F2</span></a>
|
|
</li>
|
|
<li>
|
|
<a href="/debug.html">Debugger <span class="tui-shortcut">F3</span></a>
|
|
</li>
|
|
<li>
|
|
<a href="/index.html">Reboot <span class="tui-shortcut">F10</span></a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<!-- Navbar -->
|
|
<nav class="tui-nav absolute">
|
|
<span class="tui-datetime" data-format="h:m:s a"></span>
|
|
<ul>
|
|
<li class="tui-sidenav-button red-168-text">≡</li>
|
|
<li class="tui-dropdown">
|
|
<span class="red-168-text">F</span>ile
|
|
<div class="tui-dropdown-content">
|
|
<ul>
|
|
<li>
|
|
<a href="javascript:showmodal()">
|
|
<span class="red-168-text">L</span>oad Scenario
|
|
</a>
|
|
</li>
|
|
<div class="tui-black-divider"></div>
|
|
<li>
|
|
<a href="/main.html">
|
|
<span class="red-168-text">Q</span>uit
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</li>
|
|
<li class="tui-dropdown">
|
|
<span class="red-168-text">H</span>elp
|
|
<div class="tui-dropdown-content">
|
|
<ul>
|
|
<li>
|
|
<a href="javascript:showmodal()">
|
|
<span class="red-168-text">I</span>nterface
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<div id="modal" class="tui-window red-168 left-align" style="left: 40%; margin: 0px auto; top: 50%; z-index: 10; position: fixed; visibility:hidden">
|
|
<fieldset class="tui-fieldset">
|
|
<legend class="red-255 yellow-255-text">Alert</legend>
|
|
Function not implemented<br><br>
|
|
<div class="tui-divider"></div><br>
|
|
<button class="tui-button cyan-168 white-255-text tui-modal-close-button right" data-modal="modal" onclick="javascript:closemodal()">close</button>
|
|
</fieldset>
|
|
</div>
|
|
|
|
<!-- Edit panel -->
|
|
<div class="tui-window full-width tui-no-shadow" style="margin-top: 23px;height:90%">
|
|
<fieldset class="tui-fieldset" style="height:100%">
|
|
</fieldset>
|
|
</div>
|
|
|
|
<!-- Status bar -->
|
|
<div class="tui-statusbar relative">
|
|
<ul>
|
|
<li><a href="/index.html"><span class="red-168-text">F10</span> Reboot</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
|
|
function closemodal()
|
|
{
|
|
$("#modal").css("visibility","hidden");
|
|
}
|
|
|
|
function showmodal()
|
|
{
|
|
$("#modal").css("visibility","visible");
|
|
}
|
|
|
|
function setFilename(name){
|
|
$("#filename").html(name);
|
|
filename=name;
|
|
}
|
|
|
|
function toSyntax(atype)
|
|
{
|
|
$("#att").html(" ");
|
|
$("#intel").html(" ");
|
|
$("#nasm").html(" ");
|
|
$("#masm").html(" ");
|
|
$("#gas").html(" ");
|
|
if (atype=="att")
|
|
{
|
|
$("#att").html("√");
|
|
$("#syntax").html(" Syntax:AT&T ");
|
|
}
|
|
else if (atype=="intel")
|
|
{
|
|
$("#intel").html("√");
|
|
$("#syntax").html(" Syntax:Intel ");
|
|
}
|
|
else if (atype=="masm")
|
|
{
|
|
$("#masm").html("√");
|
|
$("#syntax").html(" Syntax:Masm ");
|
|
}
|
|
else if (atype=="gas")
|
|
{
|
|
$("#gas").html("√");
|
|
$("#syntax").html(" Syntax:Gas ");
|
|
}
|
|
else
|
|
{
|
|
$("#nasm").html("√");
|
|
$("#syntax").html(" Syntax:Nasm ");
|
|
}
|
|
syntax=atype;
|
|
}
|
|
|
|
function hexQword(value) {
|
|
value = value < 0 ? (value + 0x10000000000000000) : (value);
|
|
var str = '0000000000000000' + value.toString(16).toUpperCase();
|
|
return str.slice(-16);
|
|
};
|
|
|
|
function hexDword(value) {
|
|
value = value < 0 ? (value + 0x100000000) : (value);
|
|
var str = '00000000' + value.toString(16).toUpperCase();
|
|
return str.slice(-8);
|
|
};
|
|
|
|
function hexWord(value) {
|
|
value = value < 0 ? (value + 0x10000) : (value);
|
|
var str = '0000' + value.toString(16).toUpperCase();
|
|
return str.slice(-4);
|
|
};
|
|
|
|
function hexByte(value) {
|
|
value = value < 0 ? (value + 0x100) : (value);
|
|
var str = '00' + value.toString(16).toUpperCase();
|
|
return str.slice(-2);
|
|
};
|
|
|
|
function makebin(allzones)
|
|
{
|
|
var output = [];
|
|
for (const zone of allzones)
|
|
output.push(...zone.asm);
|
|
return new Uint8Array(output);
|
|
}
|
|
|
|
function dump(zone) {
|
|
var mcLen = zone.asm.length;
|
|
if (type=="binary")
|
|
var output = '<tr>';
|
|
else
|
|
var output = '';
|
|
switch (type) {
|
|
case 'binary':
|
|
var address=zone.offset;
|
|
for (var offset = 0; offset < mcLen; offset += 16) {
|
|
output += "<td>"+toHex(address,zone.code)+"</td><td>";
|
|
var ascii='';
|
|
for (var i = offset; i < offset + 16 && i < mcLen; i++) {
|
|
if (zone.asm[i]>31)
|
|
ascii += String.fromCharCode(zone.asm[i]);
|
|
else
|
|
ascii += '.';
|
|
output += hexByte(zone.asm[i]) + " ";
|
|
}
|
|
output += "</td><td>"+ascii+"</td></tr>";
|
|
address+=16;
|
|
}
|
|
break;
|
|
case 'array':
|
|
output += "const uint8_t "+zone.title+"[] = {\n";
|
|
for (var offset = 0; offset < mcLen; offset += 8) {
|
|
output += " ";
|
|
for (var i = offset; i < offset + 8 && i < mcLen; i++) {
|
|
output += "0x" + hexByte(zone.asm[i]) + ", ";
|
|
}
|
|
output = output.substring(0, output.length - 1);
|
|
output += "\n";
|
|
}
|
|
output = output.substring(0, output.length - 2);
|
|
output += "\n};\n";
|
|
break;
|
|
case 'string':
|
|
output += "const char* "+zone.title+" =\n";
|
|
for (var offset = 0; offset < mcLen; offset += 16) {
|
|
output += " \"";
|
|
for (var i = offset; i < offset + 16 && i < mcLen; i++) {
|
|
output += "\\x" + hexByte(zone.asm[i]);
|
|
}
|
|
output += "\"\n";
|
|
}
|
|
output = output.substring(0, output.length - 1);
|
|
output += ";\n";
|
|
break;
|
|
}
|
|
return output;
|
|
}
|
|
|
|
function showzones(zones)
|
|
{
|
|
table='<table class="tui-table striped-purple"><thead><tr><th>Id</th><th>Title</th><th>Offset</th><th>Size</th><th>Type</th><th>Compiled</th></tr></thead>';
|
|
for (const zone of zones)
|
|
table+="<tr><td align='right'>"+zone.id+"</td><td align='left'>"+zone.title+"</td><td align='right'>"+zone.realoffset+"</td><td align='right'>"+zone.asm.length+"</td><td align='right'>"+zone.code+"</td><td align='right'>"+(zone.asm.length>0)+"</td></tr>";
|
|
table+="</table>"
|
|
$("#result2").html(table);
|
|
}
|
|
|
|
function showstatus(text)
|
|
{
|
|
$("#status").html($("#status").html()+text+"<br>");
|
|
$("#status").scrollTop($("#status")[0].scrollHeight);
|
|
}
|
|
|
|
function showresult(text)
|
|
{
|
|
$("#result").html(text);
|
|
}
|
|
|
|
function toHex(hexa,code)
|
|
{
|
|
if (code==16)
|
|
result=hexWord(hexa);
|
|
else if (code==32)
|
|
result=hexDword(hexa);
|
|
else
|
|
result=hexQword(hexa);
|
|
return result;
|
|
}
|
|
|
|
</script>
|
|
</html>
|