import { ButtonMachine } from '../src/buttons.js'; let code = [ ['PUSH', -10], // start at -10 ['PUSH', 1], // increment by 1 ['ADD'], ['POKE', 1], // put it in ram, IX++ ['JNZ', 1], // the previous test fails so it jumps to loop again ['STOR', 'IX'], ['POP'], ['PEEK', 1], ['JNZ', 6], ]; let machine = new ButtonMachine(code); const ops = ButtonMachine.operations(); const registers = machine.register_names(); machine.run(); console.log("STACK TOP", machine.stack_top); console.log("REGISTERS", registers); console.log("STACK", machine.stack); console.log("RAM", machine.ram);