assembler / machine config - Remove/Change: Remove pointer-to-keypad / Change initial IP

This commit is contained in:
n loewen 2023-08-24 08:16:56 +01:00
parent 78ac43bead
commit f2e43888b5
2 changed files with 4 additions and 8 deletions

View File

@ -2,9 +2,7 @@ const { logMemory, num2hex } = require('./logging.js');
const {
INITIAL_IP_ADDRESS,
DISPLAY_ADDR,
KEYPAD_ADDR,
POINTER_TO_DISPLAY,
POINTER_TO_KEYPAD
} = require('./machine.config.js');
// 1 = verbose
@ -190,7 +188,6 @@ function decodeInstructions(source) {
// Initialize memory-mapped IO -- TODO this should probably be in the CPU, not here
machineCode[POINTER_TO_DISPLAY] = DISPLAY_ADDR;
machineCode[POINTER_TO_KEYPAD] = KEYPAD_ADDR;
// Initialize arrays that collect code references that
// have to be revisited after our first pass through the source

View File

@ -1,12 +1,11 @@
module.exports = {
"INITIAL_IP_ADDRESS": 48,
"INITIAL_IP_ADDRESS": 29,
// Use these in CPU:
"DISPLAY_ADDR": 0,
"KEYPAD_ADDR": 32,
// Store the `X_ADDR`s at these addresses when assembling:
"POINTER_TO_DISPLAY": 33,
"POINTER_TO_KEYPAD": 34,
"KEYPAD_ADDR": 27,
// Store the `DISPLAY_ADDR` at this address when assembling:
"POINTER_TO_DISPLAY": 26,
"KEY_MAP": {
// Same layout as COSMAC VIP / CHIP-8