public boolean run(Address addr, ProcessorContext context, TaskMonitor monitor)
			throws CancelledException {

		if (emulator.isExecuting()) {
			throw new IllegalStateException("Emulator is already running");
		}

		// Initialize context
		ProgramContext programContext = program.getProgramContext();
		Register baseContextRegister = programContext.getBaseContextRegister();
		RegisterValue contextRegValue = null;
		boolean mustSetContextReg = false;

		if (baseContextRegister != null) {
			contextRegValue = getContextRegister();
			if (contextRegValue == null) {
				contextRegValue = programContext.getRegisterValue(baseContextRegister, addr);
				mustSetContextReg = (contextRegValue != null);
			}
		}

		if (context != null) {
			for (Register reg : context.getRegisters()) {
				// skip non-base registers
				if (reg.isBaseRegister() && context.hasValue(reg)) {
					RegisterValue registerValue = context.getRegisterValue(reg);
					if (reg.isProcessorContext()) {
						if (contextRegValue != null) {
							contextRegValue = contextRegValue.combineValues(registerValue);
						}
						else {
							contextRegValue = registerValue;
						}
						mustSetContextReg = true;
					}
					else {
						BigInteger value = registerValue.getUnsignedValueIgnoreMask();
						writeRegister(reg, value);
					}
				}
			}
		}

		long pcValue = addr.getAddressableWordOffset();
		emulator.setExecuteAddress(pcValue);

		if (mustSetContextReg) {
			setContextRegister(contextRegValue);
		}

		continueExecution(monitor);
		return emulator.isAtBreakpoint();
	}
Start execution at the specified address using the initial context specified. Method will
block until execution stops. This method will initialize context register based upon the
program stored context if not already done. In addition, both general register value and the
context register may be further modified via the context parameter if specified.

@param addr initial program address
@param context optional context settings which override current program context
@param monitor
@return true if execution completes without error (i.e., is at breakpoint)
@throws CancelledException if execution cancelled via monitor
Ghidra/Framework/Emulation/src/main/java/ghidra/app/emulator/EmulatorHelper.java