summary refs log tree commit diff
path: root/pc-thing/instructions/dbg.ts
blob: 6781fbf82f13047b763e065120bdd6d8b54eb431 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { PC } from "../pc.ts";

export default {
    function(this: PC, [msg]: string[]) {
        console.log(msg, this.mem, this.registers, this.returnFlag, this.returnStack);
        const b = new Uint8Array(1);
        Deno.stdin.readSync(b)
        if (b[0] == 'c'.charCodeAt(0)) {
            this.programPointer = 0xFFFF - 1
        }
    },
    args: 1
}