protected void printCPUstatus() {
		String flags = "";
		flags += ((regs[FLAG_REG] & ZF_Mask) == ZF_Mask) ? "Z " : "z ";
		flags += ((regs[FLAG_REG] & NF_Mask) == NF_Mask) ? "N " : "n ";
		flags += ((regs[FLAG_REG] & HC_Mask) == HC_Mask) ? "H " : "h ";
		flags += ((regs[FLAG_REG] & CF_Mask) == CF_Mask) ? "C " : "c ";
		flags += ((regs[FLAG_REG] & (1 << 3)) == (1 << 3)) ? "1 " : "0 ";
		flags += ((regs[FLAG_REG] & (1 << 2)) == (1 << 2)) ? "1 " : "0 ";
		flags += ((regs[FLAG_REG] & (1 << 1)) == (1 << 1)) ? "1 " : "0 ";
		flags += ((regs[FLAG_REG] & (1 << 0)) == (1 << 0)) ? "1 " : "0 ";
		System.out.println("---CPU Status for cycle " + TotalInstrCount + "---");
		System.out.printf("   A=$%02x    B=$%02x    C=$%02x    D=$%02x   E=$%02x   F=$%02x   H=$%02x   L=$%02x\n", regs[A], regs[B], regs[C], regs[D], regs[E], regs[F], regs[H], regs[L]);
		System.out.printf("  PC=$%04x SP=$%04x                           flags=" + flags + "\n", PC, SP);
		System.out.println("  " + deasm.disassemble(PC));
	}