-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
91 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
const getElement = divName => { | ||
if (typeof divName === 'string') { | ||
const c = document.getElementById(divName); | ||
if (c === null) { | ||
throw new Error('<div> element width Id: "' + divName + '" not found'); | ||
} | ||
return c; | ||
} | ||
return divName; | ||
}; | ||
|
||
module.exports = getElement; | ||
|
||
/* eslint-env browser */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
const lister = require('./lister.js'); | ||
|
||
const getListing = async (readers) => { | ||
let listing = []; | ||
const r = readers.find(reader => reader.ext === 'lst'); | ||
if (r) { | ||
const utf8Decoder = new TextDecoder('utf-8'); | ||
const list = lister(); | ||
for (let i = 0; i < 10000; i++) { | ||
let { done, value } = await r.reader.read(); | ||
if (typeof value !== 'string') { | ||
value = utf8Decoder.decode(value, {stream: true}); | ||
} | ||
list.onChunk(value); | ||
if (done) { | ||
listing = list.getTrace(); | ||
break; | ||
} | ||
} | ||
} | ||
return listing; | ||
}; | ||
|
||
module.exports = getListing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict'; | ||
|
||
module.exports = () => { | ||
const trace = {}; | ||
let tail = ''; | ||
return { | ||
onChunk: (chunk) => { | ||
const rows = (tail + chunk).split('\n'); | ||
// console.log('chunk:', chunk.length, 'tail:', tail.length, 'rows:', rows.length); | ||
tail = rows.pop(); | ||
rows.map(row => { | ||
const m = row.match(/\s*([0-9a-f]+):\s*([0-9a-f]+)\s+(.+)/); | ||
if (m) { | ||
const pc = parseInt(m[1], 16); | ||
const op = m[2]; | ||
const asm = m[3].replace(/\t/, ' '); | ||
trace[pc] = {op, asm}; | ||
} | ||
}); | ||
}, | ||
getTrace: () => trace | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.