Bugfix (assembler): Put the pointer to display memory in the right place

Refactor: Put the value of the pointer to display memory in machine.config.js
This commit is contained in:
n loewen 2023-08-15 10:55:01 +01:00
parent 3e753f6965
commit 2d38e28957
2 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,5 @@
const { logMemory, num2hex } = require('./logging.js');
const { INITIAL_IP_ADDRESS, POINTER_TO_START_OF_DISPLAY_MEM } = require('./machine.config.js');
const { INITIAL_IP_ADDRESS, START_OF_DISPLAY_MEM, POINTER_TO_START_OF_DISPLAY_MEM } = require('./machine.config.js');
// 1 = verbose
// 2 = what i'm currently focusing on
@ -34,7 +34,7 @@ function decodeInstructions(line) {
let lines = line.split(/\n/); // returns an array of lines
let machineCode = new Array(INITIAL_IP_ADDRESS).fill(0);
machineCode[0] = POINTER_TO_START_OF_DISPLAY_MEM;
machineCode[POINTER_TO_START_OF_DISPLAY_MEM] = START_OF_DISPLAY_MEM;
let labels = {};
let constants = {};

View File

@ -1,4 +1,5 @@
module.exports = {
"START_OF_DISPLAY_MEM": 0,
"POINTER_TO_START_OF_DISPLAY_MEM": 32,
"POINTER_TO_START_OF_KEYPAD_MEM": 33,
"INITIAL_IP_ADDRESS": 48,