diff --git a/ibcm/ibcm.css b/ibcm/ibcm.css index 33a760477..400081a77 100644 --- a/ibcm/ibcm.css +++ b/ibcm/ibcm.css @@ -4,12 +4,65 @@ /* Created Day 01.12.2006 */ /* ======================================================== */ +* { + box-sizing: border-box; +} + +.grid { + display: grid; + grid-template-columns: 1fr 1fr; + row-gap: 1rem; +} + +.grid .settings { + grid-column: 1 / 3; +} + +.controls .internal { + position: sticky; + top: 1rem; +} + +.divider { + margin-top: 1.5rem; + margin-bottom: 1.5rem; +} + +.input-group { + display: grid; + margin-bottom: 1.5rem; + grid-template-columns: 1fr 1fr; +} + +.input-group label { + text-align: right; + margin-right: 0.5rem; +} + +.control-grid { + display: flex; + flex-direction: row; + justify-content: center; +} + +.control-grid button { + margin: 0 0.25rem; +} + +.output-group { + text-align: center; +} + +.output-group label { + display: inline-block; + margin-bottom: 0.5rem; +} + body { margin: 0px; background: url(img/top_bg.gif); background-repeat: repeat-x; font-family: Verdana, Arial, sans-serif; - font-size: .6em; } p { diff --git a/ibcm/simulator-worker.js b/ibcm/simulator-worker.js new file mode 100644 index 000000000..e69de29bb diff --git a/ibcm/simulator.html b/ibcm/simulator.html index aba770e94..699bc4696 100644 --- a/ibcm/simulator.html +++ b/ibcm/simulator.html @@ -29,128 +29,80 @@

IBCM Interface

-
+

Directions for how to use this simulator are available.

- - - - - - - - - - - - - -
-

- Load IBCM file: - -

-

-

-

- Load all of memory: - - (leave unchecked if unsure) -

-

- Enable watchdog timer: - - (check to guard against infinite loops) -

-

-
-
- - - - - - -
MemValuePC
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - +
+
+

+ Load IBCM file: + +

+

+

+

+ Load all of memory: + + (leave unchecked if unsure) +

+

+ Enable watchdog timer: + + (check to guard against infinite loops) +

+

+
+
+
-

Accumulator (hex):

-
 
  
-

PC (hex):

-
 
  
-

-

Breakpoint (4 digits):
-

-
 
  
+ - - + + + -
-

-

Input:
-

-
 MemValuePC
- -

 


 

- - - - - - - - - - -
- -

 

- -
- -

 

- - -

Output

- - - -
-
-
+ + + + +
+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + + + +
+
+
+ + +
+
+
+ + - diff --git a/ibcm/simulator.js b/ibcm/simulator.js index b0375fa2d..d29ba4df4 100644 --- a/ibcm/simulator.js +++ b/ibcm/simulator.js @@ -1,7 +1,7 @@ const INSTRUCTION_REGEX = /[a-fA-F0-9]{4}/; const WATCHDOG_MAX_LIMIT = 10000; -const instructions = []; +let instructions = []; let pc = "0000"; let pchexbak = "0000"; @@ -35,6 +35,8 @@ function readIBCMFile(event) { } function processIBCMFile(text) { + instructions = []; // Reset instructions array + const lines = text.split(/\r?\n/) // Split on newlines let currentLine = 0; // Zero-indexed indicator of which line we are parsing for (let line of lines) { @@ -67,15 +69,13 @@ function processIBCMFile(text) { } function create_ibcm_memory_table() { - let str = "\n"; const top = loadmemInput.checked ? 4096 : 100; for (let i = 0; i < top; i++) { const divname = i.toString(16).padStart(4, '0'); - str += "\n"; + const elem = ""; + document.getElementById("instructionsTable").getElementsByTagName('tbody')[0].innerHTML += elem; } - str += "
" + divname + "
" + divname + "
"; - document.getElementById("memtable").innerHTML = str; } function init() {