111 lines
3.5 KiB
HTML
111 lines
3.5 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<style>
|
|
body {
|
|
margin: 30px;
|
|
font-family: monospace;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h2>Text-mode Altair 8800 simulator</h2>
|
|
|
|
<hr>
|
|
|
|
<p>
|
|
<input type="button" value="INIT" onclick="init();">
|
|
<input type="button" value="TEST" onclick="test();">
|
|
<input type="button" value="RUN" onclick="run();">
|
|
<input type="button" value="STOP" onclick="stop();">
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
<p>LEDs: <!-- ● - on. ○ - off. -->
|
|
<div id="data-leds">
|
|
<p>
|
|
D7 D6 D5 D4 D3 D2 D1 D0<br>
|
|
<span id="d7" class="led">○</span>
|
|
<span id="d6" class="led">○</span>
|
|
<span id="d5" class="led">○</span>
|
|
<span id="d4" class="led">○</span>
|
|
<span id="d3" class="led">○</span>
|
|
<span id="d2" class="led">○</span>
|
|
<span id="d1" class="led">○</span>
|
|
<span id="d0" class="led">○</span>
|
|
</p>
|
|
</div>
|
|
<div id="address-leds">
|
|
<p>
|
|
A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0<br>
|
|
<span id="a15" class="led">○</span>
|
|
<span id="a14" class="led">○</span>
|
|
<span id="a13" class="led">○</span>
|
|
<span id="a12" class="led">○</span>
|
|
<span id="a11" class="led">○</span>
|
|
<span id="a10" class="led">○</span>
|
|
<span id="a9" class="led">○</span>
|
|
<span id="a8" class="led">○</span>
|
|
<span id="a7" class="led">○</span>
|
|
<span id="a6" class="led">○</span>
|
|
<span id="a5" class="led">○</span>
|
|
<span id="a4" class="led">○</span>
|
|
<span id="a3" class="led">○</span>
|
|
<span id="a2" class="led">○</span>
|
|
<span id="a1" class="led">○</span>
|
|
<span id="a0" class="led">○</span>
|
|
</p>
|
|
</div>
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
<p>CPU dump:
|
|
<div id="cpu"></div>
|
|
</p>
|
|
|
|
<hr>
|
|
|
|
<p>Memory dump:
|
|
<div id="mem"></div>
|
|
</p>
|
|
|
|
<script src="js/8080.js"></script>
|
|
<script src="js/sim8800.js"></script>
|
|
<script>
|
|
var dumpCpuElem = document.getElementById('cpu');
|
|
var dumpMemElem = document.getElementById('mem');
|
|
var sim = new Sim8800(256, 1000000,
|
|
dumpCpuElem, dumpMemElem);
|
|
|
|
function init() {
|
|
sim.loadDataAsHexString(0, 'db ff d3 ff c3 00 00');
|
|
sim.loadData(16, [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07]);
|
|
sim.dumpCpu();
|
|
sim.dumpMem()
|
|
}
|
|
|
|
function test() {
|
|
console.log(Sim8800.parseBits(10, 1));
|
|
console.log(Sim8800.parseBits(0xF8, 1));
|
|
console.log(Sim8800.parseBits(0xF0, 2));
|
|
}
|
|
|
|
function run() {
|
|
sim.loadDataAsHexString(0, 'db ff d3 ff c3 00 00');
|
|
sim.start();
|
|
sim.dumpCpu();
|
|
sim.dumpMem()
|
|
}
|
|
|
|
function stop() {
|
|
sim.stop();
|
|
sim.dumpCpu();
|
|
sim.dumpMem()
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|