public void writeRegister(Register reg, BigInteger value) {
		if (reg.isProcessorContext()) {
			RegisterValue contextRegisterValue = new RegisterValue(reg, value);
			RegisterValue existingRegisterValue = emulator.getContextRegisterValue();
			if (!reg.equals(existingRegisterValue.getRegister())) {
				contextRegisterValue = existingRegisterValue.combineValues(contextRegisterValue);
			}
			emulator.setContextRegisterValue(contextRegisterValue);
			return;
		}
		emulator.getMemState().setValue(reg, value);
		if (reg.getName().equals(emulator.getPCRegisterName())) {
			emulator.setExecuteAddress(value.longValue());
		}
	}
@return the low-level emulator execution state
Ghidra/Framework/Emulation/src/main/java/ghidra/app/emulator/EmulatorHelper.java