@Override
	public void run() throws Exception {
		monitor.setMessage("Constructing Assember");
		// First, obtain an assembler bound to the current program.
		// If a suitable assembler has not yet been build, this will take some time to build it.
		Assembler asm = Assemblers.getAssembler(currentProgram);

		monitor.setMessage("Awaiting Input");
		// Put the current instruction text in by default.
		Instruction ins = getInstructionAt(currentAddress);
		String cur = "";
		if (ins != null) {
			cur = ins.toString();
		}

		// Now present the prompt and assemble the given text.
		// The assembler will patch the result into the bound program.
		asm.assemble(currentAddress, askString("Assemble", "Type an instruction", cur));
	}
This is a demonstration script to show how to use the assembler in scripts. The GUI assembler is
accessed using CTRL-SHIFT-G.
Ghidra/Features/Base/ghidra_scripts/AssembleScript.java