public async Task Asm() { var asm = @" addi x1, x0, 10 addi x1, x0, -10 "; var instructions = await RISCVIntegrationClient.Asm(new RISCVIntegrationEndpoint(), asm); Assert.AreEqual(2, instructions.Length); Assert.AreEqual(0x00A00093U, instructions[0]); Assert.AreEqual(0xFF600093U, instructions[1]); }
public uint[] FromAsmSource(string asmSource) { // making a API call to integration server. if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { // on Windows, integration server is required to run in Docker or WSL. // Installation steps are same for WSL and for docker. // https://github.com/EvgenyMuryshkin/Quokka.RISCV.Docker var instructions = RISCVIntegrationClient.Asm(new RISCVIntegrationEndpoint(), asmSource); return(instructions.Result); } else { // on Linux, just make local call to RISCV toolchain return(RISCVIntegrationClient.ToInstructions(Toolchain.Asm(asmSource)).ToArray()); } }