diff --git a/out/css/style.css b/out/css/style.css index c4d42f6..e9ff81c 100644 --- a/out/css/style.css +++ b/out/css/style.css @@ -1,571 +1,30 @@ -/* COLORS */ -body { - background-color: var(--color-body); - color: var(--color-body-text); +.noscript { + box-sizing: border-box; + width: 100vw; + height: 100vh; + display: flex; + justify-content: center; + align-items: center; } -.pc .addressbus { - background-color: var(--color-addressbus); - color: var(--color-addressbus-text); +.spacer { + height: 3rem; + width: 100%; } -.pc .databus { - background-color: var(--color-databus); - color: var(--color-databus-text); +.hidden { + display: none !important; } -.pc .ram { - background-color: var(--color-ram); - color: var(--color-ram-text); +section.fullheight { + min-height: 100vh; } -.pc .cu { - background-color: var(--color-cu); - color: var(--color-cu-text); +footer{ + margin-top: 20rem; } -.pc .alu { - background-color: var(--color-alu); - color: var(--color-alu-text); -} - -.pc .section h1.header { - background-color: var(--color-header); - color: var(--color-header-text); -} - - -/* TABLE COLORS */ -.pc .ram .scroller table thead.head th { - background-color: var(--color-table-ram-head); - color: var(--color-table-ram-head-text); -} - -.pc .cu .scroller table thead.head th { - background-color: var(--color-table-cu-head); - color: var(--color-table-cu-head-text); -} - -.pc .scroller table tr td { - background-color: var(--color-table-row); - color: var(--color-table-text); - border-bottom: 1px solid var(--color-table-border); -} - -.pc .scroller table tr:nth-child(even) td{ - background-color: var(--color-table-row-alt); -} - -.pc .scroller table tr.empty td { - color: var(--color-table-text-empty); -} - -.pc .ram .scroller table tr.current td { - background-color: var(--color-table-ram-highlight); - color: var(--color-table-ram-highlight-text); -} - -.pc .cu .scroller table tr.current td { - background-color: var(--color-table-cu-highlight); - color: var(--color-table-cu-highlight-text); -} - - -/* CONTROLS COLORS */ -.controls button, .controls .button { - /* background-color: whitesmoke; */ - color: var(--color-controls-button-text); - border-color: var(--color-controls-button-border); -} -.controls button:hover, .controls .button:hover{ - color: var(--color-controls-button-text-hover); -} - -.pc .controls .checker::before { - border: 1px solid var(--color-controls-button-border); -} - -.pc .controls .checker.checked::before { - color: var(--color-controls-button-text); -} - - - -/* FORMATTING STUFF */ - -button { - margin: 0; -} - -.pc { - height: 400px; - height: 99vh; - - box-sizing: border-box; - - padding: 1em; - - display: grid; - grid-template-columns: auto auto auto; - /* grid-template-columns: max-content auto max-content; */ - gap: 9px; -} - -.pc .grid-fullwidth{ - grid-column: 1 / span 3; -} - -.pc .section { - min-height: 25em; - max-height: calc(80vh - 8em); - min-width: 20%; - - box-sizing: border-box; - padding: 2.5em 1em 1em 1em; - - display: flex; - flex-direction: column; - - position: relative; - /*top: 0; - left: 0;*/ -} - -.pc .section h1.header { - font-size: 1.2em; - position: absolute; - top: 3px; - left: 4px; - padding: 3px; -} - -.pc .row { - display: flex; - justify-content: space-evenly; -} - -.pc .scroller { - overflow-x: auto; - overflow-y: scroll; - - /*position: relative;*/ - - /* max-height: 60%; */ - padding: 0; - box-sizing: border-box; - - width: 100%; - margin: 1em 0 0 0; -} - -.pc .scroller:last-child { - margin-bottom: -1em; -} - -.pc .scroller table { - margin: 0; -} - -.pc .scroller table thead.head { - position: sticky; - top: -2px; - left: 0; - height: 1em; - padding: 1em; - - transition: 0.2s; -} - -.pc .scroller table thead th { - position: -webkit-sticky; - position: sticky; - top: 0; -} - -.pc .scroller table thead.head.shrunk { - height: .5em; - font-size: .8em; -} - -.pc .scroller table thead.head th { - padding: 12px 4px 12px 15px; - transition: 0.2s; -} - -.pc .scroller table thead.head.shrunk th { - padding-top: .2em; - padding-bottom: .2em; -} - -.pc .scroller table .num { - text-align: right; -} - -.pc .scroller table td:first-child, -.pc .scroller table td:last-child { - padding: 12px 15px; -} - -.pc .scroller table tr.empty td { - padding: 3px 15px; -} - -.pc .scroller table tbody button:last-child { - text-decoration: none; - text-transform: none; - height: max-content; - line-height: 2em; - font-weight: normal; - font-size: inherit; - padding: 0px 10px; -} - -th.address { - width: 5rem; - padding-left: 8px; - text-align: right; -} - -.pc input[type=number] { - margin: 0 .5em 0 0; - padding: 0 .25em; - height: 1.5em; - line-height: 1em; -} - -/* CONTROLS */ -.pc .controls button, -.pc .controls .button{ - text-transform: none !important; - font-weight: 600; - height: 2.5em; - line-height: 1em; - margin: 0; - vertical-align: top; - padding: 0.25em 2em; -} - -.pc .controls > :not(:last-child) { - margin-right: 0.75em; -} - -.pc .controls .checker { - display: inline-flex; - align-items: center; - padding-left: 3em; -} - -.pc .controls .checker label { - display: inline; - /*font-size: 0.8em;*/ - white-space: initial; - white-space: break-spaces; - text-transform: none; - width: 6em; - width: min-content; - vertical-align: middle; - line-height: .9em; - - margin: 0; - - cursor: pointer; -} - -.pc .controls input[type=checkbox]{ - display: none; - margin-left: -1em; - margin-right: 1em; - opacity: 0; - z-index: 0; -} - -.pc .controls .checker::before{ - content: "✔"; - display: inline-block; - width: 2rem; - height: 2rem; - color: rgba(0,0,0,0); - border-radius: 4px; - vertical-align: middle; - margin: 0 .5em 0 -1em; - - line-height: 1.8rem; - font-size: 1.4em; - - box-sizing: border-box; -} - -/* END CONTROLS */ -/* RAM */ - -.pc .ram .scroller { - /* height: 100%; */ - /* padding: 0.2em; */ - box-sizing: border-box; -} - -.pc .ram .scroller table { - width: 100%; -} - -.pc .ram input[type=number] { - background-color: var(--color-table-ram-select); - color: var(--color-table-ram-select-text); - border-color: var(--color-table-ram-select-border); -} - -.pc .ram input[type=number].instruction { - width: 5em; -} - -.pc .ram input[type=number].address { - width: 7em; -} - -.pc .ram table tr td:nth-child(2){ - text-align: left; -} - -.pc .ram .scroller table tbody button:last-child{ - background-color: var(--color-table-ram-select); - color: var(--color-table-ram-select-text); - border-color: var(--color-table-ram-select-border); -} - - -/* CONTROL UNIT */ - -.pc .cu p { - margin: 0 0 .2em 0; -} - -.pc .cu .scroller table { - width: 100%; -} - -.pc .cu .input-row { - display: flex; - justify-content: space-between; - align-items: baseline; - margin: 0 0 .5em 0; -} - -.pc .cu .input-row:last-child { - margin: 0; -} - -.pc .cu input { - color: var(--color-cu-text); - border-color: var(--color-cu-text); - background-color: transparent; -} - -.pc .cu label { - display: inline; -} - -.pc .cu select{ - margin: 0; - width: 100%; - - background-color: var(--color-table-cu-select); - color: var(--color-table-cu-select-text); - border: 1px solid var(--color-table-cu-select-border); -} - -.pc .cu .scroller table tbody button:last-child { - background-color: var(--color-table-cu-select); - color: var(--color-table-cu-select-text); - border: 1px solid var(--color-table-cu-select-border); -} - -/* ALU */ -.pc .alu input { - color: var(--color-alu-text); - border-color: var(--color-alu-text); - background-color: transparent; -} - -/* BUSSES */ - -.pc .databus, -.pc .addressbus{ - /*position: relative;*/ - text-align: left; - - margin: 0; - padding: .75em .5em; -} - -.pc .databus .label, -.pc .addressbus .label { - /* position: absolute; */ - /* left: .5em; */ - margin-right: 1em; -} - -.pc .addressbus input { - color: var(--color-addressbus-text); - border-color: var(--color-addressbus-text); - background-color: var(--color-addressbus); -} - -.pc .databus input { - color: var(--color-databus-text); - border-color: var(--color-databus-text); - background-color: var(--color-databus); -} - -.pc .addressbus { - margin-bottom: 1em; -} - -.pc .databus { - margin-top: 2em; -} - -/* ARROWS */ -.arrow { - position: absolute; - bottom: 0; - left: 50%; - - display: flex; - justify-content: center; - align-items: center; - - width: 3rem; - height: 5rem; - - /* transform: rotate(90deg) translate(1.5rem, 2.5rem) ; */ - transform: translate(0, 3rem); - z-index: 100; - - font-size: 0.5em; - color: var(--color-arrow-text); - background-color: var(--color-arrow); -} - -.arrow.down { - left: 25%; -} - -.arrow.up { - left: 75%; - transform: rotate(180deg) translate(0, -4.5rem); -} -.arrow.up > :nth-child(1){ - /* transform: rotate(90deg) translate(0rem, 2rem); */ - transform: rotate(180deg); -} - -.arrow.up.arrow2 { - left: 50%; -} - -.arrow.top { - bottom: auto; - top: -6rem; -} - - -.arrow > :nth-child(1) { - font-size: 1.2em; - line-height: 1.1em; - font-weight: 600; - color: var(--color-arrow-text); - background-color: var(--color-arrow); - border-color: var(--color-arrow-text); - text-transform: none; - padding: 2px 10px; - margin: 0; - /* transform: rotate(-90deg) translate(0rem, -2rem); */ - - white-space: normal; - height: min-content; -} - -.arrow > :nth-child(1) *{ - color: var(--color-arrow-text); - display: block; - white-space: break-spaces; -} - -.arrow > :nth-child(1):hover, .arrow > :nth-child(1) *:hover { - color: var(--color-arrow-text-hover); -} - -.arrow > :nth-child(2) { - width: 0; - height: 0; - - border-left: 2.5rem solid transparent; - border-right: 2.5rem solid transparent; - border-top: 2rem solid var(--color-arrow); - border-bottom: 0rem solid transparent; - - position: absolute; - left: -1rem; - bottom: -2rem; - -} - - -/* MODALS */ -.modal { - position: fixed; - top: 0; - left: 0; - z-index: 1000; - - box-sizing: border-box; - width: 100vw; - height: 100vh; - - display: flex; - align-items: center; - justify-content: center; -} -.modal.hidden { - display: none; -} - -.modal-card { - z-index: 1500; - display: block; - width: 40em; - min-width: 45vw; - min-height: 5em; - position: relative; - box-sizing: border-box; - - padding: 2.5em 2em 1em 2em; - - background-color: var(--color-modal); - color: var(--color-modal-text); -} - -.modal > :first-child { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - - background-color: var(--color-modal-shadow); -} - -.modal .modal-close { - position: absolute; - top: .5em; - right: .5em; - -} - -.modal .modal-close::before { - content: "❌"; -} diff --git a/out/elm.js b/out/elm.js index 2401ca9..b17ffcc 100644 --- a/out/elm.js +++ b/out/elm.js @@ -77,7 +77,7 @@ function A9(fun, a, b, c, d, e, f, g, h, i) { return fun.a === 9 ? fun.f(a, b, c, d, e, f, g, h, i) : fun(a)(b)(c)(d)(e)(f)(g)(h)(i); } -console.warn('Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets.'); + // EQUALITY @@ -113,7 +113,7 @@ function _Utils_eqHelp(x, y, depth, stack) return true; } - /**/ + /**_UNUSED/ if (x.$ === 'Set_elm_builtin') { x = $elm$core$Set$toList(x); @@ -126,7 +126,7 @@ function _Utils_eqHelp(x, y, depth, stack) } //*/ - /**_UNUSED/ + /**/ if (x.$ < 0) { x = $elm$core$Dict$toList(x); @@ -161,7 +161,7 @@ function _Utils_cmp(x, y, ord) return x === y ? /*EQ*/ 0 : x < y ? /*LT*/ -1 : /*GT*/ 1; } - /**/ + /**_UNUSED/ if (x instanceof String) { var a = x.valueOf(); @@ -170,10 +170,10 @@ function _Utils_cmp(x, y, ord) } //*/ - /**_UNUSED/ + /**/ if (typeof x.$ === 'undefined') //*/ - /**/ + /**_UNUSED/ if (x.$[0] === '#') //*/ { @@ -203,17 +203,17 @@ var _Utils_compare = F2(function(x, y) // COMMON VALUES -var _Utils_Tuple0_UNUSED = 0; -var _Utils_Tuple0 = { $: '#0' }; +var _Utils_Tuple0 = 0; +var _Utils_Tuple0_UNUSED = { $: '#0' }; -function _Utils_Tuple2_UNUSED(a, b) { return { a: a, b: b }; } -function _Utils_Tuple2(a, b) { return { $: '#2', a: a, b: b }; } +function _Utils_Tuple2(a, b) { return { a: a, b: b }; } +function _Utils_Tuple2_UNUSED(a, b) { return { $: '#2', a: a, b: b }; } -function _Utils_Tuple3_UNUSED(a, b, c) { return { a: a, b: b, c: c }; } -function _Utils_Tuple3(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } +function _Utils_Tuple3(a, b, c) { return { a: a, b: b, c: c }; } +function _Utils_Tuple3_UNUSED(a, b, c) { return { $: '#3', a: a, b: b, c: c }; } -function _Utils_chr_UNUSED(c) { return c; } -function _Utils_chr(c) { return new String(c); } +function _Utils_chr(c) { return c; } +function _Utils_chr_UNUSED(c) { return new String(c); } // RECORDS @@ -264,11 +264,11 @@ function _Utils_ap(xs, ys) -var _List_Nil_UNUSED = { $: 0 }; -var _List_Nil = { $: '[]' }; +var _List_Nil = { $: 0 }; +var _List_Nil_UNUSED = { $: '[]' }; -function _List_Cons_UNUSED(hd, tl) { return { $: 1, a: hd, b: tl }; } -function _List_Cons(hd, tl) { return { $: '::', a: hd, b: tl }; } +function _List_Cons(hd, tl) { return { $: 1, a: hd, b: tl }; } +function _List_Cons_UNUSED(hd, tl) { return { $: '::', a: hd, b: tl }; } var _List_cons = F2(_List_Cons); @@ -499,12 +499,12 @@ var _JsArray_appendN = F3(function(n, dest, source) // LOG -var _Debug_log_UNUSED = F2(function(tag, value) +var _Debug_log = F2(function(tag, value) { return value; }); -var _Debug_log = F2(function(tag, value) +var _Debug_log_UNUSED = F2(function(tag, value) { console.log(tag + ': ' + _Debug_toString(value)); return value; @@ -530,12 +530,12 @@ function _Debug_todoCase(moduleName, region, value) // TO STRING -function _Debug_toString_UNUSED(value) +function _Debug_toString(value) { return ''; } -function _Debug_toString(value) +function _Debug_toString_UNUSED(value) { return _Debug_toAnsiString(false, value); } @@ -720,13 +720,13 @@ function _Debug_toHexDigit(n) // CRASH -function _Debug_crash_UNUSED(identifier) +function _Debug_crash(identifier) { throw new Error('https://github.com/elm/core/blob/1.0.0/hints/' + identifier + '.md'); } -function _Debug_crash(identifier, fact1, fact2, fact3, fact4) +function _Debug_crash_UNUSED(identifier, fact1, fact2, fact3, fact4) { switch(identifier) { @@ -784,11 +784,11 @@ function _Debug_crash(identifier, fact1, fact2, fact3, fact4) function _Debug_regionToString(region) { - if (region.start.line === region.end.line) + if (region.X.L === region.ab.L) { - return 'on line ' + region.start.line; + return 'on line ' + region.X.L; } - return 'on lines ' + region.start.line + ' through ' + region.end.line; + return 'on lines ' + region.X.L + ' through ' + region.ab.L; } @@ -1212,7 +1212,7 @@ function _Char_toLocaleLower(char) -/**/ +/**_UNUSED/ function _Json_errorToString(error) { return $elm$json$Json$Decode$errorToString(error); @@ -1616,11 +1616,11 @@ var _Json_encode = F2(function(indentLevel, value) return JSON.stringify(_Json_unwrap(value), null, indentLevel) + ''; }); -function _Json_wrap(value) { return { $: 0, a: value }; } -function _Json_unwrap(value) { return value.a; } +function _Json_wrap_UNUSED(value) { return { $: 0, a: value }; } +function _Json_unwrap_UNUSED(value) { return value.a; } -function _Json_wrap_UNUSED(value) { return value; } -function _Json_unwrap_UNUSED(value) { return value; } +function _Json_wrap(value) { return value; } +function _Json_unwrap(value) { return value; } function _Json_emptyArray() { return []; } function _Json_emptyObject() { return {}; } @@ -1857,9 +1857,9 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) return _Platform_initialize( flagDecoder, args, - impl.init, - impl.update, - impl.subscriptions, + impl.aR, + impl.a2, + impl.a0, function() { return function() {} } ); }); @@ -1872,7 +1872,7 @@ var _Platform_worker = F4(function(impl, flagDecoder, debugMetadata, args) function _Platform_initialize(flagDecoder, args, init, update, subscriptions, stepperBuilder) { var result = A2(_Json_run, flagDecoder, _Json_wrap(args ? args['flags'] : undefined)); - $elm$core$Result$isOk(result) || _Debug_crash(2 /**/, _Json_errorToString(result.a) /**/); + $elm$core$Result$isOk(result) || _Debug_crash(2 /**_UNUSED/, _Json_errorToString(result.a) /**/); var managers = {}; var initPair = init(result.a); var model = initPair.a; @@ -2316,7 +2316,7 @@ function _Platform_setupIncomingPort(name, sendToApp) // -function _Platform_export_UNUSED(exports) +function _Platform_export(exports) { scope['Elm'] ? _Platform_mergeExportsProd(scope['Elm'], exports) @@ -2337,7 +2337,7 @@ function _Platform_mergeExportsProd(obj, exports) } -function _Platform_export(exports) +function _Platform_export_UNUSED(exports) { scope['Elm'] ? _Platform_mergeExportsDebug('Elm', scope['Elm'], exports) @@ -2377,10 +2377,10 @@ var _VirtualDom_init = F4(function(virtualNode, flagDecoder, debugMetadata, args { // NOTE: this function needs _Platform_export available to work - /**_UNUSED/ + /**/ var node = args['node']; //*/ - /**/ + /**_UNUSED/ var node = args && args['node'] ? args['node'] : _Debug_crash(0); //*/ @@ -2635,24 +2635,24 @@ function _VirtualDom_noInnerHtmlOrFormAction(key) return key == 'innerHTML' || key == 'formAction' ? 'data-' + key : key; } -function _VirtualDom_noJavaScriptUri_UNUSED(value) +function _VirtualDom_noJavaScriptUri(value) { return /^javascript:/i.test(value.replace(/\s/g,'')) ? '' : value; } -function _VirtualDom_noJavaScriptUri(value) +function _VirtualDom_noJavaScriptUri_UNUSED(value) { return /^javascript:/i.test(value.replace(/\s/g,'')) ? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")' : value; } -function _VirtualDom_noJavaScriptOrHtmlUri_UNUSED(value) +function _VirtualDom_noJavaScriptOrHtmlUri(value) { return /^\s*(javascript:|data:text\/html)/i.test(value) ? '' : value; } -function _VirtualDom_noJavaScriptOrHtmlUri(value) +function _VirtualDom_noJavaScriptOrHtmlUri_UNUSED(value) { return /^\s*(javascript:|data:text\/html)/i.test(value) ? 'javascript:alert("This is an XSS vector. Please use ports or web components instead.")' @@ -2704,9 +2704,9 @@ var _VirtualDom_mapEventTuple = F2(function(func, tuple) var _VirtualDom_mapEventRecord = F2(function(func, record) { return { - message: func(record.message), - stopPropagation: record.stopPropagation, - preventDefault: record.preventDefault + x: func(record.x), + Y: record.Y, + V: record.V } }); @@ -2974,11 +2974,11 @@ function _VirtualDom_makeCallback(eventNode, initialHandler) // 3 = Custom var value = result.a; - var message = !tag ? value : tag < 3 ? value.a : value.message; - var stopPropagation = tag == 1 ? value.b : tag == 3 && value.stopPropagation; + var message = !tag ? value : tag < 3 ? value.a : value.x; + var stopPropagation = tag == 1 ? value.b : tag == 3 && value.Y; var currentEventNode = ( stopPropagation && event.stopPropagation(), - (tag == 2 ? value.b : tag == 3 && value.preventDefault) && event.preventDefault(), + (tag == 2 ? value.b : tag == 3 && value.V) && event.preventDefault(), eventNode ); var tagger; @@ -3928,15 +3928,15 @@ var _Browser_element = _Debugger_element || F4(function(impl, flagDecoder, debug return _Platform_initialize( flagDecoder, args, - impl.init, - impl.update, - impl.subscriptions, + impl.aR, + impl.a2, + impl.a0, function(sendToApp, initialModel) { - var view = impl.view; - /**_UNUSED/ + var view = impl.a4; + /**/ var domNode = args['node']; //*/ - /**/ + /**_UNUSED/ var domNode = args && args['node'] ? args['node'] : _Debug_crash(0); //*/ var currNode = _VirtualDom_virtualize(domNode); @@ -3964,12 +3964,12 @@ var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, deb return _Platform_initialize( flagDecoder, args, - impl.init, - impl.update, - impl.subscriptions, + impl.aR, + impl.a2, + impl.a0, function(sendToApp, initialModel) { - var divertHrefToApp = impl.setup && impl.setup(sendToApp) - var view = impl.view; + var divertHrefToApp = impl.W && impl.W(sendToApp) + var view = impl.a4; var title = _VirtualDom_doc.title; var bodyNode = _VirtualDom_doc.body; var currNode = _VirtualDom_virtualize(bodyNode); @@ -3977,12 +3977,12 @@ var _Browser_document = _Debugger_document || F4(function(impl, flagDecoder, deb { _VirtualDom_divertHrefToApp = divertHrefToApp; var doc = view(model); - var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.body); + var nextNode = _VirtualDom_node('body')(_List_Nil)(doc.aJ); var patches = _VirtualDom_diff(currNode, nextNode); bodyNode = _VirtualDom_applyPatches(bodyNode, currNode, patches, sendToApp); currNode = nextNode; _VirtualDom_divertHrefToApp = 0; - (title !== doc.title) && (_VirtualDom_doc.title = title = doc.title); + (title !== doc.aA) && (_VirtualDom_doc.title = title = doc.aA); }); } ); @@ -4038,12 +4038,12 @@ function _Browser_makeAnimator(model, draw) function _Browser_application(impl) { - var onUrlChange = impl.onUrlChange; - var onUrlRequest = impl.onUrlRequest; + var onUrlChange = impl.aU; + var onUrlRequest = impl.aV; var key = function() { key.a(onUrlChange(_Browser_getUrl())); }; return _Browser_document({ - setup: function(sendToApp) + W: function(sendToApp) { key.a = sendToApp; _Browser_window.addEventListener('popstate', key); @@ -4059,9 +4059,9 @@ function _Browser_application(impl) var next = $elm$url$Url$fromString(href).a; sendToApp(onUrlRequest( (next - && curr.protocol === next.protocol - && curr.host === next.host - && curr.port_.a === next.port_.a + && curr.aq === next.aq + && curr.ah === next.ah + && curr.an.a === next.an.a ) ? $elm$browser$Browser$Internal(next) : $elm$browser$Browser$External(href) @@ -4069,13 +4069,13 @@ function _Browser_application(impl) } }); }, - init: function(flags) + aR: function(flags) { - return A3(impl.init, flags, _Browser_getUrl(), key); + return A3(impl.aR, flags, _Browser_getUrl(), key); }, - view: impl.view, - update: impl.update, - subscriptions: impl.subscriptions + a4: impl.a4, + a2: impl.a2, + a0: impl.a0 }); } @@ -4141,17 +4141,17 @@ var _Browser_decodeEvent = F2(function(decoder, event) function _Browser_visibilityInfo() { return (typeof _VirtualDom_doc.hidden !== 'undefined') - ? { hidden: 'hidden', change: 'visibilitychange' } + ? { aP: 'hidden', aK: 'visibilitychange' } : (typeof _VirtualDom_doc.mozHidden !== 'undefined') - ? { hidden: 'mozHidden', change: 'mozvisibilitychange' } + ? { aP: 'mozHidden', aK: 'mozvisibilitychange' } : (typeof _VirtualDom_doc.msHidden !== 'undefined') - ? { hidden: 'msHidden', change: 'msvisibilitychange' } + ? { aP: 'msHidden', aK: 'msvisibilitychange' } : (typeof _VirtualDom_doc.webkitHidden !== 'undefined') - ? { hidden: 'webkitHidden', change: 'webkitvisibilitychange' } - : { hidden: 'hidden', change: 'visibilitychange' }; + ? { aP: 'webkitHidden', aK: 'webkitvisibilitychange' } + : { aP: 'hidden', aK: 'visibilitychange' }; } @@ -4232,12 +4232,12 @@ var _Browser_call = F2(function(functionName, id) function _Browser_getViewport() { return { - scene: _Browser_getScene(), - viewport: { - x: _Browser_window.pageXOffset, - y: _Browser_window.pageYOffset, - width: _Browser_doc.documentElement.clientWidth, - height: _Browser_doc.documentElement.clientHeight + aw: _Browser_getScene(), + aC: { + aE: _Browser_window.pageXOffset, + aF: _Browser_window.pageYOffset, + aD: _Browser_doc.documentElement.clientWidth, + ag: _Browser_doc.documentElement.clientHeight } }; } @@ -4247,8 +4247,8 @@ function _Browser_getScene() var body = _Browser_doc.body; var elem = _Browser_doc.documentElement; return { - width: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), - height: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) + aD: Math.max(body.scrollWidth, body.offsetWidth, elem.scrollWidth, elem.offsetWidth, elem.clientWidth), + ag: Math.max(body.scrollHeight, body.offsetHeight, elem.scrollHeight, elem.offsetHeight, elem.clientHeight) }; } @@ -4271,15 +4271,15 @@ function _Browser_getViewportOf(id) return _Browser_withNode(id, function(node) { return { - scene: { - width: node.scrollWidth, - height: node.scrollHeight + aw: { + aD: node.scrollWidth, + ag: node.scrollHeight }, - viewport: { - x: node.scrollLeft, - y: node.scrollTop, - width: node.clientWidth, - height: node.clientHeight + aC: { + aE: node.scrollLeft, + aF: node.scrollTop, + aD: node.clientWidth, + ag: node.clientHeight } }; }); @@ -4309,18 +4309,18 @@ function _Browser_getElement(id) var x = _Browser_window.pageXOffset; var y = _Browser_window.pageYOffset; return { - scene: _Browser_getScene(), - viewport: { - x: x, - y: y, - width: _Browser_doc.documentElement.clientWidth, - height: _Browser_doc.documentElement.clientHeight + aw: _Browser_getScene(), + aC: { + aE: x, + aF: y, + aD: _Browser_doc.documentElement.clientWidth, + ag: _Browser_doc.documentElement.clientHeight }, - element: { - x: x + rect.left, - y: y + rect.top, - width: rect.width, - height: rect.height + aM: { + aE: x + rect.left, + aF: y + rect.top, + aD: rect.width, + ag: rect.height } }; }); @@ -4365,25 +4365,25 @@ var _Http_toTask = F3(function(router, toTask, request) return _Scheduler_binding(function(callback) { function done(response) { - callback(toTask(request.expect.a(response))); + callback(toTask(request.ad.a(response))); } var xhr = new XMLHttpRequest(); xhr.addEventListener('error', function() { done($elm$http$Http$NetworkError_); }); xhr.addEventListener('timeout', function() { done($elm$http$Http$Timeout_); }); - xhr.addEventListener('load', function() { done(_Http_toResponse(request.expect.b, xhr)); }); - $elm$core$Maybe$isJust(request.tracker) && _Http_track(router, xhr, request.tracker.a); + xhr.addEventListener('load', function() { done(_Http_toResponse(request.ad.b, xhr)); }); + $elm$core$Maybe$isJust(request.aB) && _Http_track(router, xhr, request.aB.a); try { - xhr.open(request.method, request.url, true); + xhr.open(request.aS, request.S, true); } catch (e) { - return done($elm$http$Http$BadUrl_(request.url)); + return done($elm$http$Http$BadUrl_(request.S)); } _Http_configureRequest(xhr, request); - request.body.a && xhr.setRequestHeader('Content-Type', request.body.a); - xhr.send(request.body.b); + request.aJ.a && xhr.setRequestHeader('Content-Type', request.aJ.a); + xhr.send(request.aJ.b); return function() { xhr.c = true; xhr.abort(); }; }); @@ -4394,13 +4394,13 @@ var _Http_toTask = F3(function(router, toTask, request) function _Http_configureRequest(xhr, request) { - for (var headers = request.headers; headers.b; headers = headers.b) // WHILE_CONS + for (var headers = request.af; headers.b; headers = headers.b) // WHILE_CONS { xhr.setRequestHeader(headers.a.a, headers.a.b); } - xhr.timeout = request.timeout.a || 0; - xhr.responseType = request.expect.d; - xhr.withCredentials = request.allowCookiesFromOtherDomains; + xhr.timeout = request.a1.a || 0; + xhr.responseType = request.ad.d; + xhr.withCredentials = request.aH; } @@ -4421,10 +4421,10 @@ function _Http_toResponse(toBody, xhr) function _Http_toMetadata(xhr) { return { - url: xhr.responseURL, - statusCode: xhr.status, - statusText: xhr.statusText, - headers: _Http_parseHeaders(xhr.getAllResponseHeaders()) + S: xhr.responseURL, + a_: xhr.status, + a$: xhr.statusText, + af: _Http_parseHeaders(xhr.getAllResponseHeaders()) }; } @@ -4519,26 +4519,26 @@ function _Http_track(router, xhr, tracker) xhr.upload.addEventListener('progress', function(event) { if (xhr.c) { return; } _Scheduler_rawSpawn(A2($elm$core$Platform$sendToSelf, router, _Utils_Tuple2(tracker, $elm$http$Http$Sending({ - sent: event.loaded, - size: event.total + aZ: event.loaded, + ax: event.total })))); }); xhr.addEventListener('progress', function(event) { if (xhr.c) { return; } _Scheduler_rawSpawn(A2($elm$core$Platform$sendToSelf, router, _Utils_Tuple2(tracker, $elm$http$Http$Receiving({ - received: event.loaded, - size: event.lengthComputable ? $elm$core$Maybe$Just(event.total) : $elm$core$Maybe$Nothing + aX: event.loaded, + ax: event.lengthComputable ? $elm$core$Maybe$Just(event.total) : $elm$core$Maybe$Nothing })))); }); -}var $elm$core$Basics$EQ = {$: 'EQ'}; -var $elm$core$Basics$GT = {$: 'GT'}; -var $elm$core$Basics$LT = {$: 'LT'}; +}var $elm$core$Basics$EQ = 1; +var $elm$core$Basics$GT = 2; +var $elm$core$Basics$LT = 0; var $elm$core$List$cons = _List_cons; var $elm$core$Dict$foldr = F3( function (func, acc, t) { foldr: while (true) { - if (t.$ === 'RBEmpty_elm_builtin') { + if (t.$ === -2) { return acc; } else { var key = t.b; @@ -4583,7 +4583,7 @@ var $elm$core$Dict$keys = function (dict) { dict); }; var $elm$core$Set$toList = function (_v0) { - var dict = _v0.a; + var dict = _v0; return $elm$core$Dict$keys(dict); }; var $elm$core$Elm$JsArray$foldr = _JsArray_foldr; @@ -4593,7 +4593,7 @@ var $elm$core$Array$foldr = F3( var tail = _v0.d; var helper = F2( function (node, acc) { - if (node.$ === 'SubTree') { + if (!node.$) { var subTree = node.a; return A3($elm$core$Elm$JsArray$foldr, helper, acc, subTree); } else { @@ -4611,32 +4611,32 @@ var $elm$core$Array$toList = function (array) { return A3($elm$core$Array$foldr, $elm$core$List$cons, _List_Nil, array); }; var $elm$core$Result$Err = function (a) { - return {$: 'Err', a: a}; + return {$: 1, a: a}; }; var $elm$json$Json$Decode$Failure = F2( function (a, b) { - return {$: 'Failure', a: a, b: b}; + return {$: 3, a: a, b: b}; }); var $elm$json$Json$Decode$Field = F2( function (a, b) { - return {$: 'Field', a: a, b: b}; + return {$: 0, a: a, b: b}; }); var $elm$json$Json$Decode$Index = F2( function (a, b) { - return {$: 'Index', a: a, b: b}; + return {$: 1, a: a, b: b}; }); var $elm$core$Result$Ok = function (a) { - return {$: 'Ok', a: a}; + return {$: 0, a: a}; }; var $elm$json$Json$Decode$OneOf = function (a) { - return {$: 'OneOf', a: a}; + return {$: 2, a: a}; }; -var $elm$core$Basics$False = {$: 'False'}; +var $elm$core$Basics$False = 1; var $elm$core$Basics$add = _Basics_add; var $elm$core$Maybe$Just = function (a) { - return {$: 'Just', a: a}; + return {$: 0, a: a}; }; -var $elm$core$Maybe$Nothing = {$: 'Nothing'}; +var $elm$core$Maybe$Nothing = {$: 1}; var $elm$core$String$all = _String_all; var $elm$core$Basics$and = _Basics_and; var $elm$core$Basics$append = _Utils_append; @@ -4761,12 +4761,12 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( errorToStringHelp: while (true) { switch (error.$) { - case 'Field': + case 0: var f = error.a; var err = error.b; var isSimple = function () { var _v1 = $elm$core$String$uncons(f); - if (_v1.$ === 'Nothing') { + if (_v1.$ === 1) { return false; } else { var _v2 = _v1.a; @@ -4781,7 +4781,7 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( error = $temp$error; context = $temp$context; continue errorToStringHelp; - case 'Index': + case 1: var i = error.a; var err = error.b; var indexName = '[' + ($elm$core$String$fromInt(i) + ']'); @@ -4790,7 +4790,7 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( error = $temp$error; context = $temp$context; continue errorToStringHelp; - case 'OneOf': + case 2: var errors = error.a; if (!errors.b) { return 'Ran into a Json.Decode.oneOf with no possibilities' + function () { @@ -4854,7 +4854,7 @@ var $elm$json$Json$Decode$errorToStringHelp = F2( var $elm$core$Array$branchFactor = 32; var $elm$core$Array$Array_elm_builtin = F4( function (a, b, c, d) { - return {$: 'Array_elm_builtin', a: a, b: b, c: c, d: d}; + return {$: 0, a: a, b: b, c: c, d: d}; }); var $elm$core$Elm$JsArray$empty = _JsArray_empty; var $elm$core$Basics$ceiling = _Basics_ceiling; @@ -4869,7 +4869,7 @@ var $elm$core$Array$shiftStep = $elm$core$Basics$ceiling( var $elm$core$Array$empty = A4($elm$core$Array$Array_elm_builtin, 0, $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, $elm$core$Elm$JsArray$empty); var $elm$core$Elm$JsArray$initialize = _JsArray_initialize; var $elm$core$Array$Leaf = function (a) { - return {$: 'Leaf', a: a}; + return {$: 1, a: a}; }; var $elm$core$Basics$apL = F2( function (f, x) { @@ -4889,7 +4889,7 @@ var $elm$core$Basics$max = F2( }); var $elm$core$Basics$mul = _Basics_mul; var $elm$core$Array$SubTree = function (a) { - return {$: 'SubTree', a: a}; + return {$: 0, a: a}; }; var $elm$core$Elm$JsArray$initializeFromList = _JsArray_initializeFromList; var $elm$core$Array$compressNodes = F2( @@ -4936,25 +4936,25 @@ var $elm$core$Array$treeFromBuilder = F2( }); var $elm$core$Array$builderToArray = F2( function (reverseNodeList, builder) { - if (!builder.nodeListSize) { + if (!builder.b) { return A4( $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.tail), + $elm$core$Elm$JsArray$length(builder.d), $elm$core$Array$shiftStep, $elm$core$Elm$JsArray$empty, - builder.tail); + builder.d); } else { - var treeLen = builder.nodeListSize * $elm$core$Array$branchFactor; + var treeLen = builder.b * $elm$core$Array$branchFactor; var depth = $elm$core$Basics$floor( A2($elm$core$Basics$logBase, $elm$core$Array$branchFactor, treeLen - 1)); - var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.nodeList) : builder.nodeList; - var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.nodeListSize); + var correctNodeList = reverseNodeList ? $elm$core$List$reverse(builder.e) : builder.e; + var tree = A2($elm$core$Array$treeFromBuilder, correctNodeList, builder.b); return A4( $elm$core$Array$Array_elm_builtin, - $elm$core$Elm$JsArray$length(builder.tail) + treeLen, + $elm$core$Elm$JsArray$length(builder.d) + treeLen, A2($elm$core$Basics$max, 5, depth * $elm$core$Array$shiftStep), tree, - builder.tail); + builder.d); } }); var $elm$core$Basics$idiv = _Basics_idiv; @@ -4967,7 +4967,7 @@ var $elm$core$Array$initializeHelp = F5( return A2( $elm$core$Array$builderToArray, false, - {nodeList: nodeList, nodeListSize: (len / $elm$core$Array$branchFactor) | 0, tail: tail}); + {e: nodeList, b: (len / $elm$core$Array$branchFactor) | 0, d: tail}); } else { var leaf = $elm$core$Array$Leaf( A3($elm$core$Elm$JsArray$initialize, $elm$core$Array$branchFactor, fromIndex, fn)); @@ -4997,9 +4997,9 @@ var $elm$core$Array$initialize = F2( return A5($elm$core$Array$initializeHelp, fn, initialFromIndex, len, _List_Nil, tail); } }); -var $elm$core$Basics$True = {$: 'True'}; +var $elm$core$Basics$True = 0; var $elm$core$Result$isOk = function (result) { - if (result.$ === 'Ok') { + if (!result.$) { return true; } else { return false; @@ -5010,33 +5010,31 @@ var $elm$json$Json$Decode$map2 = _Json_map2; var $elm$json$Json$Decode$succeed = _Json_succeed; var $elm$virtual_dom$VirtualDom$toHandlerInt = function (handler) { switch (handler.$) { - case 'Normal': + case 0: return 0; - case 'MayStopPropagation': + case 1: return 1; - case 'MayPreventDefault': + case 2: return 2; default: return 3; } }; var $elm$browser$Browser$External = function (a) { - return {$: 'External', a: a}; + return {$: 1, a: a}; }; var $elm$browser$Browser$Internal = function (a) { - return {$: 'Internal', a: a}; + return {$: 0, a: a}; }; var $elm$core$Basics$identity = function (x) { return x; }; -var $elm$browser$Browser$Dom$NotFound = function (a) { - return {$: 'NotFound', a: a}; -}; -var $elm$url$Url$Http = {$: 'Http'}; -var $elm$url$Url$Https = {$: 'Https'}; +var $elm$browser$Browser$Dom$NotFound = $elm$core$Basics$identity; +var $elm$url$Url$Http = 0; +var $elm$url$Url$Https = 1; var $elm$url$Url$Url = F6( function (protocol, host, port_, path, query, fragment) { - return {fragment: fragment, host: host, path: path, port_: port_, protocol: protocol, query: query}; + return {ae: fragment, ah: host, al: path, an: port_, aq: protocol, ar: query}; }); var $elm$core$String$contains = _String_contains; var $elm$core$String$length = _String_length; @@ -5072,7 +5070,7 @@ var $elm$url$Url$chompBeforePath = F5( var i = _v0.a; var _v1 = $elm$core$String$toInt( A2($elm$core$String$dropLeft, i + 1, str)); - if (_v1.$ === 'Nothing') { + if (_v1.$ === 1) { return $elm$core$Maybe$Nothing; } else { var port_ = _v1; @@ -5155,26 +5153,24 @@ var $elm$core$String$startsWith = _String_startsWith; var $elm$url$Url$fromString = function (str) { return A2($elm$core$String$startsWith, 'http://', str) ? A2( $elm$url$Url$chompAfterProtocol, - $elm$url$Url$Http, + 0, A2($elm$core$String$dropLeft, 7, str)) : (A2($elm$core$String$startsWith, 'https://', str) ? A2( $elm$url$Url$chompAfterProtocol, - $elm$url$Url$Https, + 1, A2($elm$core$String$dropLeft, 8, str)) : $elm$core$Maybe$Nothing); }; var $elm$core$Basics$never = function (_v0) { never: while (true) { - var nvr = _v0.a; + var nvr = _v0; var $temp$_v0 = nvr; _v0 = $temp$_v0; continue never; } }; -var $elm$core$Task$Perform = function (a) { - return {$: 'Perform', a: a}; -}; +var $elm$core$Task$Perform = $elm$core$Basics$identity; var $elm$core$Task$succeed = _Scheduler_succeed; -var $elm$core$Task$init = $elm$core$Task$succeed(_Utils_Tuple0); +var $elm$core$Task$init = $elm$core$Task$succeed(0); var $elm$core$List$foldrHelper = F4( function (fn, acc, ctr, ls) { if (!ls.b) { @@ -5280,7 +5276,7 @@ var $elm$core$Task$sequence = function (tasks) { var $elm$core$Platform$sendToApp = _Platform_sendToApp; var $elm$core$Task$spawnCmd = F2( function (router, _v0) { - var task = _v0.a; + var task = _v0; return _Scheduler_spawn( A2( $elm$core$Task$andThen, @@ -5292,7 +5288,7 @@ var $elm$core$Task$onEffects = F3( return A2( $elm$core$Task$map, function (_v0) { - return _Utils_Tuple0; + return 0; }, $elm$core$Task$sequence( A2( @@ -5302,50 +5298,48 @@ var $elm$core$Task$onEffects = F3( }); var $elm$core$Task$onSelfMsg = F3( function (_v0, _v1, _v2) { - return $elm$core$Task$succeed(_Utils_Tuple0); + return $elm$core$Task$succeed(0); }); var $elm$core$Task$cmdMap = F2( function (tagger, _v0) { - var task = _v0.a; - return $elm$core$Task$Perform( - A2($elm$core$Task$map, tagger, task)); + var task = _v0; + return A2($elm$core$Task$map, tagger, task); }); _Platform_effectManagers['Task'] = _Platform_createManager($elm$core$Task$init, $elm$core$Task$onEffects, $elm$core$Task$onSelfMsg, $elm$core$Task$cmdMap); var $elm$core$Task$command = _Platform_leaf('Task'); var $elm$core$Task$perform = F2( function (toMessage, task) { return $elm$core$Task$command( - $elm$core$Task$Perform( - A2($elm$core$Task$map, toMessage, task))); + A2($elm$core$Task$map, toMessage, task)); }); var $elm$browser$Browser$element = _Browser_element; var $author$project$Main$Model = F7( function (pc, uCode, autoscroll, examples, exampleChooserOpen, examplesListStatus, exampleLoaderStatus) { - return {autoscroll: autoscroll, exampleChooserOpen: exampleChooserOpen, exampleLoaderStatus: exampleLoaderStatus, examples: examples, examplesListStatus: examplesListStatus, pc: pc, uCode: uCode}; + return {A: autoscroll, G: exampleChooserOpen, Q: exampleLoaderStatus, H: examples, R: examplesListStatus, a: pc, q: uCode}; }); -var $author$project$Main$Waiting = {$: 'Waiting'}; +var $author$project$Main$Waiting = {$: 1}; var $author$project$Main$PC = F7( function (ram, dataBus, addressBus, instructionReg, programmCounter, uCounter, accumulator) { - return {accumulator: accumulator, addressBus: addressBus, dataBus: dataBus, instructionReg: instructionReg, programmCounter: programmCounter, ram: ram, uCounter: uCounter}; + return {m: accumulator, r: addressBus, s: dataBus, k: instructionReg, u: programmCounter, f: ram, l: uCounter}; }); var $author$project$Main$initialRam = _List_fromArray( [100005, 300000, 200005, 400000, 0, 5, 0, 0, 0, 0, 0]); var $author$project$Main$initialPC = A7($author$project$Main$PC, $author$project$Main$initialRam, 0, 0, 0, 0, 0, 0); -var $author$project$Main$ActAccumulator2DataBus = {$: 'ActAccumulator2DataBus'}; -var $author$project$Main$ActAccumulatorIncrement = {$: 'ActAccumulatorIncrement'}; -var $author$project$Main$ActDataBus2Accumulator = {$: 'ActDataBus2Accumulator'}; -var $author$project$Main$ActDataBus2InstructionReg = {$: 'ActDataBus2InstructionReg'}; -var $author$project$Main$ActDataBus2Ram = {$: 'ActDataBus2Ram'}; -var $author$project$Main$ActInstructionReg2AddressBus = {$: 'ActInstructionReg2AddressBus'}; -var $author$project$Main$ActInstructionReg2ProgrammCounter = {$: 'ActInstructionReg2ProgrammCounter'}; -var $author$project$Main$ActInstructionReg2UCounter = {$: 'ActInstructionReg2UCounter'}; -var $author$project$Main$ActNothing = {$: 'ActNothing'}; -var $author$project$Main$ActProgrammCounter2AddressBus = {$: 'ActProgrammCounter2AddressBus'}; -var $author$project$Main$ActProgrammCounterIncrement = {$: 'ActProgrammCounterIncrement'}; -var $author$project$Main$ActRam2DataBus = {$: 'ActRam2DataBus'}; -var $author$project$Main$ActResetUCounter = {$: 'ActResetUCounter'}; +var $author$project$Main$ActAccumulator2DataBus = 0; +var $author$project$Main$ActAccumulatorIncrement = 2; +var $author$project$Main$ActDataBus2Accumulator = 3; +var $author$project$Main$ActDataBus2InstructionReg = 4; +var $author$project$Main$ActDataBus2Ram = 5; +var $author$project$Main$ActInstructionReg2AddressBus = 6; +var $author$project$Main$ActInstructionReg2ProgrammCounter = 7; +var $author$project$Main$ActInstructionReg2UCounter = 8; +var $author$project$Main$ActNothing = 14; +var $author$project$Main$ActProgrammCounter2AddressBus = 13; +var $author$project$Main$ActProgrammCounterIncrement = 9; +var $author$project$Main$ActRam2DataBus = 11; +var $author$project$Main$ActResetUCounter = 12; var $author$project$Main$initialUCodes = _List_fromArray( - [$author$project$Main$ActProgrammCounter2AddressBus, $author$project$Main$ActRam2DataBus, $author$project$Main$ActDataBus2InstructionReg, $author$project$Main$ActProgrammCounterIncrement, $author$project$Main$ActInstructionReg2UCounter, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActInstructionReg2AddressBus, $author$project$Main$ActRam2DataBus, $author$project$Main$ActDataBus2Accumulator, $author$project$Main$ActResetUCounter, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActAccumulator2DataBus, $author$project$Main$ActInstructionReg2AddressBus, $author$project$Main$ActDataBus2Ram, $author$project$Main$ActResetUCounter, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActAccumulatorIncrement, $author$project$Main$ActResetUCounter, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActInstructionReg2ProgrammCounter, $author$project$Main$ActResetUCounter, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing, $author$project$Main$ActNothing]); + [13, 11, 4, 9, 8, 14, 14, 14, 14, 14, 6, 11, 3, 12, 14, 14, 14, 14, 14, 14, 0, 6, 5, 12, 14, 14, 14, 14, 14, 14, 2, 12, 14, 14, 14, 14, 14, 14, 14, 14, 7, 12, 14, 14, 14, 14, 14, 14, 14, 14]); var $elm$core$Platform$Cmd$batch = _Platform_batch; var $elm$core$Platform$Cmd$none = $elm$core$Platform$Cmd$batch(_List_Nil); var $author$project$Main$init = function (flags) { @@ -5354,7 +5348,7 @@ var $author$project$Main$init = function (flags) { $elm$core$Platform$Cmd$none); }; var $author$project$Main$MsgLocalSessionRecieve = function (a) { - return {$: 'MsgLocalSessionRecieve', a: a}; + return {$: 18, a: a}; }; var $elm$json$Json$Decode$string = _Json_decodeString; var $author$project$Main$localStorageRecieve = _Platform_incomingPort('localStorageRecieve', $elm$json$Json$Decode$string); @@ -5362,9 +5356,9 @@ var $author$project$Main$subscriptions = function (model) { return $author$project$Main$localStorageRecieve($author$project$Main$MsgLocalSessionRecieve); }; var $author$project$Main$Failure = function (a) { - return {$: 'Failure', a: a}; + return {$: 0, a: a}; }; -var $author$project$Main$Success = {$: 'Success'}; +var $author$project$Main$Success = {$: 2}; var $elm$core$List$append = F2( function (xs, ys) { if (!ys.b) { @@ -5568,35 +5562,35 @@ var $author$project$Main$changeAtInt = F3( }); var $author$project$Main$changeAtUCode = F3( function (pos, newVal, list) { - return A4($author$project$Main$changeAt, pos, newVal, $author$project$Main$ActNothing, list); + return A4($author$project$Main$changeAt, pos, newVal, 14, list); }); var $author$project$Main$MsgLoadExampleArrived = function (a) { - return {$: 'MsgLoadExampleArrived', a: a}; + return {$: 22, a: a}; }; var $elm$json$Json$Decode$decodeString = _Json_runOnString; var $elm$http$Http$BadStatus_ = F2( function (a, b) { - return {$: 'BadStatus_', a: a, b: b}; + return {$: 3, a: a, b: b}; }); var $elm$http$Http$BadUrl_ = function (a) { - return {$: 'BadUrl_', a: a}; + return {$: 0, a: a}; }; var $elm$http$Http$GoodStatus_ = F2( function (a, b) { - return {$: 'GoodStatus_', a: a, b: b}; + return {$: 4, a: a, b: b}; }); -var $elm$http$Http$NetworkError_ = {$: 'NetworkError_'}; +var $elm$http$Http$NetworkError_ = {$: 2}; var $elm$http$Http$Receiving = function (a) { - return {$: 'Receiving', a: a}; + return {$: 1, a: a}; }; var $elm$http$Http$Sending = function (a) { - return {$: 'Sending', a: a}; + return {$: 0, a: a}; }; -var $elm$http$Http$Timeout_ = {$: 'Timeout_'}; -var $elm$core$Dict$RBEmpty_elm_builtin = {$: 'RBEmpty_elm_builtin'}; +var $elm$http$Http$Timeout_ = {$: 1}; +var $elm$core$Dict$RBEmpty_elm_builtin = {$: -2}; var $elm$core$Dict$empty = $elm$core$Dict$RBEmpty_elm_builtin; var $elm$core$Maybe$isJust = function (maybe) { - if (maybe.$ === 'Just') { + if (!maybe.$) { return true; } else { return false; @@ -5608,7 +5602,7 @@ var $elm$core$Dict$get = F2( function (targetKey, dict) { get: while (true) { - if (dict.$ === 'RBEmpty_elm_builtin') { + if (dict.$ === -2) { return $elm$core$Maybe$Nothing; } else { var key = dict.b; @@ -5616,14 +5610,14 @@ var $elm$core$Dict$get = F2( var left = dict.d; var right = dict.e; var _v1 = A2($elm$core$Basics$compare, targetKey, key); - switch (_v1.$) { - case 'LT': + switch (_v1) { + case 0: var $temp$targetKey = targetKey, $temp$dict = left; targetKey = $temp$targetKey; dict = $temp$dict; continue get; - case 'EQ': + case 1: return $elm$core$Maybe$Just(value); default: var $temp$targetKey = targetKey, @@ -5635,21 +5629,21 @@ var $elm$core$Dict$get = F2( } } }); -var $elm$core$Dict$Black = {$: 'Black'}; +var $elm$core$Dict$Black = 1; var $elm$core$Dict$RBNode_elm_builtin = F5( function (a, b, c, d, e) { - return {$: 'RBNode_elm_builtin', a: a, b: b, c: c, d: d, e: e}; + return {$: -1, a: a, b: b, c: c, d: d, e: e}; }); -var $elm$core$Dict$Red = {$: 'Red'}; +var $elm$core$Dict$Red = 0; var $elm$core$Dict$balance = F5( function (color, key, value, left, right) { - if ((right.$ === 'RBNode_elm_builtin') && (right.a.$ === 'Red')) { + if ((right.$ === -1) && (!right.a)) { var _v1 = right.a; var rK = right.b; var rV = right.c; var rLeft = right.d; var rRight = right.e; - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) { + if ((left.$ === -1) && (!left.a)) { var _v3 = left.a; var lK = left.b; var lV = left.c; @@ -5657,22 +5651,22 @@ var $elm$core$Dict$balance = F5( var lRight = left.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, + 0, key, value, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 1, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rLeft, rRight)); } else { return A5( $elm$core$Dict$RBNode_elm_builtin, color, rK, rV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, left, rLeft), + A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, left, rLeft), rRight); } } else { - if ((((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) && (left.d.$ === 'RBNode_elm_builtin')) && (left.d.a.$ === 'Red')) { + if ((((left.$ === -1) && (!left.a)) && (left.d.$ === -1)) && (!left.d.a)) { var _v5 = left.a; var lK = left.b; var lV = left.c; @@ -5685,11 +5679,11 @@ var $elm$core$Dict$balance = F5( var lRight = left.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, + 0, lK, lV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, llK, llV, llLeft, llRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, key, value, lRight, right)); + A5($elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight), + A5($elm$core$Dict$RBNode_elm_builtin, 1, key, value, lRight, right)); } else { return A5($elm$core$Dict$RBNode_elm_builtin, color, key, value, left, right); } @@ -5697,8 +5691,8 @@ var $elm$core$Dict$balance = F5( }); var $elm$core$Dict$insertHelp = F3( function (key, value, dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); + if (dict.$ === -2) { + return A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, $elm$core$Dict$RBEmpty_elm_builtin, $elm$core$Dict$RBEmpty_elm_builtin); } else { var nColor = dict.a; var nKey = dict.b; @@ -5706,8 +5700,8 @@ var $elm$core$Dict$insertHelp = F3( var nLeft = dict.d; var nRight = dict.e; var _v1 = A2($elm$core$Basics$compare, key, nKey); - switch (_v1.$) { - case 'LT': + switch (_v1) { + case 0: return A5( $elm$core$Dict$balance, nColor, @@ -5715,7 +5709,7 @@ var $elm$core$Dict$insertHelp = F3( nValue, A3($elm$core$Dict$insertHelp, key, value, nLeft), nRight); - case 'EQ': + case 1: return A5($elm$core$Dict$RBNode_elm_builtin, nColor, nKey, value, nLeft, nRight); default: return A5( @@ -5731,13 +5725,13 @@ var $elm$core$Dict$insertHelp = F3( var $elm$core$Dict$insert = F3( function (key, value, dict) { var _v0 = A3($elm$core$Dict$insertHelp, key, value, dict); - if ((_v0.$ === 'RBNode_elm_builtin') && (_v0.a.$ === 'Red')) { + if ((_v0.$ === -1) && (!_v0.a)) { var _v1 = _v0.a; var k = _v0.b; var v = _v0.c; var l = _v0.d; var r = _v0.e; - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, k, v, l, r); + return A5($elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r); } else { var x = _v0; return x; @@ -5746,7 +5740,7 @@ var $elm$core$Dict$insert = F3( var $elm$core$Dict$getMin = function (dict) { getMin: while (true) { - if ((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) { + if ((dict.$ === -1) && (dict.d.$ === -1)) { var left = dict.d; var $temp$dict = left; dict = $temp$dict; @@ -5757,8 +5751,8 @@ var $elm$core$Dict$getMin = function (dict) { } }; var $elm$core$Dict$moveRedLeft = function (dict) { - if (((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) && (dict.e.$ === 'RBNode_elm_builtin')) { - if ((dict.e.d.$ === 'RBNode_elm_builtin') && (dict.e.d.a.$ === 'Red')) { + if (((dict.$ === -1) && (dict.d.$ === -1)) && (dict.e.$ === -1)) { + if ((dict.e.d.$ === -1) && (!dict.e.d.a)) { var clr = dict.a; var k = dict.b; var v = dict.c; @@ -5781,17 +5775,17 @@ var $elm$core$Dict$moveRedLeft = function (dict) { var rRight = _v2.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, + 0, rlK, rlV, A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), rlL), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, rK, rV, rlR, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 1, rK, rV, rlR, rRight)); } else { var clr = dict.a; var k = dict.b; @@ -5808,22 +5802,22 @@ var $elm$core$Dict$moveRedLeft = function (dict) { var rV = _v5.c; var rLeft = _v5.d; var rRight = _v5.e; - if (clr.$ === 'Black') { + if (clr === 1) { return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); } else { return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); } } } else { @@ -5831,8 +5825,8 @@ var $elm$core$Dict$moveRedLeft = function (dict) { } }; var $elm$core$Dict$moveRedRight = function (dict) { - if (((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) && (dict.e.$ === 'RBNode_elm_builtin')) { - if ((dict.d.d.$ === 'RBNode_elm_builtin') && (dict.d.d.a.$ === 'Red')) { + if (((dict.$ === -1) && (dict.d.$ === -1)) && (dict.e.$ === -1)) { + if ((dict.d.d.$ === -1) && (!dict.d.d.a)) { var clr = dict.a; var k = dict.b; var v = dict.c; @@ -5855,17 +5849,17 @@ var $elm$core$Dict$moveRedRight = function (dict) { var rRight = _v4.e; return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Red, + 0, lK, lV, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, llK, llV, llLeft, llRight), + A5($elm$core$Dict$RBNode_elm_builtin, 1, llK, llV, llLeft, llRight), A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, lRight, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight))); + A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight))); } else { var clr = dict.a; var k = dict.b; @@ -5882,22 +5876,22 @@ var $elm$core$Dict$moveRedRight = function (dict) { var rV = _v6.c; var rLeft = _v6.d; var rRight = _v6.e; - if (clr.$ === 'Black') { + if (clr === 1) { return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); } else { return A5( $elm$core$Dict$RBNode_elm_builtin, - $elm$core$Dict$Black, + 1, k, v, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, lK, lV, lLeft, lRight), - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, rK, rV, rLeft, rRight)); + A5($elm$core$Dict$RBNode_elm_builtin, 0, lK, lV, lLeft, lRight), + A5($elm$core$Dict$RBNode_elm_builtin, 0, rK, rV, rLeft, rRight)); } } } else { @@ -5906,7 +5900,7 @@ var $elm$core$Dict$moveRedRight = function (dict) { }; var $elm$core$Dict$removeHelpPrepEQGT = F7( function (targetKey, dict, color, key, value, left, right) { - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Red')) { + if ((left.$ === -1) && (!left.a)) { var _v1 = left.a; var lK = left.b; var lV = left.c; @@ -5918,13 +5912,13 @@ var $elm$core$Dict$removeHelpPrepEQGT = F7( lK, lV, lLeft, - A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Red, key, value, lRight, right)); + A5($elm$core$Dict$RBNode_elm_builtin, 0, key, value, lRight, right)); } else { _v2$2: while (true) { - if ((right.$ === 'RBNode_elm_builtin') && (right.a.$ === 'Black')) { - if (right.d.$ === 'RBNode_elm_builtin') { - if (right.d.a.$ === 'Black') { + if ((right.$ === -1) && (right.a === 1)) { + if (right.d.$ === -1) { + if (right.d.a === 1) { var _v3 = right.a; var _v4 = right.d; var _v5 = _v4.a; @@ -5945,7 +5939,7 @@ var $elm$core$Dict$removeHelpPrepEQGT = F7( } }); var $elm$core$Dict$removeMin = function (dict) { - if ((dict.$ === 'RBNode_elm_builtin') && (dict.d.$ === 'RBNode_elm_builtin')) { + if ((dict.$ === -1) && (dict.d.$ === -1)) { var color = dict.a; var key = dict.b; var value = dict.c; @@ -5953,8 +5947,8 @@ var $elm$core$Dict$removeMin = function (dict) { var lColor = left.a; var lLeft = left.d; var right = dict.e; - if (lColor.$ === 'Black') { - if ((lLeft.$ === 'RBNode_elm_builtin') && (lLeft.a.$ === 'Red')) { + if (lColor === 1) { + if ((lLeft.$ === -1) && (!lLeft.a)) { var _v3 = lLeft.a; return A5( $elm$core$Dict$RBNode_elm_builtin, @@ -5965,7 +5959,7 @@ var $elm$core$Dict$removeMin = function (dict) { right); } else { var _v4 = $elm$core$Dict$moveRedLeft(dict); - if (_v4.$ === 'RBNode_elm_builtin') { + if (_v4.$ === -1) { var nColor = _v4.a; var nKey = _v4.b; var nValue = _v4.c; @@ -5997,7 +5991,7 @@ var $elm$core$Dict$removeMin = function (dict) { }; var $elm$core$Dict$removeHelp = F2( function (targetKey, dict) { - if (dict.$ === 'RBEmpty_elm_builtin') { + if (dict.$ === -2) { return $elm$core$Dict$RBEmpty_elm_builtin; } else { var color = dict.a; @@ -6006,10 +6000,10 @@ var $elm$core$Dict$removeHelp = F2( var left = dict.d; var right = dict.e; if (_Utils_cmp(targetKey, key) < 0) { - if ((left.$ === 'RBNode_elm_builtin') && (left.a.$ === 'Black')) { + if ((left.$ === -1) && (left.a === 1)) { var _v4 = left.a; var lLeft = left.d; - if ((lLeft.$ === 'RBNode_elm_builtin') && (lLeft.a.$ === 'Red')) { + if ((lLeft.$ === -1) && (!lLeft.a)) { var _v6 = lLeft.a; return A5( $elm$core$Dict$RBNode_elm_builtin, @@ -6020,7 +6014,7 @@ var $elm$core$Dict$removeHelp = F2( right); } else { var _v7 = $elm$core$Dict$moveRedLeft(dict); - if (_v7.$ === 'RBNode_elm_builtin') { + if (_v7.$ === -1) { var nColor = _v7.a; var nKey = _v7.b; var nValue = _v7.c; @@ -6056,7 +6050,7 @@ var $elm$core$Dict$removeHelp = F2( }); var $elm$core$Dict$removeHelpEQGT = F2( function (targetKey, dict) { - if (dict.$ === 'RBNode_elm_builtin') { + if (dict.$ === -1) { var color = dict.a; var key = dict.b; var value = dict.c; @@ -6064,7 +6058,7 @@ var $elm$core$Dict$removeHelpEQGT = F2( var right = dict.e; if (_Utils_eq(targetKey, key)) { var _v1 = $elm$core$Dict$getMin(right); - if (_v1.$ === 'RBNode_elm_builtin') { + if (_v1.$ === -1) { var minKey = _v1.b; var minValue = _v1.c; return A5( @@ -6093,13 +6087,13 @@ var $elm$core$Dict$removeHelpEQGT = F2( var $elm$core$Dict$remove = F2( function (key, dict) { var _v0 = A2($elm$core$Dict$removeHelp, key, dict); - if ((_v0.$ === 'RBNode_elm_builtin') && (_v0.a.$ === 'Red')) { + if ((_v0.$ === -1) && (!_v0.a)) { var _v1 = _v0.a; var k = _v0.b; var v = _v0.c; var l = _v0.d; var r = _v0.e; - return A5($elm$core$Dict$RBNode_elm_builtin, $elm$core$Dict$Black, k, v, l, r); + return A5($elm$core$Dict$RBNode_elm_builtin, 1, k, v, l, r); } else { var x = _v0; return x; @@ -6109,7 +6103,7 @@ var $elm$core$Dict$update = F3( function (targetKey, alter, dictionary) { var _v0 = alter( A2($elm$core$Dict$get, targetKey, dictionary)); - if (_v0.$ === 'Just') { + if (!_v0.$) { var value = _v0.a; return A3($elm$core$Dict$insert, targetKey, value, dictionary); } else { @@ -6131,7 +6125,7 @@ var $elm$http$Http$expectStringResponse = F2( }); var $elm$core$Result$mapError = F2( function (f, result) { - if (result.$ === 'Ok') { + if (!result.$) { var v = result.a; return $elm$core$Result$Ok(v); } else { @@ -6141,31 +6135,31 @@ var $elm$core$Result$mapError = F2( } }); var $elm$http$Http$BadBody = function (a) { - return {$: 'BadBody', a: a}; + return {$: 4, a: a}; }; var $elm$http$Http$BadStatus = function (a) { - return {$: 'BadStatus', a: a}; + return {$: 3, a: a}; }; var $elm$http$Http$BadUrl = function (a) { - return {$: 'BadUrl', a: a}; + return {$: 0, a: a}; }; -var $elm$http$Http$NetworkError = {$: 'NetworkError'}; -var $elm$http$Http$Timeout = {$: 'Timeout'}; +var $elm$http$Http$NetworkError = {$: 2}; +var $elm$http$Http$Timeout = {$: 1}; var $elm$http$Http$resolve = F2( function (toResult, response) { switch (response.$) { - case 'BadUrl_': + case 0: var url = response.a; return $elm$core$Result$Err( $elm$http$Http$BadUrl(url)); - case 'Timeout_': + case 1: return $elm$core$Result$Err($elm$http$Http$Timeout); - case 'NetworkError_': + case 2: return $elm$core$Result$Err($elm$http$Http$NetworkError); - case 'BadStatus_': + case 3: var metadata = response.a; return $elm$core$Result$Err( - $elm$http$Http$BadStatus(metadata.statusCode)); + $elm$http$Http$BadStatus(metadata.a_)); default: var body = response.b; return A2( @@ -6189,11 +6183,11 @@ var $elm$http$Http$expectJson = F2( }); var $elm$http$Http$emptyBody = _Http_emptyBody; var $elm$http$Http$Request = function (a) { - return {$: 'Request', a: a}; + return {$: 1, a: a}; }; var $elm$http$Http$State = F2( function (reqs, subs) { - return {reqs: reqs, subs: subs}; + return {at: reqs, ay: subs}; }); var $elm$http$Http$init = $elm$core$Task$succeed( A2($elm$http$Http$State, $elm$core$Dict$empty, _List_Nil)); @@ -6208,10 +6202,10 @@ var $elm$http$Http$updateReqs = F3( } else { var cmd = cmds.a; var otherCmds = cmds.b; - if (cmd.$ === 'Cancel') { + if (!cmd.$) { var tracker = cmd.a; var _v2 = A2($elm$core$Dict$get, tracker, reqs); - if (_v2.$ === 'Nothing') { + if (_v2.$ === 1) { var $temp$router = router, $temp$cmds = otherCmds, $temp$reqs = reqs; @@ -6237,8 +6231,8 @@ var $elm$http$Http$updateReqs = F3( return A2( $elm$core$Task$andThen, function (pid) { - var _v4 = req.tracker; - if (_v4.$ === 'Nothing') { + var _v4 = req.aB; + if (_v4.$ === 1) { return A3($elm$http$Http$updateReqs, router, otherCmds, reqs); } else { var tracker = _v4.a; @@ -6267,12 +6261,12 @@ var $elm$http$Http$onEffects = F4( return $elm$core$Task$succeed( A2($elm$http$Http$State, reqs, subs)); }, - A3($elm$http$Http$updateReqs, router, cmds, state.reqs)); + A3($elm$http$Http$updateReqs, router, cmds, state.at)); }); var $elm$core$List$maybeCons = F3( function (f, mx, xs) { var _v0 = f(mx); - if (_v0.$ === 'Just') { + if (!_v0.$) { var x = _v0.a; return A2($elm$core$List$cons, x, xs); } else { @@ -6310,34 +6304,34 @@ var $elm$http$Http$onSelfMsg = F3( A2( $elm$core$List$filterMap, A3($elm$http$Http$maybeSend, router, tracker, progress), - state.subs))); + state.ay))); }); var $elm$http$Http$Cancel = function (a) { - return {$: 'Cancel', a: a}; + return {$: 0, a: a}; }; var $elm$http$Http$cmdMap = F2( function (func, cmd) { - if (cmd.$ === 'Cancel') { + if (!cmd.$) { var tracker = cmd.a; return $elm$http$Http$Cancel(tracker); } else { var r = cmd.a; return $elm$http$Http$Request( { - allowCookiesFromOtherDomains: r.allowCookiesFromOtherDomains, - body: r.body, - expect: A2(_Http_mapExpect, func, r.expect), - headers: r.headers, - method: r.method, - timeout: r.timeout, - tracker: r.tracker, - url: r.url + aH: r.aH, + aJ: r.aJ, + ad: A2(_Http_mapExpect, func, r.ad), + af: r.af, + aS: r.aS, + a1: r.a1, + aB: r.aB, + S: r.S }); } }); var $elm$http$Http$MySub = F2( function (a, b) { - return {$: 'MySub', a: a, b: b}; + return {$: 0, a: a, b: b}; }); var $elm$http$Http$subMap = F2( function (func, _v0) { @@ -6354,11 +6348,11 @@ var $elm$http$Http$subscription = _Platform_leaf('Http'); var $elm$http$Http$request = function (r) { return $elm$http$Http$command( $elm$http$Http$Request( - {allowCookiesFromOtherDomains: false, body: r.body, expect: r.expect, headers: r.headers, method: r.method, timeout: r.timeout, tracker: r.tracker, url: r.url})); + {aH: false, aJ: r.aJ, ad: r.ad, af: r.af, aS: r.aS, a1: r.a1, aB: r.aB, S: r.S})); }; var $elm$http$Http$get = function (r) { return $elm$http$Http$request( - {body: $elm$http$Http$emptyBody, expect: r.expect, headers: _List_Nil, method: 'GET', timeout: $elm$core$Maybe$Nothing, tracker: $elm$core$Maybe$Nothing, url: r.url}); + {aJ: $elm$http$Http$emptyBody, ad: r.ad, af: _List_Nil, aS: 'GET', a1: $elm$core$Maybe$Nothing, aB: $elm$core$Maybe$Nothing, S: r.S}); }; var $elm$json$Json$Decode$bool = _Json_decodeBool; var $elm$json$Json$Decode$field = _Json_decodeField; @@ -6390,23 +6384,25 @@ var $elm$core$Tuple$second = function (_v0) { var y = _v0.b; return y; }; -var $author$project$Main$ActAccumulatorDecrement = {$: 'ActAccumulatorDecrement'}; +var $author$project$Main$ActAccumulatorDecrement = 1; +var $author$project$Main$ActInstructionReg2ProgrammCounterIfAccEq0 = 10; var $author$project$Main$uCodeIds = _List_fromArray( [ - _Utils_Tuple2($author$project$Main$ActAccumulator2DataBus, 'acc2db'), - _Utils_Tuple2($author$project$Main$ActAccumulatorDecrement, 'accDec'), - _Utils_Tuple2($author$project$Main$ActAccumulatorIncrement, 'accInc'), - _Utils_Tuple2($author$project$Main$ActDataBus2Accumulator, 'db2acc'), - _Utils_Tuple2($author$project$Main$ActDataBus2InstructionReg, 'db2ir'), - _Utils_Tuple2($author$project$Main$ActDataBus2Ram, 'db2ram'), - _Utils_Tuple2($author$project$Main$ActInstructionReg2AddressBus, 'ir2ab'), - _Utils_Tuple2($author$project$Main$ActInstructionReg2ProgrammCounter, 'ir2pc'), - _Utils_Tuple2($author$project$Main$ActInstructionReg2UCounter, 'ir2uc'), - _Utils_Tuple2($author$project$Main$ActProgrammCounterIncrement, 'pcInc'), - _Utils_Tuple2($author$project$Main$ActRam2DataBus, 'ram2db'), - _Utils_Tuple2($author$project$Main$ActResetUCounter, 'ucReset'), - _Utils_Tuple2($author$project$Main$ActProgrammCounter2AddressBus, 'pc2ab'), - _Utils_Tuple2($author$project$Main$ActNothing, 'n') + _Utils_Tuple2(0, 'acc2db'), + _Utils_Tuple2(1, 'accDec'), + _Utils_Tuple2(2, 'accInc'), + _Utils_Tuple2(3, 'db2acc'), + _Utils_Tuple2(4, 'db2ir'), + _Utils_Tuple2(5, 'db2ram'), + _Utils_Tuple2(6, 'ir2ab'), + _Utils_Tuple2(7, 'ir2pc'), + _Utils_Tuple2(8, 'ir2uc'), + _Utils_Tuple2(9, 'pcInc'), + _Utils_Tuple2(10, 'ir2pciacceq0'), + _Utils_Tuple2(11, 'ram2db'), + _Utils_Tuple2(12, 'ucReset'), + _Utils_Tuple2(13, 'pc2ab'), + _Utils_Tuple2(14, 'n') ]); var $author$project$Main$string2uAction = function (msg) { var filtered_list = A2( @@ -6416,7 +6412,7 @@ var $author$project$Main$string2uAction = function (msg) { }, $author$project$Main$uCodeIds); var _v0 = $elm$core$List$head(filtered_list); - if (_v0.$ === 'Just') { + if (!_v0.$) { var _v1 = _v0.a; var action = _v1.a; return $elm$core$Maybe$Just(action); @@ -6426,7 +6422,7 @@ var $author$project$Main$string2uAction = function (msg) { }; var $elm$core$Maybe$withDefault = F2( function (_default, maybe) { - if (maybe.$ === 'Just') { + if (!maybe.$) { var value = maybe.a; return value; } else { @@ -6464,7 +6460,7 @@ var $author$project$Main$modelDecoder = A4( function (s) { return A2( $elm$core$Maybe$withDefault, - $author$project$Main$ActNothing, + 14, $author$project$Main$string2uAction(s)); }, $elm$json$Json$Decode$string))), @@ -6473,16 +6469,16 @@ var $author$project$Main$cmdLoadExampleSing = F2( function (model, example) { return $elm$http$Http$get( { - expect: A2($elm$http$Http$expectJson, $author$project$Main$MsgLoadExampleArrived, $author$project$Main$modelDecoder), - url: example.url + ad: A2($elm$http$Http$expectJson, $author$project$Main$MsgLoadExampleArrived, $author$project$Main$modelDecoder), + S: example.S }); }); var $author$project$Main$MsgExamplesArrived = function (a) { - return {$: 'MsgExamplesArrived', a: a}; + return {$: 23, a: a}; }; var $author$project$Main$Example = F4( function (title, version, url, enabled) { - return {enabled: enabled, title: title, url: url, version: version}; + return {aN: enabled, aA: title, S: url, a3: version}; }); var $elm$json$Json$Decode$map4 = _Json_map4; var $author$project$Main$exampleListDecoder = A2( @@ -6508,8 +6504,8 @@ var $author$project$Main$examplesListUrl = 'examples-list.json'; var $author$project$Main$cmdLoadExamples = function (model) { return $elm$http$Http$get( { - expect: A2($elm$http$Http$expectJson, $author$project$Main$MsgExamplesArrived, $author$project$Main$exampleListDecoder), - url: $author$project$Main$examplesListUrl + ad: A2($elm$http$Http$expectJson, $author$project$Main$MsgExamplesArrived, $author$project$Main$exampleListDecoder), + S: $author$project$Main$examplesListUrl }); }; var $elm$json$Json$Encode$bool = _Json_wrap; @@ -6520,7 +6516,7 @@ var $elm$json$Json$Encode$list = F2( A3( $elm$core$List$foldl, _Json_addEntry(func), - _Json_emptyArray(_Utils_Tuple0), + _Json_emptyArray(0), entries)); }); var $author$project$Main$modelVersion = 1; @@ -6534,7 +6530,7 @@ var $elm$json$Json$Encode$object = function (pairs) { var v = _v0.b; return A3(_Json_addField, k, v, obj); }), - _Json_emptyObject(_Utils_Tuple0), + _Json_emptyObject(0), pairs)); }; var $elm$json$Json$Encode$string = _Json_wrap; @@ -6546,7 +6542,7 @@ var $author$project$Main$uAction2String = function (action) { }, $author$project$Main$uCodeIds); var _v0 = $elm$core$List$head(filtered_list); - if (_v0.$ === 'Just') { + if (!_v0.$) { var _v1 = _v0.a; var info = _v1.b; return info; @@ -6571,35 +6567,35 @@ var $author$project$Main$encodeModel = function (model) { [ _Utils_Tuple2( 'addressBus', - $elm$json$Json$Encode$int(model.pc.addressBus)), + $elm$json$Json$Encode$int(model.a.r)), _Utils_Tuple2( 'dataBus', - $elm$json$Json$Encode$int(model.pc.dataBus)), + $elm$json$Json$Encode$int(model.a.s)), _Utils_Tuple2( 'instructionReg', - $elm$json$Json$Encode$int(model.pc.instructionReg)), + $elm$json$Json$Encode$int(model.a.k)), _Utils_Tuple2( 'programmCounter', - $elm$json$Json$Encode$int(model.pc.programmCounter)), + $elm$json$Json$Encode$int(model.a.u)), _Utils_Tuple2( 'uCounter', - $elm$json$Json$Encode$int(model.pc.uCounter)), + $elm$json$Json$Encode$int(model.a.l)), _Utils_Tuple2( 'accumulator', - $elm$json$Json$Encode$int(model.pc.accumulator)), + $elm$json$Json$Encode$int(model.a.m)), _Utils_Tuple2( 'ram', - A2($elm$json$Json$Encode$list, $elm$json$Json$Encode$int, model.pc.ram)) + A2($elm$json$Json$Encode$list, $elm$json$Json$Encode$int, model.a.f)) ]))), _Utils_Tuple2( 'uCode', A2( $elm$json$Json$Encode$list, $elm$json$Json$Encode$string, - A2($elm$core$List$map, $author$project$Main$uAction2String, model.uCode))), + A2($elm$core$List$map, $author$project$Main$uAction2String, model.q))), _Utils_Tuple2( 'autoscroll', - $elm$json$Json$Encode$bool(model.autoscroll)) + $elm$json$Json$Encode$bool(model.A)) ]))); }; var $author$project$Main$localStorageSend = _Platform_outgoingPort('localStorageSend', $elm$json$Json$Encode$string); @@ -6619,7 +6615,7 @@ var $author$project$Main$cmdSenduUpdate = function (model) { var $author$project$Main$decodeModel = F2( function (model, text) { var error2maybe = function (err) { - if (err.$ === 'Ok') { + if (!err.$) { var val = err.a; return $elm$core$Maybe$Just(val); } else { @@ -6632,33 +6628,33 @@ var $author$project$Main$decodeModel = F2( var $author$project$Main$actAccumulator2DataBus = function (pc) { return _Utils_update( pc, - {dataBus: pc.accumulator}); + {s: pc.m}); }; var $author$project$Main$actAccumulatorDecrement = function (pc) { return _Utils_update( pc, - {accumulator: pc.accumulator - 1}); + {m: pc.m - 1}); }; var $author$project$Main$actAccumulatorIncrement = function (pc) { return _Utils_update( pc, - {accumulator: pc.accumulator + 1}); + {m: pc.m + 1}); }; var $author$project$Main$actDataBus2Accumulator = function (pc) { return _Utils_update( pc, - {accumulator: pc.dataBus}); + {m: pc.s}); }; var $author$project$Main$actDataBus2InstructionReg = function (pc) { return _Utils_update( pc, - {instructionReg: pc.dataBus}); + {k: pc.s}); }; var $author$project$Main$actDataBus2Ram = function (pc) { - var newRam = A3($author$project$Main$changeAtInt, pc.addressBus, pc.dataBus, pc.ram); + var newRam = A3($author$project$Main$changeAtInt, pc.r, pc.s, pc.f); return _Utils_update( pc, - {ram: newRam}); + {f: newRam}); }; var $author$project$Main$seperateInstructionsEntry = function (i) { var instruction = (i / 100000) | 0; @@ -6666,38 +6662,49 @@ var $author$project$Main$seperateInstructionsEntry = function (i) { return _Utils_Tuple2(instruction, address); }; var $author$project$Main$actInstructionReg2AddressBus = function (pc) { - var _v0 = $author$project$Main$seperateInstructionsEntry(pc.instructionReg); + var _v0 = $author$project$Main$seperateInstructionsEntry(pc.k); var instruction = _v0.a; var address = _v0.b; return _Utils_update( pc, - {addressBus: address}); + {r: address}); }; var $author$project$Main$actInstructionReg2ProgrammCounter = function (pc) { - var _v0 = $author$project$Main$seperateInstructionsEntry(pc.instructionReg); + var _v0 = $author$project$Main$seperateInstructionsEntry(pc.k); var instruction = _v0.a; var address = _v0.b; return _Utils_update( pc, - {programmCounter: address}); + {u: address}); +}; +var $author$project$Main$actInstructionReg2ProgrammCounterIfAccEq0 = function (pc) { + if (!pc.m) { + var _v0 = $author$project$Main$seperateInstructionsEntry(pc.k); + var addr = _v0.b; + return _Utils_update( + pc, + {u: addr}); + } else { + return pc; + } }; var $author$project$Main$actInstructionReg2UCounter = function (pc) { - var _v0 = $author$project$Main$seperateInstructionsEntry(pc.instructionReg); + var _v0 = $author$project$Main$seperateInstructionsEntry(pc.k); var instruction = _v0.a; var address = _v0.b; return _Utils_update( pc, - {uCounter: instruction * 10}); + {l: instruction * 10}); }; var $author$project$Main$actProgrammCounter2AddressBus = function (pc) { return _Utils_update( pc, - {addressBus: pc.programmCounter}); + {r: pc.u}); }; var $author$project$Main$actProgrammCounterIncrement = function (pc) { return _Utils_update( pc, - {programmCounter: pc.programmCounter + 1}); + {u: pc.u + 1}); }; var $author$project$Main$valueAt = F2( function (n, l) { @@ -6707,7 +6714,7 @@ var $author$project$Main$valueAt = F2( var $author$project$Main$valueAtInt = F2( function (n, l) { var _v0 = A2($author$project$Main$valueAt, n, l); - if (_v0.$ === 'Just') { + if (!_v0.$) { var a = _v0.a; return a; } else { @@ -6715,38 +6722,90 @@ var $author$project$Main$valueAtInt = F2( } }); var $author$project$Main$actRam2DataBus = function (pc) { - var ab = pc.addressBus; - var db = A2($author$project$Main$valueAtInt, ab, pc.ram); + var ab = pc.r; + var db = A2($author$project$Main$valueAtInt, ab, pc.f); return _Utils_update( pc, - {dataBus: db}); + {s: db}); }; var $author$project$Main$actResetUCounter = function (pc) { return _Utils_update( pc, - {uCounter: 0}); + {l: 0}); }; var $author$project$Main$uCodeMaps = _List_fromArray( [ - _Utils_Tuple2($author$project$Main$ActAccumulator2DataBus, $author$project$Main$actAccumulator2DataBus), - _Utils_Tuple2($author$project$Main$ActAccumulatorDecrement, $author$project$Main$actAccumulatorDecrement), - _Utils_Tuple2($author$project$Main$ActAccumulatorIncrement, $author$project$Main$actAccumulatorIncrement), - _Utils_Tuple2($author$project$Main$ActDataBus2Accumulator, $author$project$Main$actDataBus2Accumulator), - _Utils_Tuple2($author$project$Main$ActDataBus2InstructionReg, $author$project$Main$actDataBus2InstructionReg), - _Utils_Tuple2($author$project$Main$ActDataBus2Ram, $author$project$Main$actDataBus2Ram), - _Utils_Tuple2($author$project$Main$ActInstructionReg2AddressBus, $author$project$Main$actInstructionReg2AddressBus), - _Utils_Tuple2($author$project$Main$ActInstructionReg2ProgrammCounter, $author$project$Main$actInstructionReg2ProgrammCounter), - _Utils_Tuple2($author$project$Main$ActInstructionReg2UCounter, $author$project$Main$actInstructionReg2UCounter), - _Utils_Tuple2($author$project$Main$ActProgrammCounterIncrement, $author$project$Main$actProgrammCounterIncrement), - _Utils_Tuple2($author$project$Main$ActRam2DataBus, $author$project$Main$actRam2DataBus), - _Utils_Tuple2($author$project$Main$ActResetUCounter, $author$project$Main$actResetUCounter), - _Utils_Tuple2($author$project$Main$ActProgrammCounter2AddressBus, $author$project$Main$actProgrammCounter2AddressBus), + _Utils_Tuple2(0, $author$project$Main$actAccumulator2DataBus), + _Utils_Tuple2(1, $author$project$Main$actAccumulatorDecrement), + _Utils_Tuple2(2, $author$project$Main$actAccumulatorIncrement), + _Utils_Tuple2(3, $author$project$Main$actDataBus2Accumulator), + _Utils_Tuple2(4, $author$project$Main$actDataBus2InstructionReg), + _Utils_Tuple2(5, $author$project$Main$actDataBus2Ram), + _Utils_Tuple2(6, $author$project$Main$actInstructionReg2AddressBus), + _Utils_Tuple2(7, $author$project$Main$actInstructionReg2ProgrammCounter), + _Utils_Tuple2(8, $author$project$Main$actInstructionReg2UCounter), + _Utils_Tuple2(9, $author$project$Main$actProgrammCounterIncrement), + _Utils_Tuple2(10, $author$project$Main$actInstructionReg2ProgrammCounterIfAccEq0), + _Utils_Tuple2(11, $author$project$Main$actRam2DataBus), + _Utils_Tuple2(12, $author$project$Main$actResetUCounter), + _Utils_Tuple2(13, $author$project$Main$actProgrammCounter2AddressBus), _Utils_Tuple2( - $author$project$Main$ActNothing, + 14, function (s) { return s; }) ]); +var $author$project$Main$uStepPC = function (model) { + var uCounter = model.a.l; + var may_instruction = A2($author$project$Main$valueAt, uCounter, model.q); + if (!may_instruction.$) { + var action = may_instruction.a; + var possible_instructions = A2( + $elm$core$List$filter, + function (s) { + return _Utils_eq(s.a, action); + }, + $author$project$Main$uCodeMaps); + var _v1 = $elm$core$List$head(possible_instructions); + if (!_v1.$) { + var _v2 = _v1.a; + var name = _v2.a; + var instruction = _v2.b; + var old_pc = model.a; + var new_pc = _Utils_update( + old_pc, + {l: old_pc.l + 1}); + return _Utils_update( + model, + { + a: instruction(new_pc) + }); + } else { + var old_pc = model.a; + var new_pc = _Utils_update( + old_pc, + {l: 0}); + return _Utils_update( + model, + {a: new_pc}); + } + } else { + return model; + } +}; +var $author$project$Main$executeInstruction = function (model) { + executeInstruction: + while (true) { + var new_model = $author$project$Main$uStepPC(model); + if (!new_model.a.l) { + return $author$project$Main$uStepPC(new_model); + } else { + var $temp$model = new_model; + model = $temp$model; + continue executeInstruction; + } + } +}; var $author$project$Main$getAction = function (uAction) { var possible_instructions = A2( $elm$core$List$filter, @@ -6755,7 +6814,7 @@ var $author$project$Main$getAction = function (uAction) { }, $author$project$Main$uCodeMaps); var _v0 = $elm$core$List$head(possible_instructions); - if (_v0.$ === 'Just') { + if (!_v0.$) { var _v1 = _v0.a; var name = _v1.a; var instruction = _v1.b; @@ -6768,14 +6827,14 @@ var $author$project$Main$getAction = function (uAction) { }; var $author$project$Main$httpError2String = function (err) { switch (err.$) { - case 'BadUrl': + case 0: var str = err.a; return 'Bad Url: ' + str; - case 'Timeout': + case 1: return 'Timeout'; - case 'NetworkError': + case 2: return 'Network Error'; - case 'BadStatus': + case 3: var num = err.a; return 'Bad Status: ' + $elm$core$String$fromInt(num); default: @@ -6783,45 +6842,6 @@ var $author$project$Main$httpError2String = function (err) { return 'Bad Body: ' + str; } }; -var $elm$core$Basics$not = _Basics_not; -var $author$project$Main$uStepPC = function (model) { - var uCounter = model.pc.uCounter; - var may_instruction = A2($author$project$Main$valueAt, uCounter, model.uCode); - if (may_instruction.$ === 'Just') { - var action = may_instruction.a; - var possible_instructions = A2( - $elm$core$List$filter, - function (s) { - return _Utils_eq(s.a, action); - }, - $author$project$Main$uCodeMaps); - var _v1 = $elm$core$List$head(possible_instructions); - if (_v1.$ === 'Just') { - var _v2 = _v1.a; - var name = _v2.a; - var instruction = _v2.b; - var old_pc = model.pc; - var new_pc = _Utils_update( - old_pc, - {uCounter: old_pc.uCounter + 1}); - return _Utils_update( - model, - { - pc: instruction(new_pc) - }); - } else { - var old_pc = model.pc; - var new_pc = _Utils_update( - old_pc, - {uCounter: 0}); - return _Utils_update( - model, - {pc: new_pc}); - } - } else { - return model; - } -}; var $author$project$Main$update = F2( function (msg, model) { var updateModel = function (new_model) { @@ -6830,286 +6850,321 @@ var $author$project$Main$update = F2( $author$project$Main$cmdUpdateLocalStorage(new_model)); }; switch (msg.$) { - case 'MsgUCycleStep': + case 0: return _Utils_Tuple2( $author$project$Main$uStepPC(model), $author$project$Main$cmdSenduUpdate(model)); - case 'MsgInstructionStep': - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - case 'MsgReset': - return updateModel( - _Utils_update( - model, - { - pc: _Utils_update( - $author$project$Main$initialPC, - {ram: model.pc.ram}) - })); - case 'MsgManualStep': + case 1: + return _Utils_Tuple2( + $author$project$Main$executeInstruction(model), + $author$project$Main$cmdSenduUpdate(model)); + case 2: + var new_model = _Utils_update( + model, + { + a: _Utils_update( + $author$project$Main$initialPC, + {f: model.a.f}) + }); + return _Utils_Tuple2( + new_model, + $author$project$Main$cmdSenduUpdate(new_model)); + case 4: var action = msg.a; var instruction = $author$project$Main$getAction(action); - return updateModel( - _Utils_update( - model, - { - pc: instruction(model.pc) - })); - case 'MsgRamEditAddress': + var new_model = _Utils_update( + model, + { + a: instruction(model.a) + }); + return _Utils_Tuple2( + new_model, + $author$project$Main$cmdSenduUpdate(new_model)); + case 5: var addr = msg.a; var may_int = msg.b; var _v1 = $elm$core$String$toInt(may_int); - if (_v1.$ === 'Just') { + if (!_v1.$) { var _int = _v1.a; - var old_pc = model.pc; + var old_pc = model.a; var _v2 = $author$project$Main$seperateInstructionsEntry( - A2($author$project$Main$valueAtInt, addr, model.pc.ram)); + A2($author$project$Main$valueAtInt, addr, model.a.f)); var inst = _v2.a; var new_val = (inst * 100000) + _int; var new_pc = _Utils_update( old_pc, { - ram: A3($author$project$Main$changeAtInt, addr, new_val, old_pc.ram) + f: A3($author$project$Main$changeAtInt, addr, new_val, old_pc.f) }); return updateModel( _Utils_update( model, - {pc: new_pc})); + {a: new_pc})); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'MsgRamEditInstr': + case 6: var addr = msg.a; var may_int = msg.b; var _v3 = $elm$core$String$toInt(may_int); - if (_v3.$ === 'Just') { + if (!_v3.$) { var _int = _v3.a; - var old_pc = model.pc; + var old_pc = model.a; var _v4 = $author$project$Main$seperateInstructionsEntry( - A2($author$project$Main$valueAtInt, addr, model.pc.ram)); + A2($author$project$Main$valueAtInt, addr, model.a.f)); var address = _v4.b; var new_val = (_int * 100000) + address; var new_pc = _Utils_update( old_pc, { - ram: A3($author$project$Main$changeAtInt, addr, new_val, old_pc.ram) + f: A3($author$project$Main$changeAtInt, addr, new_val, old_pc.f) }); return updateModel( _Utils_update( model, - {pc: new_pc})); + {a: new_pc})); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'MsgRamAddBelow': - var old_pc = model.pc; + case 7: + var old_pc = model.a; var new_pc = _Utils_update( old_pc, { - ram: _Utils_ap( - old_pc.ram, + f: _Utils_ap( + old_pc.f, _List_fromArray( [0])) }); return updateModel( _Utils_update( model, - {pc: new_pc})); - case 'MsgCuEditAction': + {a: new_pc})); + case 8: var addr = msg.a; var may_action = msg.b; var _v5 = $author$project$Main$string2uAction(may_action); - if (_v5.$ === 'Just') { + if (!_v5.$) { var action = _v5.a; - var newCode = A3($author$project$Main$changeAtUCode, addr, action, model.uCode); + var newCode = A3($author$project$Main$changeAtUCode, addr, action, model.q); return updateModel( _Utils_update( model, - {uCode: newCode})); + {q: newCode})); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'MsgCuAddBelow': + case 9: return updateModel( _Utils_update( model, { - uCode: _Utils_ap( - model.uCode, + q: _Utils_ap( + model.q, _List_fromArray( - [$author$project$Main$ActNothing])) + [14])) })); - case 'MsgCuInstrRegEdit': + case 10: var text = msg.a; var _v6 = $elm$core$String$toInt(text); - if (_v6.$ === 'Just') { + if (!_v6.$) { var _int = _v6.a; - var old_pc = model.pc; + var old_pc = model.a; + var _v7 = $author$project$Main$seperateInstructionsEntry(old_pc.k); + var instr = _v7.a; var new_pc = _Utils_update( old_pc, - {instructionReg: _int}); + {k: (instr * 100000) + _int}); return updateModel( _Utils_update( model, - {pc: new_pc})); + {a: new_pc})); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'MsgCuProgCounterEdit': - var text = msg.a; - var _v7 = $elm$core$String$toInt(text); - if (_v7.$ === 'Just') { - var _int = _v7.a; - var old_pc = model.pc; - var new_pc = _Utils_update( - old_pc, - {programmCounter: _int}); - return updateModel( - _Utils_update( - model, - {pc: new_pc})); - } else { - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - } - case 'MsgCuUCounterEdit': + case 11: var text = msg.a; var _v8 = $elm$core$String$toInt(text); - if (_v8.$ === 'Just') { + if (!_v8.$) { var _int = _v8.a; - var old_pc = model.pc; + var old_pc = model.a; + var _v9 = $author$project$Main$seperateInstructionsEntry(old_pc.k); + var addr = _v9.b; var new_pc = _Utils_update( old_pc, - {uCounter: _int}); - return _Utils_Tuple2( + {k: (_int * 100000) + addr}); + return updateModel( _Utils_update( model, - {pc: new_pc}), - $author$project$Main$cmdSenduUpdate(model)); + {a: new_pc})); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'MsgEditAddressBus': - var text = msg.a; - var _v9 = $elm$core$String$toInt(text); - if (_v9.$ === 'Just') { - var _int = _v9.a; - var old_pc = model.pc; - var new_pc = _Utils_update( - old_pc, - {addressBus: _int}); - return _Utils_Tuple2( - _Utils_update( - model, - {pc: new_pc}), - $author$project$Main$cmdSenduUpdate(model)); - } else { - return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - } - case 'MsgEditDataBus': + case 13: var text = msg.a; var _v10 = $elm$core$String$toInt(text); - if (_v10.$ === 'Just') { + if (!_v10.$) { var _int = _v10.a; - var old_pc = model.pc; + var old_pc = model.a; var new_pc = _Utils_update( old_pc, - {dataBus: _int}); + {u: _int}); return updateModel( _Utils_update( model, - {pc: new_pc})); + {a: new_pc})); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'MsgAluEdit': + case 12: var text = msg.a; var _v11 = $elm$core$String$toInt(text); - if (_v11.$ === 'Just') { + if (!_v11.$) { var _int = _v11.a; - var old_pc = model.pc; + var old_pc = model.a; var new_pc = _Utils_update( old_pc, - {accumulator: _int}); - return updateModel( + {l: _int}); + return _Utils_Tuple2( _Utils_update( model, - {pc: new_pc})); + {a: new_pc}), + $author$project$Main$cmdSenduUpdate(model)); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'MsgAutoscrollUpdate': - return updateModel( - _Utils_update( + case 14: + var text = msg.a; + var _v12 = $elm$core$String$toInt(text); + if (!_v12.$) { + var _int = _v12.a; + var old_pc = model.a; + var new_pc = _Utils_update( + old_pc, + {r: _int}); + return _Utils_Tuple2( + _Utils_update( + model, + {a: new_pc}), + $author$project$Main$cmdSenduUpdate(model)); + } else { + return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); + } + case 15: + var text = msg.a; + var _v13 = $elm$core$String$toInt(text); + if (!_v13.$) { + var _int = _v13.a; + var old_pc = model.a; + var new_pc = _Utils_update( + old_pc, + {s: _int}); + return updateModel( + _Utils_update( + model, + {a: new_pc})); + } else { + return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); + } + case 16: + var text = msg.a; + var _v14 = $elm$core$String$toInt(text); + if (!_v14.$) { + var _int = _v14.a; + var old_pc = model.a; + var new_pc = _Utils_update( + old_pc, + {m: _int}); + return updateModel( + _Utils_update( + model, + {a: new_pc})); + } else { + return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); + } + case 3: + if (model.A) { + return updateModel( + _Utils_update( + model, + {A: false})); + } else { + var new_model = _Utils_update( model, - {autoscroll: !model.autoscroll})); - case 'MsgLocalSessionExport': + {A: true}); + return _Utils_Tuple2( + new_model, + $author$project$Main$cmdSenduUpdate(new_model)); + } + case 17: return _Utils_Tuple2( model, $author$project$Main$cmdUpdateLocalStorage(model)); - case 'MsgLocalSessionRecieve': + case 18: var message_in = msg.a; - var _v12 = A2($author$project$Main$decodeModel, model, message_in); - if (_v12.$ === 'Just') { - var new_model = _v12.a; + var _v15 = A2($author$project$Main$decodeModel, model, message_in); + if (!_v15.$) { + var new_model = _v15.a; return _Utils_Tuple2( _Utils_update( new_model, - {examples: model.examples}), + {H: model.H}), $elm$core$Platform$Cmd$none); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'MsgToggleLoadExample': - return model.exampleChooserOpen ? _Utils_Tuple2( + case 19: + return model.G ? _Utils_Tuple2( _Utils_update( model, - {exampleChooserOpen: false}), + {G: false}), $elm$core$Platform$Cmd$none) : _Utils_Tuple2( _Utils_update( model, - {exampleChooserOpen: true}), + {G: true}), $author$project$Main$cmdLoadExamples(model)); - case 'MsgLoadExamplesList': + case 20: return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); - case 'MsgLoadExample': + case 21: var i = msg.a; - var _v13 = A2($author$project$Main$valueAt, i, model.examples); - if (_v13.$ === 'Just') { - var example = _v13.a; + var _v16 = A2($author$project$Main$valueAt, i, model.H); + if (!_v16.$) { + var example = _v16.a; return _Utils_Tuple2( _Utils_update( model, - {exampleChooserOpen: false}), + {G: false}), A2($author$project$Main$cmdLoadExampleSing, model, example)); } else { return _Utils_Tuple2(model, $elm$core$Platform$Cmd$none); } - case 'MsgLoadExampleArrived': + case 22: var result = msg.a; - if (result.$ === 'Ok') { + if (!result.$) { var new_model = result.a; return updateModel( _Utils_update( model, - {exampleLoaderStatus: $author$project$Main$Success, pc: new_model.pc, uCode: new_model.uCode})); + {Q: $author$project$Main$Success, a: new_model.a, q: new_model.q})); } else { var err = result.a; return _Utils_Tuple2( _Utils_update( model, { - exampleLoaderStatus: $author$project$Main$Failure( + Q: $author$project$Main$Failure( $author$project$Main$httpError2String(err)) }), $elm$core$Platform$Cmd$none); } default: var result = msg.a; - if (result.$ === 'Ok') { + if (!result.$) { var exampleList = result.a; return _Utils_Tuple2( _Utils_update( model, - {examples: exampleList, examplesListStatus: $author$project$Main$Success}), + {H: exampleList, R: $author$project$Main$Success}), $elm$core$Platform$Cmd$none); } else { var err = result.a; @@ -7117,7 +7172,7 @@ var $author$project$Main$update = F2( _Utils_update( model, { - examplesListStatus: $author$project$Main$Failure( + R: $author$project$Main$Failure( $author$project$Main$httpError2String(err)) }), $elm$core$Platform$Cmd$none); @@ -7126,12 +7181,11 @@ var $author$project$Main$update = F2( }); var $elm$virtual_dom$VirtualDom$lazy = _VirtualDom_lazy; var $elm$html$Html$Lazy$lazy = $elm$virtual_dom$VirtualDom$lazy; -var $author$project$Main$MsgAutoscrollUpdate = {$: 'MsgAutoscrollUpdate'}; -var $author$project$Main$MsgInstructionStep = {$: 'MsgInstructionStep'}; -var $author$project$Main$MsgLocalSessionExport = {$: 'MsgLocalSessionExport'}; -var $author$project$Main$MsgReset = {$: 'MsgReset'}; -var $author$project$Main$MsgToggleLoadExample = {$: 'MsgToggleLoadExample'}; -var $author$project$Main$MsgUCycleStep = {$: 'MsgUCycleStep'}; +var $author$project$Main$MsgAutoscrollUpdate = {$: 3}; +var $author$project$Main$MsgInstructionStep = {$: 1}; +var $author$project$Main$MsgReset = {$: 2}; +var $author$project$Main$MsgToggleLoadExample = {$: 19}; +var $author$project$Main$MsgUCycleStep = {$: 0}; var $elm$html$Html$button = _VirtualDom_node('button'); var $elm$html$Html$Attributes$boolProperty = F2( function (key, bool) { @@ -7165,7 +7219,7 @@ var $elm$html$Html$Attributes$id = $elm$html$Html$Attributes$stringProperty('id' var $elm$html$Html$input = _VirtualDom_node('input'); var $elm$html$Html$label = _VirtualDom_node('label'); var $elm$virtual_dom$VirtualDom$Normal = function (a) { - return {$: 'Normal', a: a}; + return {$: 0, a: a}; }; var $elm$virtual_dom$VirtualDom$on = _VirtualDom_on; var $elm$html$Html$Events$on = F2( @@ -7185,7 +7239,7 @@ var $elm$virtual_dom$VirtualDom$text = _VirtualDom_text; var $elm$html$Html$text = $elm$virtual_dom$VirtualDom$text; var $elm$html$Html$Attributes$type_ = $elm$html$Html$Attributes$stringProperty('type'); var $author$project$Main$MsgEditAddressBus = function (a) { - return {$: 'MsgEditAddressBus', a: a}; + return {$: 14, a: a}; }; var $elm$core$String$fromList = _String_fromList; var $author$project$Main$addLeadingZero = F2( @@ -7193,59 +7247,35 @@ var $author$project$Main$addLeadingZero = F2( var num_str = $elm$core$String$fromInt(number); return (number < 10) ? _Utils_ap( $elm$core$String$fromList( - A2( - $elm$core$List$repeat, - length - 1, - _Utils_chr('0'))), + A2($elm$core$List$repeat, length - 1, '0')), num_str) : ((number < 100) ? _Utils_ap( $elm$core$String$fromList( - A2( - $elm$core$List$repeat, - length - 2, - _Utils_chr('0'))), + A2($elm$core$List$repeat, length - 2, '0')), num_str) : ((number < 1000) ? _Utils_ap( $elm$core$String$fromList( - A2( - $elm$core$List$repeat, - length - 3, - _Utils_chr('0'))), + A2($elm$core$List$repeat, length - 3, '0')), num_str) : ((number < 10000) ? _Utils_ap( $elm$core$String$fromList( - A2( - $elm$core$List$repeat, - length - 4, - _Utils_chr('0'))), + A2($elm$core$List$repeat, length - 4, '0')), num_str) : ((number < 100000) ? _Utils_ap( $elm$core$String$fromList( - A2( - $elm$core$List$repeat, - length - 5, - _Utils_chr('0'))), + A2($elm$core$List$repeat, length - 5, '0')), num_str) : ((number < 1000000) ? _Utils_ap( $elm$core$String$fromList( - A2( - $elm$core$List$repeat, - length - 6, - _Utils_chr('0'))), + A2($elm$core$List$repeat, length - 6, '0')), num_str) : ((number < 10000000) ? _Utils_ap( $elm$core$String$fromList( - A2( - $elm$core$List$repeat, - length - 7, - _Utils_chr('0'))), + A2($elm$core$List$repeat, length - 7, '0')), num_str) : ((number < 100000000) ? _Utils_ap( $elm$core$String$fromList( - A2( - $elm$core$List$repeat, - length - 8, - _Utils_chr('0'))), + A2($elm$core$List$repeat, length - 8, '0')), num_str) : num_str))))))); }); var $elm$html$Html$Events$alwaysStop = function (x) { return _Utils_Tuple2(x, true); }; var $elm$virtual_dom$VirtualDom$MayStopPropagation = function (a) { - return {$: 'MayStopPropagation', a: a}; + return {$: 1, a: a}; }; var $elm$html$Html$Events$stopPropagationOn = F2( function (event, decoder) { @@ -7304,7 +7334,7 @@ var $author$project$Main$viewAddressBus = function (model) { [ $elm$html$Html$Attributes$type_('number'), $elm$html$Html$Attributes$value( - A2($author$project$Main$addLeadingZero, model.pc.addressBus, 3)), + A2($author$project$Main$addLeadingZero, model.a.r, 3)), $elm$html$Html$Events$onInput($author$project$Main$MsgEditAddressBus) ]), _List_Nil) @@ -7312,10 +7342,10 @@ var $author$project$Main$viewAddressBus = function (model) { ])); }; var $author$project$Main$MsgAluEdit = function (a) { - return {$: 'MsgAluEdit', a: a}; + return {$: 16, a: a}; }; var $author$project$Main$MsgManualStep = function (a) { - return {$: 'MsgManualStep', a: a}; + return {$: 4, a: a}; }; var $elm$html$Html$a = _VirtualDom_node('a'); var $elm$html$Html$h1 = _VirtualDom_node('h1'); @@ -7362,12 +7392,40 @@ var $author$project$Main$viewAlu = function (model) { $elm$html$Html$Attributes$type_('number'), $elm$html$Html$Attributes$id('alu-accumulator'), $elm$html$Html$Attributes$value( - A2($author$project$Main$addLeadingZero, model.pc.accumulator, 8)), + A2($author$project$Main$addLeadingZero, model.a.m, 8)), $elm$html$Html$Events$onInput($author$project$Main$MsgAluEdit) ]), _List_Nil) ])), A2( + $elm$html$Html$p, + _List_Nil, + _List_fromArray( + [ + A2( + $elm$html$Html$button, + _List_fromArray( + [ + $elm$html$Html$Events$onClick( + $author$project$Main$MsgManualStep(2)) + ]), + _List_fromArray( + [ + $elm$html$Html$text('Acc ++') + ])), + A2( + $elm$html$Html$button, + _List_fromArray( + [ + $elm$html$Html$Events$onClick( + $author$project$Main$MsgManualStep(1)) + ]), + _List_fromArray( + [ + $elm$html$Html$text('Acc --') + ])) + ])), + A2( $elm$html$Html$div, _List_fromArray( [ @@ -7389,7 +7447,7 @@ var $author$project$Main$viewAlu = function (model) { _List_fromArray( [ $elm$html$Html$Events$onClick( - $author$project$Main$MsgManualStep($author$project$Main$ActDataBus2Accumulator)) + $author$project$Main$MsgManualStep(3)) ]), _List_fromArray( [ @@ -7420,7 +7478,7 @@ var $author$project$Main$viewAlu = function (model) { _List_fromArray( [ $elm$html$Html$Events$onClick( - $author$project$Main$MsgManualStep($author$project$Main$ActAccumulator2DataBus)) + $author$project$Main$MsgManualStep(0)) ]), _List_fromArray( [ @@ -7431,20 +7489,23 @@ var $author$project$Main$viewAlu = function (model) { ])) ])); }; -var $author$project$Main$MsgCuInstrRegEdit = function (a) { - return {$: 'MsgCuInstrRegEdit', a: a}; +var $author$project$Main$MsgCuInstrRegEditAddr = function (a) { + return {$: 10, a: a}; +}; +var $author$project$Main$MsgCuInstrRegEditInstr = function (a) { + return {$: 11, a: a}; }; var $author$project$Main$MsgCuProgCounterEdit = function (a) { - return {$: 'MsgCuProgCounterEdit', a: a}; + return {$: 13, a: a}; }; var $author$project$Main$MsgCuUCounterEdit = function (a) { - return {$: 'MsgCuUCounterEdit', a: a}; + return {$: 12, a: a}; }; var $elm$html$Html$table = _VirtualDom_node('table'); var $elm$html$Html$th = _VirtualDom_node('th'); var $elm$html$Html$thead = _VirtualDom_node('thead'); var $elm$html$Html$tr = _VirtualDom_node('tr'); -var $author$project$Main$MsgCuAddBelow = {$: 'MsgCuAddBelow'}; +var $author$project$Main$MsgCuAddBelow = {$: 9}; var $elm$core$Tuple$pair = F2( function (a, b) { return _Utils_Tuple2(a, b); @@ -7453,7 +7514,7 @@ var $elm$html$Html$tbody = _VirtualDom_node('tbody'); var $elm$html$Html$td = _VirtualDom_node('td'); var $author$project$Main$MsgCuEditAction = F2( function (a, b) { - return {$: 'MsgCuEditAction', a: a, b: b}; + return {$: 8, a: a, b: b}; }); var $elm$html$Html$option = _VirtualDom_node('option'); var $elm$html$Html$select = _VirtualDom_node('select'); @@ -7464,20 +7525,21 @@ var $author$project$Main$selectCuValueDecoder = A2( var $elm$html$Html$Attributes$selected = $elm$html$Html$Attributes$boolProperty('selected'); var $author$project$Main$uCodeDescriptions = _List_fromArray( [ - _Utils_Tuple2($author$project$Main$ActAccumulator2DataBus, 'Acc -> DataBus'), - _Utils_Tuple2($author$project$Main$ActAccumulatorDecrement, 'Acc --'), - _Utils_Tuple2($author$project$Main$ActAccumulatorIncrement, 'Acc ++'), - _Utils_Tuple2($author$project$Main$ActDataBus2Accumulator, 'DataBus -> Acc'), - _Utils_Tuple2($author$project$Main$ActDataBus2InstructionReg, 'DataBus -> InstReg'), - _Utils_Tuple2($author$project$Main$ActDataBus2Ram, 'DataBus -> Ram'), - _Utils_Tuple2($author$project$Main$ActInstructionReg2AddressBus, 'InstReg -> AddrBus'), - _Utils_Tuple2($author$project$Main$ActInstructionReg2ProgrammCounter, 'InstReg -> ProgCount'), - _Utils_Tuple2($author$project$Main$ActInstructionReg2UCounter, 'InstReg -> µCounter'), - _Utils_Tuple2($author$project$Main$ActProgrammCounterIncrement, 'ProgCounter ++'), - _Utils_Tuple2($author$project$Main$ActRam2DataBus, 'Ram -> DataBus'), - _Utils_Tuple2($author$project$Main$ActResetUCounter, 'µCounter = 0'), - _Utils_Tuple2($author$project$Main$ActProgrammCounter2AddressBus, 'ProgCounter -> AddrBus'), - _Utils_Tuple2($author$project$Main$ActNothing, 'Empty') + _Utils_Tuple2(0, 'Acc -> DataBus'), + _Utils_Tuple2(1, 'Acc --'), + _Utils_Tuple2(2, 'Acc ++'), + _Utils_Tuple2(3, 'DataBus -> Acc'), + _Utils_Tuple2(4, 'DataBus -> InstReg'), + _Utils_Tuple2(5, 'DataBus -> Ram'), + _Utils_Tuple2(6, 'InstReg -> AddrBus'), + _Utils_Tuple2(7, 'InstReg -> ProgCount'), + _Utils_Tuple2(8, 'InstReg -> µCounter'), + _Utils_Tuple2(9, 'ProgCounter ++'), + _Utils_Tuple2(10, 'Acc == 0 => InstReg -> ProgCounter'), + _Utils_Tuple2(11, 'Ram -> DataBus'), + _Utils_Tuple2(12, 'µCounter = 0'), + _Utils_Tuple2(13, 'ProgCounter -> AddrBus'), + _Utils_Tuple2(14, 'Empty') ]); var $author$project$Main$viewCuInstrSelect = F2( function (id, current) { @@ -7526,10 +7588,8 @@ var $author$project$Main$viewCuUCodeContent = function (model) { [ _Utils_Tuple2( 'current', - _Utils_eq(id, model.pc.uCounter)), - _Utils_Tuple2( - 'empty', - _Utils_eq(code, $author$project$Main$ActNothing)) + _Utils_eq(id, model.a.l)), + _Utils_Tuple2('empty', code === 14) ])) ]), _List_fromArray( @@ -7554,7 +7614,7 @@ var $author$project$Main$viewCuUCodeContent = function (model) { ])) ])); }; - var indexedList = A2($elm$core$List$indexedMap, $elm$core$Tuple$pair, model.uCode); + var indexedList = A2($elm$core$List$indexedMap, $elm$core$Tuple$pair, model.q); return A2( $elm$html$Html$tbody, _List_Nil, @@ -7614,14 +7674,14 @@ var $author$project$Main$viewCuUCode = function (model) { ]), _List_fromArray( [ - $elm$html$Html$text('Addr') + $elm$html$Html$text('µCounter') ])), A2( $elm$html$Html$th, _List_Nil, _List_fromArray( [ - $elm$html$Html$text('Code') + $elm$html$Html$text('µCode') ])) ])) ])), @@ -7629,6 +7689,9 @@ var $author$project$Main$viewCuUCode = function (model) { ])); }; var $author$project$Main$viewCu = function (model) { + var _v0 = $author$project$Main$seperateInstructionsEntry(model.a.k); + var instrRegInst = _v0.a; + var instrRegAddr = _v0.b; return A2( $elm$html$Html$div, _List_fromArray( @@ -7661,7 +7724,7 @@ var $author$project$Main$viewCu = function (model) { _List_fromArray( [ $elm$html$Html$Events$onClick( - $author$project$Main$MsgManualStep($author$project$Main$ActInstructionReg2AddressBus)) + $author$project$Main$MsgManualStep(6)) ]), _List_fromArray( [ @@ -7694,7 +7757,7 @@ var $author$project$Main$viewCu = function (model) { _List_fromArray( [ $elm$html$Html$Events$onClick( - $author$project$Main$MsgManualStep($author$project$Main$ActProgrammCounter2AddressBus)) + $author$project$Main$MsgManualStep(13)) ]), _List_fromArray( [ @@ -7737,13 +7800,24 @@ var $author$project$Main$viewCu = function (model) { $elm$html$Html$text('Programm Counter:') ])), A2( + $elm$html$Html$button, + _List_fromArray( + [ + $elm$html$Html$Events$onClick( + $author$project$Main$MsgManualStep(7)) + ]), + _List_fromArray( + [ + $elm$html$Html$text('InstRA -> ') + ])), + A2( $elm$html$Html$input, _List_fromArray( [ $elm$html$Html$Attributes$type_('number'), $elm$html$Html$Attributes$id('cu-progcounter'), $elm$html$Html$Attributes$value( - A2($author$project$Main$addLeadingZero, model.pc.programmCounter, 3)), + A2($author$project$Main$addLeadingZero, model.a.u, 3)), $elm$html$Html$Events$onInput($author$project$Main$MsgCuProgCounterEdit) ]), _List_Nil) @@ -7767,16 +7841,35 @@ var $author$project$Main$viewCu = function (model) { $elm$html$Html$text('Instruction Register:') ])), A2( - $elm$html$Html$input, + $elm$html$Html$div, + _List_Nil, _List_fromArray( [ - $elm$html$Html$Attributes$type_('number'), - $elm$html$Html$Attributes$id('cu-instrReg'), - $elm$html$Html$Attributes$value( - A2($author$project$Main$addLeadingZero, model.pc.instructionReg, 8)), - $elm$html$Html$Events$onInput($author$project$Main$MsgCuInstrRegEdit) - ]), - _List_Nil) + A2( + $elm$html$Html$input, + _List_fromArray( + [ + $elm$html$Html$Attributes$type_('number'), + $elm$html$Html$Attributes$id('cu-instrReg'), + $elm$html$Html$Attributes$class('instruction'), + $elm$html$Html$Attributes$value( + A2($author$project$Main$addLeadingZero, instrRegInst, 3)), + $elm$html$Html$Events$onInput($author$project$Main$MsgCuInstrRegEditInstr) + ]), + _List_Nil), + A2( + $elm$html$Html$input, + _List_fromArray( + [ + $elm$html$Html$Attributes$type_('number'), + $elm$html$Html$Attributes$id('cu-instrReg'), + $elm$html$Html$Attributes$class('address'), + $elm$html$Html$Attributes$value( + A2($author$project$Main$addLeadingZero, instrRegAddr, 5)), + $elm$html$Html$Events$onInput($author$project$Main$MsgCuInstrRegEditAddr) + ]), + _List_Nil) + ])) ])), A2( $elm$html$Html$div, @@ -7797,13 +7890,24 @@ var $author$project$Main$viewCu = function (model) { $elm$html$Html$text('µCode Counter:') ])), A2( + $elm$html$Html$button, + _List_fromArray( + [ + $elm$html$Html$Events$onClick( + $author$project$Main$MsgManualStep(8)) + ]), + _List_fromArray( + [ + $elm$html$Html$text('IntrRI ->') + ])), + A2( $elm$html$Html$input, _List_fromArray( [ $elm$html$Html$Attributes$type_('number'), $elm$html$Html$Attributes$id('cu-uCounter'), $elm$html$Html$Attributes$value( - A2($author$project$Main$addLeadingZero, model.pc.uCounter, 4)), + A2($author$project$Main$addLeadingZero, model.a.l, 4)), $elm$html$Html$Events$onInput($author$project$Main$MsgCuUCounterEdit) ]), _List_Nil) @@ -7841,7 +7945,7 @@ var $author$project$Main$viewCu = function (model) { _List_fromArray( [ $elm$html$Html$Events$onClick( - $author$project$Main$MsgManualStep($author$project$Main$ActDataBus2InstructionReg)) + $author$project$Main$MsgManualStep(4)) ]), _List_fromArray( [ @@ -7853,7 +7957,7 @@ var $author$project$Main$viewCu = function (model) { ])); }; var $author$project$Main$MsgEditDataBus = function (a) { - return {$: 'MsgEditDataBus', a: a}; + return {$: 15, a: a}; }; var $author$project$Main$viewDataBus = function (model) { return A2( @@ -7885,15 +7989,16 @@ var $author$project$Main$viewDataBus = function (model) { [ $elm$html$Html$Attributes$type_('number'), $elm$html$Html$Attributes$value( - A2($author$project$Main$addLeadingZero, model.pc.dataBus, 8)), + A2($author$project$Main$addLeadingZero, model.a.s, 8)), $elm$html$Html$Events$onInput($author$project$Main$MsgEditDataBus) ]), _List_Nil) ])) ])); }; +var $elm$core$Basics$not = _Basics_not; var $author$project$Main$MsgLoadExample = function (a) { - return {$: 'MsgLoadExample', a: a}; + return {$: 21, a: a}; }; var $author$project$Main$viewExamplesEntrys = function (model) { var entry2html = function (_v1) { @@ -7909,7 +8014,7 @@ var $author$project$Main$viewExamplesEntrys = function (model) { _List_Nil, _List_fromArray( [ - $elm$html$Html$text('Example: ' + example.title) + $elm$html$Html$text('Example: ' + example.aA) ])), A2( $elm$html$Html$td, @@ -7930,9 +8035,9 @@ var $author$project$Main$viewExamplesEntrys = function (model) { ])) ])); }; - var _v0 = model.examplesListStatus; + var _v0 = model.R; switch (_v0.$) { - case 'Failure': + case 0: var msg = _v0.a; return A2( $elm$html$Html$div, @@ -7941,7 +8046,7 @@ var $author$project$Main$viewExamplesEntrys = function (model) { [ $elm$html$Html$text('That didn\'t work: ' + msg) ])); - case 'Waiting': + case 1: return A2( $elm$html$Html$div, _List_Nil, @@ -7964,7 +8069,7 @@ var $author$project$Main$viewExamplesEntrys = function (model) { A2( $elm$core$List$map, entry2html, - A2($elm$core$List$indexedMap, $elm$core$Tuple$pair, model.examples))) + A2($elm$core$List$indexedMap, $elm$core$Tuple$pair, model.H))) ])); } }; @@ -7977,7 +8082,7 @@ var $author$project$Main$viewExamples = function (model) { _List_fromArray( [ _Utils_Tuple2('modal', true), - _Utils_Tuple2('hidden', !model.exampleChooserOpen) + _Utils_Tuple2('hidden', !model.G) ])) ]), _List_fromArray( @@ -8004,8 +8109,8 @@ var $author$project$Main$viewExamples = function (model) { ])); }; var $author$project$Main$viewExamplesLoaderError = function (model) { - var _v0 = model.exampleLoaderStatus; - if (_v0.$ === 'Failure') { + var _v0 = model.Q; + if (!_v0.$) { var msg = _v0.a; return A2( $elm$html$Html$div, @@ -8044,14 +8149,14 @@ var $author$project$Main$viewExamplesLoaderError = function (model) { return $elm$html$Html$text(''); } }; -var $author$project$Main$MsgRamAddBelow = {$: 'MsgRamAddBelow'}; +var $author$project$Main$MsgRamAddBelow = {$: 7}; var $author$project$Main$MsgRamEditAddress = F2( function (a, b) { - return {$: 'MsgRamEditAddress', a: a, b: b}; + return {$: 5, a: a, b: b}; }); var $author$project$Main$MsgRamEditInstr = F2( function (a, b) { - return {$: 'MsgRamEditInstr', a: a, b: b}; + return {$: 6, a: a, b: b}; }); var $author$project$Main$viewRamContent = function (model) { var ram2table = function (entry) { @@ -8069,7 +8174,7 @@ var $author$project$Main$viewRamContent = function (model) { [ _Utils_Tuple2( 'current', - _Utils_eq(id, model.pc.addressBus)) + _Utils_eq(id, model.a.r)) ])) ]), _List_fromArray( @@ -8122,7 +8227,7 @@ var $author$project$Main$viewRamContent = function (model) { ])) ])); }; - var indexedRam = A2($elm$core$List$indexedMap, $elm$core$Tuple$pair, model.pc.ram); + var indexedRam = A2($elm$core$List$indexedMap, $elm$core$Tuple$pair, model.a.f); return A2( $elm$html$Html$tbody, _List_Nil, @@ -8261,7 +8366,7 @@ var $author$project$Main$viewRam = function (model) { _List_fromArray( [ $elm$html$Html$Events$onClick( - $author$project$Main$MsgManualStep($author$project$Main$ActRam2DataBus)) + $author$project$Main$MsgManualStep(11)) ]), _List_fromArray( [ @@ -8292,7 +8397,7 @@ var $author$project$Main$viewRam = function (model) { _List_fromArray( [ $elm$html$Html$Events$onClick( - $author$project$Main$MsgManualStep($author$project$Main$ActDataBus2Ram)) + $author$project$Main$MsgManualStep(5)) ]), _List_fromArray( [ @@ -8329,7 +8434,7 @@ var $author$project$Main$viewPC = function (model) { ]), _List_fromArray( [ - $elm$html$Html$text('µZyklus') + $elm$html$Html$text('µCycle') ])), A2( $elm$html$Html$button, @@ -8360,7 +8465,7 @@ var $author$project$Main$viewPC = function (model) { [ _Utils_Tuple2('checker', true), _Utils_Tuple2('button', true), - _Utils_Tuple2('checked', model.autoscroll) + _Utils_Tuple2('checked', model.A) ])), $elm$html$Html$Events$onClick($author$project$Main$MsgAutoscrollUpdate) ]), @@ -8372,7 +8477,7 @@ var $author$project$Main$viewPC = function (model) { [ $elm$html$Html$Attributes$type_('checkbox'), $elm$html$Html$Attributes$id('enableScrolling'), - $elm$html$Html$Attributes$checked(model.autoscroll), + $elm$html$Html$Attributes$checked(model.A), $elm$html$Html$Events$onClick($author$project$Main$MsgAutoscrollUpdate) ]), _List_Nil), @@ -8389,16 +8494,6 @@ var $author$project$Main$viewPC = function (model) { ])), A2( $elm$html$Html$button, - _List_fromArray( - [ - $elm$html$Html$Events$onClick($author$project$Main$MsgLocalSessionExport) - ]), - _List_fromArray( - [ - $elm$html$Html$text('Export') - ])), - A2( - $elm$html$Html$button, _List_fromArray( [ $elm$html$Html$Events$onClick($author$project$Main$MsgToggleLoadExample) @@ -8439,6 +8534,6 @@ var $author$project$Main$view = function (model) { return A2($elm$html$Html$Lazy$lazy, $author$project$Main$viewPC, model); }; var $author$project$Main$main = $elm$browser$Browser$element( - {init: $author$project$Main$init, subscriptions: $author$project$Main$subscriptions, update: $author$project$Main$update, view: $author$project$Main$view}); + {aR: $author$project$Main$init, a0: $author$project$Main$subscriptions, a2: $author$project$Main$update, a4: $author$project$Main$view}); _Platform_export({'Main':{'init':$author$project$Main$main( - $elm$json$Json$Decode$succeed(_Utils_Tuple0))(0)}});}(this)); \ No newline at end of file + $elm$json$Json$Decode$succeed(0))(0)}});}(this)); \ No newline at end of file diff --git a/out/index.html b/out/index.html index 9fd50a3..41bcfee 100644 --- a/out/index.html +++ b/out/index.html @@ -4,9 +4,9 @@ - Zähler - - + Johnny Simulator + + @@ -17,6 +17,7 @@ + -
+
+
Sorry, but this app needs Javascript to run :/
+
+ +
+ +
+
+ + +
+ +
+

How this App works

+

+ Hello. In order for you to understand what this App does, I want to show you some basics of this app. +

+ +

Control Buttons

+

+ At the top of the application you can see a row of control buttons: +

+
    +
  • + µCycle + With this button you can execute a single µCode Step. +
  • +
  • + Instruction + This button executes a whole instruction at a time. This way you don't have to press µCycle all the time. +
  • +
  • + Reset PC + With this, you can reset the pc. Please note that ram und µCodes are not reset. +
  • +
  • + Autoscroll + After a value in RAM or in the µCodes is selected you can automatically scroll to them +
  • +
  • + Load Example + Click this button and select an example you want to load. This will overwrite the whole pc including ram and µCode +
  • +
+ +

Blocks

+

+ This computer is made up by multiple blocks like any other neumann-maschiene. Every block has it's own unique set of functions. A normal computer is much more complex than this, but the principle is the same. +

+ +

RAM

+

+ The current programm is stored in the RAM. Every entry is seperated as mentioned in entry. +

+ +

Control Unit

+

+ As the name suggests, the control unit manages everything that is done. To know what needs to be done it has a list of µCodes that gets executed when a instruction is requested. +

+ These µCodes can be found in the table. Every instruction consists of up to 10 µCodes.
+ When a entry is executed, the first three digits (the instruction) gets multiplied by 10. This now is written into the µCounter and the µCodes for it get's executed. +

+ Example:
+ When the entry 001 00000 gets executed, the µCounter would be set to 0010. Now every µCode starting at location 0010 in the µCodes gets executed. +

+

ALU

+

+ The Arithmetic Logic Unit is pretty simple in this case. +

+

+ The ALU can only increment or decrement the accumulator. But it can read numbers from databus. +

+

Databus

+

+ Via the Databus values and entrys can be transported between RAM, Control Unit and ALU. +

+

Addressbus

+

+ With the addressbus the Control Unit can control which value is selected in RAM. On a normal computer there are a lot mor things attached to this bus. +

+ + +

Entry

+

+ Each entry consits of a instruction and an argument. That's why the entrys in RAM and in µCodes are displayed seperatly. +

+
+          
+            0 0 0   0 0 0 0 0
+            Instr   Argument
+          
+        
+ +

µCodes

+

+ Every instruction consists of a list of µCodes. Here is an explanaition for all of them: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
µCodeDescription
ProgCounter -> AddrBusLoad the value from programm counter to addressbus
InstrReg -> ProgCounterLoad the argument from instruction register to programm counter
ProgCounter ++Increment programm counter by 1
Acc == 0 => InstReg -> ProgCounterIf the accumulator is 0 then write the argument from instruction register to programm counter
Ram -> DataBusLoad selected value from RAM to databus
DataBus -> RamWrite value from databus to selected value in RAM
DataBus -> InstRegWrite entry from databus to instruction register
DataBus -> AccWrite value from databus to accumulator
Acc -> DataBusLoad value from accumulator to databus
Acc ++Increment accumulator by 1
Acc --Decrement accumulator by 1
InstReg -> µCounterTake the instruction from instruction register, add a 0 at the tail and write it to µCounter
InstReg -> AddrBusWrite the argument from instruction register to addressbus
µCounter = 0Set µCounter to 0
+ +

Source

+

+ At the moment the code for this project isn't good enough to share it online. +

+

+ This project is my take on Johnny-Simulator. +

+
+ + +
+ + + diff --git a/out/script.js b/out/script.js index c3eb689..7a191c1 100644 --- a/out/script.js +++ b/out/script.js @@ -1,76 +1,26 @@ -// Init Elm -var app = Elm.Main.init({ - node: document.getElementById("elm"), - // flags: Date.now() -}); +let text_de = document.getElementById("langDE"); +let text_en = document.getElementById("langEN"); -// Dom Objects -let pc = document.getElementsByClassName("pc")[0]; -let pc_ram = pc.getElementsByClassName("ram")[0]; -let pc_cu = pc.getElementsByClassName("cu")[0]; -let pc_alu = pc.getElementsByClassName("alu")[0]; +let btn_changeToDe = document.getElementById("langPickerDE"); +let btn_changeToEn = document.getElementById("langPickerEN"); -let pc_ram_scroller = pc_ram.getElementsByClassName("scroller")[0]; -let pc_cu_scroller = pc_cu.getElementsByClassName("scroller")[0]; +let lang = (typeof document.documentElement.lang == "string") ? document.documentElement.lang: "en" -let control_autoscroll = document.getElementById("enableScrolling"); -// Methods -function scrollToCurrent(){ - if( control_autoscroll.checked == false ) return; - - let current_ram = pc_ram.getElementsByClassName("current")[0]; - if( typeof current_ram != "undefined"){ - current_ram.scrollIntoView({behavior: "smooth", block: "center"}); - } - - let current_uCode = pc_cu.getElementsByClassName("current")[0]; - if( typeof current_uCode != "undefined"){ - current_uCode.scrollIntoView({behavior: "smooth", block: "center"}); - } +function changeLang(lang){ + if(lang == "de"){ + text_de.classList.remove("hidden"); + text_en.classList.add("hidden"); + }else{ + text_en.classList.remove("hidden"); + text_de.classList.add("hidden"); + } } - -function shrinkTableHead(scroll){ - let scroller = scroll.target; - let pos = scroller.scrollTop; - let thead = scroller.getElementsByClassName("head")[0]; - - if( pos > 70 ){ - thead.classList.add("shrunk"); - }else if (pos < 40){ - thead.classList.remove("shrunk"); - } - -} - -function loadStorage() { - let content = localStorage.getItem("pc_data"); - if( typeof content == "string" ){ - app.ports.localStorageRecieve.send( content ); - } -} +btn_changeToEn.addEventListener("click", () => { changeLang("en") } ); +btn_changeToDe.addEventListener("click", () => { changeLang("de") } ); -// Load last state of pc -loadStorage(); - -// EVENT LISTENERS -pc_ram_scroller.addEventListener("scroll", shrinkTableHead); -pc_cu_scroller.addEventListener("scroll", shrinkTableHead); - -// Recieve Elm updates via ports -app.ports.sendUUpdate.subscribe( (message) => { - // console.log("Update: ", message); - scrollToCurrent(); - - // Make sure that even when the calculation takes longer it will scroll correctly - setTimeout( scrollToCurrent, 100 ); -} ); - -// Recieve LocalSession Updates via Ports -app.ports.localStorageSend.subscribe( (message) => { - console.log("localSessionSend: ", message); - localStorage.setItem("pc_data", message); -} ); +// Do stuff on loading +changeLang( lang ); \ No newline at end of file diff --git a/src/Main.elm b/src/Main.elm index bfc6030..8749cef 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -74,6 +74,7 @@ type UAction | ActInstructionReg2ProgrammCounter | ActInstructionReg2UCounter | ActProgrammCounterIncrement + | ActInstructionReg2ProgrammCounterIfAccEq0 | ActRam2DataBus | ActResetUCounter | ActProgrammCounter2AddressBus @@ -91,6 +92,7 @@ uCodeDescriptions = , ( ActInstructionReg2ProgrammCounter, "InstReg -> ProgCount" ) , ( ActInstructionReg2UCounter, "InstReg -> µCounter" ) , ( ActProgrammCounterIncrement, "ProgCounter ++" ) + , ( ActInstructionReg2ProgrammCounterIfAccEq0, "Acc == 0 => InstReg -> ProgCounter") , ( ActRam2DataBus, "Ram -> DataBus" ) , ( ActResetUCounter, "µCounter = 0" ) , ( ActProgrammCounter2AddressBus, "ProgCounter -> AddrBus" ) @@ -109,6 +111,7 @@ uCodeIds = , ( ActInstructionReg2ProgrammCounter, "ir2pc" ) , ( ActInstructionReg2UCounter, "ir2uc" ) , ( ActProgrammCounterIncrement, "pcInc" ) + , ( ActInstructionReg2ProgrammCounterIfAccEq0, "ir2pciacceq0") , ( ActRam2DataBus, "ram2db" ) , ( ActResetUCounter, "ucReset" ) , ( ActProgrammCounter2AddressBus, "pc2ab" ) @@ -127,6 +130,7 @@ uCodeMaps = , ( ActInstructionReg2ProgrammCounter, actInstructionReg2ProgrammCounter ) , ( ActInstructionReg2UCounter, actInstructionReg2UCounter ) , ( ActProgrammCounterIncrement, actProgrammCounterIncrement ) + , ( ActInstructionReg2ProgrammCounterIfAccEq0, actInstructionReg2ProgrammCounterIfAccEq0 ) , ( ActRam2DataBus, actRam2DataBus ) , ( ActResetUCounter, actResetUCounter ) , ( ActProgrammCounter2AddressBus, actProgrammCounter2AddressBus ) @@ -236,7 +240,8 @@ type Msg | MsgRamAddBelow | MsgCuEditAction Int String | MsgCuAddBelow - | MsgCuInstrRegEdit String + | MsgCuInstrRegEditAddr String + | MsgCuInstrRegEditInstr String | MsgCuUCounterEdit String | MsgCuProgCounterEdit String | MsgEditAddressBus String @@ -265,16 +270,22 @@ update msg model = ) MsgInstructionStep -> - ( model, Cmd.none ) + ( executeInstruction model + , cmdSenduUpdate model ) + MsgReset -> - updateModel { model | pc = { initialPC | ram = model.pc.ram } } + let + new_model = { model | pc = { initialPC | ram = model.pc.ram } } + in + ( new_model, cmdSenduUpdate new_model ) MsgManualStep action -> let instruction = getAction action + new_model = { model | pc = instruction model.pc } in - updateModel { model | pc = instruction model.pc} + ( new_model, cmdSenduUpdate new_model ) MsgRamEditAddress addr may_int -> case String.toInt may_int of @@ -319,11 +330,22 @@ update msg model = MsgCuAddBelow -> updateModel {model | uCode = model.uCode ++ [ ActNothing ]} - MsgCuInstrRegEdit text -> + MsgCuInstrRegEditAddr text -> case String.toInt text of Just int -> let old_pc = model.pc - new_pc = { old_pc | instructionReg = int } + (instr,_) = seperateInstructionsEntry old_pc.instructionReg + new_pc = { old_pc | instructionReg = instr * 100000 + int } + in + updateModel { model | pc = new_pc } + _ -> ( model, Cmd.none ) + + MsgCuInstrRegEditInstr text -> + case String.toInt text of + Just int -> + let old_pc = model.pc + (_,addr) = seperateInstructionsEntry old_pc.instructionReg + new_pc = { old_pc | instructionReg = int * 100000 + addr } in updateModel { model | pc = new_pc } _ -> ( model, Cmd.none ) @@ -374,7 +396,14 @@ update msg model = _ -> ( model, Cmd.none ) MsgAutoscrollUpdate -> - updateModel { model | autoscroll = not model.autoscroll } + if model.autoscroll then + updateModel { model | autoscroll = False } + else + let + new_model = { model | autoscroll = True } + in + ( new_model + , cmdSenduUpdate new_model ) MsgLocalSessionExport -> ( model, cmdUpdateLocalStorage model ) @@ -481,6 +510,16 @@ uStepPC model = model +executeInstruction : Model -> Model +executeInstruction model = + let + new_model = uStepPC model + in + if new_model.pc.uCounter == 0 then + uStepPC new_model + else + executeInstruction new_model + encodeModel : Model -> String encodeModel model = JE.object @@ -595,7 +634,7 @@ viewPC model = div [ class "pc" ] [ div [ class "controls", class "grid-fullwidth" ] - [ button [ onClick MsgUCycleStep ] [ text "µZyklus" ] + [ button [ onClick MsgUCycleStep ] [ text "µCycle" ] , button [ onClick MsgInstructionStep ] [ text "Instruction" ] , button [ onClick MsgReset ] [ text "Reset PC" ] , div @@ -616,7 +655,6 @@ viewPC model = [ HAttr.for "enableScrolling" ] [ text "Autoscroll" ] ] - , button [ onClick MsgLocalSessionExport ] [ text "Export" ] , button [ onClick MsgToggleLoadExample ] [ text "Load Example" ] ] , div [ class "grid-fullwidth" ] [ lazy viewAddressBus model ] @@ -715,6 +753,9 @@ viewRamContent model = viewCu : Model -> Html Msg viewCu model = + let + ( instrRegInst, instrRegAddr ) = seperateInstructionsEntry model.pc.instructionReg + in div [ class "section", class "cu" ] [ div [ class "arrow", class "up", class "top"] [ div [ class "button" ] @@ -730,6 +771,9 @@ viewCu model = , p [] [ div [class "input-row"] [ Html.label [ HAttr.for "cu-progcounter" ] [ text "Programm Counter:" ] + , button + [ onClick <| MsgManualStep ActInstructionReg2ProgrammCounter ] + [ text "InstRA -> " ] , Html.input [ HAttr.type_ "number" , HAttr.id "cu-progcounter" @@ -740,16 +784,30 @@ viewCu model = , div [class "input-row"] [ Html.label [ HAttr.for "cu-instrReg" ] [ text "Instruction Register:" ] - , Html.input - [ HAttr.type_ "number" - , HAttr.id "cu-instrReg" - , value (addLeadingZero model.pc.instructionReg 8) - , onInput MsgCuInstrRegEdit - ] [] + , div [] + [ Html.input + [ HAttr.type_ "number" + , HAttr.id "cu-instrReg" + , class "instruction" + , value (addLeadingZero instrRegInst 3) + , onInput MsgCuInstrRegEditInstr + ] [] + , Html.input + [ HAttr.type_ "number" + , HAttr.id "cu-instrReg" + , class "address" + , value (addLeadingZero instrRegAddr 5) + , onInput MsgCuInstrRegEditAddr + ] [] + ] ] , div [class "input-row"] [ Html.label [ HAttr.for "cu-uCounter" ] [ text "µCode Counter:" ] + , button + [ onClick <| MsgManualStep ActInstructionReg2UCounter + ] + [ text "IntrRI ->" ] , Html.input [ HAttr.type_ "number" , HAttr.id "cu-uCounter" @@ -775,8 +833,8 @@ viewCuUCode model = Html.table [] [ Html.thead [ class "head" ] [ Html.tr [] - [ Html.th [ class "address" ] [ text "Addr" ] - , Html.th [] [ text "Code" ] + [ Html.th [ class "address" ] [ text "µCounter" ] + , Html.th [] [ text "µCode" ] ] ] , lazy viewCuUCodeContent model @@ -846,7 +904,10 @@ viewAlu model = , value (addLeadingZero model.pc.accumulator 8) , onInput MsgAluEdit ] [] - + ] + , p [] + [ button [ onClick <| MsgManualStep ActAccumulatorIncrement ] [ text "Acc ++" ] + , button [ onClick <| MsgManualStep ActAccumulatorDecrement ] [ text "Acc --" ] ] , div [ class "arrow", class "up"] [ div [ class "button" ] @@ -1003,6 +1064,15 @@ actProgrammCounter2AddressBus : PC -> PC actProgrammCounter2AddressBus pc = { pc | addressBus = pc.programmCounter } +actInstructionReg2ProgrammCounterIfAccEq0 : PC -> PC +actInstructionReg2ProgrammCounterIfAccEq0 pc = + if pc.accumulator == 0 then + let + (_,addr) = seperateInstructionsEntry pc.instructionReg + in + { pc | programmCounter = addr } + else + pc actDataBus2Accumulator : PC -> PC actDataBus2Accumulator pc =