@Override
	protected void run() throws Exception {
		monitor.setMessage("Constructing Assembler");
		// First, obtain an assembler bound to the current program.
		Assembler asm = Assemblers.getAssembler(currentProgram);

		monitor.setMessage("Assembling");
		// Now assemble a block. A block can be given as an array of strings, or a string of
		// newline-separated instructions.
		// This will patch each resulting instruction into the bound program in sequence.
		asm.assemble(currentAddress, //
			"ADD [RBX],BL", //
			"JMP 0x34", //
			"SCASB.REPE RDI");
	}
This is a demonstration script to show how to use the assembler to assemble a block of
instructions.
Ghidra/Features/Base/ghidra_scripts/AssembleBlockScript.java