public VarnodeTpl buildTruncatedVarnode(Location loc, VarnodeTpl basevn, int bitoffset,
			int numbits) {
		int byteoffset = bitoffset / 8;		// Convert to byte units
		int numbytes = numbits / 8;
		long fullsz = 0;
		if (basevn.getSize().getType() == const_type.real) {
			// If we know the size of base, make sure the bit range is in bounds
			fullsz = basevn.getSize().getReal();
			if (fullsz == 0) {
				return null;
			}
			if (byteoffset + numbytes > fullsz) {
				throw new SleighError(String.format("Requested bit range out of bounds -- %d > %d",
					(byteoffset + numbytes), fullsz), loc);
			}
		}

		if ((bitoffset % 8) != 0) {
			return null;
		}
		if ((numbits % 8) != 0) {
			return null;
		}

		if (basevn.getSpace().isUniqueSpace()) {
			return null;
		}

		const_type offset_type = basevn.getOffset().getType();
		if ((offset_type != const_type.real) && (offset_type != const_type.handle)) {
			return null;
		}

		ConstTpl specialoff;
		if (offset_type == const_type.handle) {
			// We put in the correct adjustment to offset assuming things are little endian
			// We defer the correct big endian calculation until after the consistency check
			// because we need to know the subtable export sizes
			specialoff = new ConstTpl(const_type.handle, basevn.getOffset().getHandleIndex(),
				v_field.v_offset_plus, byteoffset);
		}
		else {
			if (basevn.getSize().getType() != const_type.real) {
				throw new SleighError("Could not construct requested bit range", loc);
			}
			long plus;
			if (getDefaultSpace().isBigEndian()) {
				plus = fullsz - (byteoffset + numbytes);
			}
			else {
				plus = byteoffset;
			}
			specialoff = new ConstTpl(const_type.real, basevn.getOffset().getReal() + plus);
		}
		VarnodeTpl res = new VarnodeTpl(loc, basevn.getSpace(), specialoff,
			new ConstTpl(const_type.real, numbytes));
		return res;
	}
Handle a sleigh 'macro' invocation, returning the resulting p-code op templates (OpTpl)

@param location is the file/line where the macro is invoked
@param sym MacroSymbol is the macro symbol
@param param is the parsed list of operand expressions
@return a list of p-code op templates
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/pcodeCPort/slgh_compile/PcodeCompile.java