public String getRepresentationString(CodeUnit cu, boolean includeEOLcomment) {

		StringBuffer stringBuffer = new StringBuffer(getMnemonicRepresentation(cu));
		if (cu instanceof Instruction) {
			Instruction instr = (Instruction) cu;
			int n = instr.getNumOperands();
			for (int i = 0; i < n; i++) {
				if (i == 0) {
					stringBuffer.append(" ");
				}
				else {
					String separator = instr.getSeparator(i);
					if (separator != null && separator.length() != 0) {
						stringBuffer.append(separator);
					}
				}
				stringBuffer.append(getOperandRepresentationString(cu, i));
			}
		}
		else { // data always has one operand
			stringBuffer.append(" ");
			stringBuffer.append(getOperandRepresentationString(cu, 0));
		}
		if (includeEOLcomment) {
			String eolComment = cu.getComment(CommentType.EOL);
			if (eolComment != null) {
				// fixup annotations
				eolComment = CommentUtils.getDisplayString(eolComment, cu.getProgram());
				stringBuffer.append("  // ");
				stringBuffer.append(eolComment);
			}
		}
		return stringBuffer.toString();
	}
Returns a formatted string representation of the specified code unit
mnemonic and operand(s).

@param cu code unit
@param includeEOLcomment if true EOL comment will be appended to code
           unit representation
@return formatted code unit representation
Ghidra/Features/Base/src/main/java/ghidra/program/model/listing/CodeUnitFormat.java