public BigInteger readRegister(Register reg) {
		if (reg.isProcessorContext()) {
			RegisterValue contextRegisterValue = emulator.getContextRegisterValue();
			if (!reg.equals(contextRegisterValue.getRegister())) {
				contextRegisterValue = contextRegisterValue.getRegisterValue(reg);
			}
			return contextRegisterValue.getSignedValueIgnoreMask();
		}
		if (reg.getName().equals(emulator.getPCRegisterName())) {
			return BigInteger.valueOf(emulator.getPC());
		}
		return emulator.getMemState().getBigInteger(reg);
	}
@return the low-level emulator execution state
Ghidra/Framework/Emulation/src/main/java/ghidra/app/emulator/EmulatorHelper.java