@Test
	public void testSyscallWithSyscallConvention() throws Exception {
		try (Transaction tx = program.openTransaction("Initialize")) {
			asm.assemble(start,
				"MOV RAX,1",
				"MOV RCX,0xdead",
				"MOV R10,0xbeef",
				"SYSCALL");
		}

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

		thread.stepInstruction(4);

		assertArrayEquals(arithmetic.fromConst(0xbeef, regRAX.getNumBytes()),
			thread.getState().getVar(regRAX, Reason.INSPECT));
	}
A library with two 4-argument syscalls.

<p>
For x86:LE:64:default:gcc, the storage for the 4th argument varies by calling convention. For
__stdcall, it's RCX. For syscall, it's R10. Both syscalls just return the 4th argument. Thus,
it's possible to detect whether the emulator heeds conventions by binding each to a different
convention, then invoking them with distinct values placed in RCX and R10 and verifying that
the correct value shows in RAX, the return register.
Ghidra/Features/SystemEmulation/src/test/java/ghidra/pcode/emu/sys/EmuAmd64SyscallUseropLibraryTest.java