public void handler() {
            /*
             * WAI stacks the entire machine state on the
             * hardware stack, then waits for an interrupt.
             */
            m6800.wai_state |= M6800_WAI;
            PUSHWORD(m6800.pc);
            PUSHWORD(m6800.x);
            PUSHBYTE(m6800.a);
            PUSHBYTE(m6800.b);
            PUSHBYTE(m6800.cc);
            CHECK_IRQ_LINES();
            if ((m6800.wai_state & M6800_WAI)!=0) {
                EAT_CYCLES();
            }
        }