public void fireBeforeWrite(State state, int data_addr, byte value) {

        if (data_addr != base) {
            Terminal.printRed("Unexpected interception by printer!");
        }

        Simulator sim = state.getSimulator();
        AtmelInterpreter a = (AtmelInterpreter) sim.getInterpreter();

        String idstr = SimUtil.getIDTimeString(sim);
        Terminal.printRed(idstr + " ");

        int pid = a.getDataByte(base + 1);
        Terminal.printRed("[" + pid + "] ");

        switch (value) {
            case 0x1:
            case 0x3:
                int l = a.getDataByte(base + 2);
                int h = a.getDataByte(base + 3);
                int v = ((h & 0xff) << 8) + (l & 0xff);
                if (value == 0x1) {
                    Terminal.printRed("hex: " + StringUtil.toHex(v, 4));
                }
                if (value == 0x3) {
                    Terminal.printRed("int: " + v);
                }
                Terminal.nextln();
                break;
            case 0x2:
                Terminal.printRed("str: ");
                for (int i = 0; i <= max; i++) {
                    byte b = a.getDataByte(base + 2 + i);
                    if (b == 0) break;
                    String s = String.valueOf((char) b);
                    Terminal.printRed(s);
                }
                Terminal.nextln();
                break;
            default:
                Terminal.printRed("Unexpected command to printer!");
        }
    }