mirror of
https://github.com/pkimpel/retro-b5500.git
synced 2026-02-12 03:07:30 +00:00
Commit initial I/O Unit development.
This commit is contained in:
51
tools/RegisterTest.html
Normal file
51
tools/RegisterTest.html
Normal file
@@ -0,0 +1,51 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Register Module tests</title>
|
||||
<!-- Configure Dojo first -->
|
||||
<script>
|
||||
dojoConfig = {
|
||||
parseOnLoad: false,
|
||||
packages: [
|
||||
{name: "emu", location: "http://localhost/b5500"
|
||||
}
|
||||
],
|
||||
cacheBust: false
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- Load Dojo, Dijit, and DojoX resources from Google CDN -->
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js"></script>
|
||||
|
||||
<body>
|
||||
<pre id=pad>
|
||||
</pre>
|
||||
<script>
|
||||
require(["emu/Register", "dojo/dom", "dojo/domReady!"], function(reg) {
|
||||
var pad = document.getElementById("pad");
|
||||
var S = new reg.Register(15, 256);
|
||||
var A = new reg.LongRegister(48);
|
||||
|
||||
pad.innerHTML += "S=" + S.toString(8) + "\n";
|
||||
pad.innerHTML += "S.6=" + S.bit(6) + "\n";
|
||||
S.bitReset(8);
|
||||
pad.innerHTML += "S=" + S.toString(8) + "\n";
|
||||
S.insert(0, 9, 7);
|
||||
pad.innerHTML += "S=" + S.toString(8) + "\n";
|
||||
pad.innerHTML += "S.[6:3]=" + S.isolate(6, 3) + "\n";
|
||||
S.sub(449); // @701
|
||||
pad.innerHTML += "S=" + S.toString(8) + "\n";
|
||||
|
||||
|
||||
pad.innerHTML += "A=" + A.toString(8) + "\n";
|
||||
A.bitSet(45);
|
||||
pad.innerHTML += "A=" + A.toString(8) + "\n";
|
||||
pad.innerHTML += "A.45=" + A.bit(45) + "\n";
|
||||
A.insert(18, 15, 0x7fff);
|
||||
pad.innerHTML += "A=" + A.toString(8) + "\n";
|
||||
pad.innerHTML += "A.[30:4]=" + A.isolate(30,4) + "\n";
|
||||
A.sub(A.bits+1);
|
||||
pad.innerHTML += "A=" + A.toString(8) + "\n";
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user