@Test
	public void testOpenWriteClose() throws Exception {
		try (Transaction tx = program.openTransaction("Initialize")) {
			asm.assemble(start,
				"MOV EAX," + Syscall.OPEN.number,
				"LEA EBX,[0x00400880]",
				"MOV ECX," + (AbstractEmuLinuxSyscallUseropLibrary.O_WRONLY |
					AbstractEmuLinuxSyscallUseropLibrary.O_CREAT),
				"MOV EDX," + (0600),
				"INT 0x80",
				"MOV EBP, EAX",

				"MOV EAX," + Syscall.WRITE.number,
				"MOV EBX,EBP",
				"LEA ECX,[0x00400800]",
				"MOV EDX," + BYTES_HW.length,
				"INT 0x80",

				"MOV EAX," + Syscall.CLOSE.number,
				"MOV EBX,EBP",

				"MOV EAX," + Syscall.EXIT.number,
				"MOV EBX,0",
				"INT 0x80");
			block.putBytes(space.getAddress(0x00400800), BYTES_HW);
			block.putBytes(space.getAddress(0x00400880), "myfile\0".getBytes());
		}

		LinuxX86PcodeEmulator emu = prepareEmulator();
		PcodeThread<byte[]> thread = launchThread(emu, start);
		execute(thread);

		EmuUnixFile<byte[]> file = fs.getFile("myfile");
		byte[] bytes = new byte[BYTES_HW.length];
		file.read(arithmetic, arithmetic.fromConst(0, 8), bytes);
		assertArrayEquals(BYTES_HW, bytes);
	}
These are the linux_x86 system call numbers as of writing this test, but it doesn't
really matter as long as the user program and syscall library agree.
Ghidra/Features/SystemEmulation/src/test/java/ghidra/pcode/emu/linux/EmuLinuxX86SyscallUseropLibraryTest.java