Add Leading 0 before addresses

This commit is contained in:
2020-12-25 14:38:20 +01:00
parent 413105e4be
commit 3af69db95a
2 changed files with 107 additions and 13 deletions

View File

@ -5715,6 +5715,60 @@ var $elm$html$Html$Events$onClick = function (msg) {
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 $elm$core$String$fromList = _String_fromList;
var $author$project$Main$addLeadingZero = F2(
function (number, length) {
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'))),
num_str) : ((number < 100) ? _Utils_ap(
$elm$core$String$fromList(
A2(
$elm$core$List$repeat,
length - 2,
_Utils_chr('0'))),
num_str) : ((number < 1000) ? _Utils_ap(
$elm$core$String$fromList(
A2(
$elm$core$List$repeat,
length - 3,
_Utils_chr('0'))),
num_str) : ((number < 10000) ? _Utils_ap(
$elm$core$String$fromList(
A2(
$elm$core$List$repeat,
length - 4,
_Utils_chr('0'))),
num_str) : ((number < 100000) ? _Utils_ap(
$elm$core$String$fromList(
A2(
$elm$core$List$repeat,
length - 5,
_Utils_chr('0'))),
num_str) : ((number < 1000000) ? _Utils_ap(
$elm$core$String$fromList(
A2(
$elm$core$List$repeat,
length - 6,
_Utils_chr('0'))),
num_str) : ((number < 10000000) ? _Utils_ap(
$elm$core$String$fromList(
A2(
$elm$core$List$repeat,
length - 7,
_Utils_chr('0'))),
num_str) : ((number < 100000000) ? _Utils_ap(
$elm$core$String$fromList(
A2(
$elm$core$List$repeat,
length - 8,
_Utils_chr('0'))),
num_str) : num_str)))))));
});
var $elm$html$Html$span = _VirtualDom_node('span');
var $author$project$Main$viewAddressBus = function (model) {
return A2(
@ -5741,7 +5795,7 @@ var $author$project$Main$viewAddressBus = function (model) {
_List_fromArray(
[
$elm$html$Html$text(
$elm$core$String$fromInt(model.pc.addressBus))
A2($author$project$Main$addLeadingZero, model.pc.addressBus, 3))
]))
]));
};
@ -5914,7 +5968,7 @@ var $author$project$Main$viewCuUCodeContent = function (model) {
_List_fromArray(
[
$elm$html$Html$text(
$elm$core$String$fromInt(id))
A2($author$project$Main$addLeadingZero, id, 3))
])),
A2(
$elm$html$Html$td,
@ -5942,7 +5996,7 @@ var $author$project$Main$viewCuUCodeContent = function (model) {
_List_fromArray(
[
$elm$html$Html$text(
$elm$core$String$fromInt(id))
A2($author$project$Main$addLeadingZero, id, 3))
])),
A2(
$elm$html$Html$td,
@ -6178,10 +6232,16 @@ var $author$project$Main$viewDataBus = function (model) {
_List_fromArray(
[
$elm$html$Html$text(
$elm$core$String$fromInt(model.pc.dataBus))
A2($author$project$Main$addLeadingZero, model.pc.dataBus, 8))
]))
]));
};
var $author$project$Main$viewInstrEntry = function (i) {
var instruction = (i / 100000) | 0;
var address = i - (instruction * 100000);
return $elm$html$Html$text(
A2($author$project$Main$addLeadingZero, instruction, 3) + (' ' + A2($author$project$Main$addLeadingZero, address, 5)));
};
var $author$project$Main$viewRamContent = function (model) {
var ram2table = function (entry) {
var val = entry.b;
@ -6209,7 +6269,7 @@ var $author$project$Main$viewRamContent = function (model) {
_List_fromArray(
[
$elm$html$Html$text(
$elm$core$String$fromInt(id))
A2($author$project$Main$addLeadingZero, id, 3))
])),
A2(
$elm$html$Html$td,
@ -6219,8 +6279,7 @@ var $author$project$Main$viewRamContent = function (model) {
]),
_List_fromArray(
[
$elm$html$Html$text(
$elm$core$String$fromInt(val))
$author$project$Main$viewInstrEntry(val)
]))
]));
};