protected void checkReg(int reg_code, int val) {
		for (int i = 0; i < 8; i++) {
			switch (reg_code) {
				case 7:
					assertTrue(cu.getRegAValue(i)==((val & 1<<i) == 1<<i));
					break;
				case 0:
					assertTrue(cu.getRegBValue(i)==((val & 1<<i) == 1<<i));
					break;
				case 1:
					assertTrue(cu.getRegCValue(i)==((val & 1<<i) == 1<<i));
					break;
				case 2:
					assertTrue(cu.getRegDValue(i)==((val & 1<<i) == 1<<i));
					break;
				case 3:
					assertTrue(cu.getRegEValue(i)==((val & 1<<i) == 1<<i));
					break;
				case 4:
					assertTrue(cu.getRegHValue(i)==((val & 1<<i) == 1<<i));
					break;
				case 5:
					assertTrue(cu.getRegLValue(i)==((val & 1<<i) == 1<<i));
					break;
				default:
					assertTrue(cu.getRegPCValue(i)==((val & 1<<i) == 1<<i));
					assertTrue(cu.getRegPCValue(i+8)==((val & 1<<(i+8)) == 1<<(i+8)));
					break;
			}
		}
	}