Skip to content

Commit

Permalink
Fix boundary case
Browse files Browse the repository at this point in the history
  • Loading branch information
eliben committed Jul 17, 2020
1 parent e9143de commit cfd17d7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ function setSample() {
function showRamStart() {
// Calculate start address for the first entry in the displayed RAM table.
let startAddr = parseInt(ramstart.value, 16) & 0xfff0;
if (startAddr > 0xff00) {
startAddr = 0xff00;
ramstart.value = formatNum(startAddr, 4);
}
let headerStart = startAddr;

// Set table row headers.
Expand All @@ -362,7 +366,7 @@ function showRamStart() {
// Set table contents.
for (let i = 0; i < 16 * 16; i++) {
let memIndex = startAddr + i;
ramValues[i].textContent = `${formatNum(memFromLastRun[memIndex], 2)}`;
ramValues[i].textContent = formatNum(memFromLastRun[memIndex], 2);
}
}

Expand Down

0 comments on commit cfd17d7

Please sign in to comment.