public static RegisterValue getContextAfterCommits(Instruction instruction, long counter) {
		PseudoInstruction pins = (PseudoInstruction) instruction;
		Language language = instruction.getPrototype().getLanguage();
		try {
			SleighParserContext parserCtx = (SleighParserContext) pins.getParserContext();
			var procCtx = new DisassemblerContextAdapter() {
				RegisterValue ctxVal = new RegisterValue(language.getContextBaseRegister());

				@Override
				public void setFutureRegisterValue(Address address, RegisterValue value) {
					if (!value.getRegister().isProcessorContext()) {
						return;
					}
					if (address.getOffset() != counter &&
						!Objects.equals(pins.getAddress(), address)) {
						Msg.warn(this, "Context applied somewhere other than the counter.");
						return;
					}
					ctxVal = ctxVal.assign(value.getRegister(), value);
				}
			};
			parserCtx.applyCommits(procCtx);
			return procCtx.ctxVal;
		}
		catch (MemoryAccessException e) {
			throw new AssertionError(e);
		}
	}
Start execution of the instruction or inject at the program counter
Ghidra/Framework/Emulation/src/main/java/ghidra/pcode/emu/DefaultPcodeThread.java