(source: string, target: Uint8Array)
| 6 | */ |
| 7 | |
| 8 | export function loadHex(source: string, target: Uint8Array) { |
| 9 | for (const line of source.split("\n")) { |
| 10 | if (line[0] === ":" && line.substr(7, 2) === "00") { |
| 11 | const bytes = parseInt(line.substr(1, 2), 16); |
| 12 | const addr = parseInt(line.substr(3, 4), 16); |
| 13 | for (let i = 0; i < bytes; i++) { |
| 14 | target[addr + i] = parseInt(line.substr(9 + i * 2, 2), 16); |
| 15 | } |
| 16 | } |
| 17 | } |
| 18 | } |
no test coverage detected