public boolean setRegister(String reg, int value) {
		if (reg.equals("a") || reg.equals("acc")) {
			a = (short) value;
		} else if (reg.equals("b")) {
			b = (short) value;
		} else if (reg.equals("c")) {
			c = (short) value;
		} else if (reg.equals("d")) {
			d = (short) value;
		} else if (reg.equals("e")) {
			e = (short) value;
		} else if (reg.equals("f")) {
			f = (short) value;
		} else if (reg.equals("h")) {
			hl = (hl & 0x00FF) | (value << 8);
		} else if (reg.equals("l")) {
			hl = (hl & 0xFF00) | value;
		} else if (reg.equals("sp")) {
			sp = value;
		} else if (reg.equals("pc") || reg.equals("ip")) {
			pc = value;                             
		} else if (reg.equals("bc")) {
			b = (short) (value >> 8);
			c = (short) (value & 0x00FF);
		} else if (reg.equals("de")) {
			d = (short) (value >> 8);
			e = (short) (value & 0x00FF);
		} else if (reg.equals("hl")) {
			hl = value;
		} else {
			return false;
		}
		return true;
	}