Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support RISC-V assembler pseudo-instructions #17

Open
dnpetrov-sc opened this issue Apr 29, 2022 · 1 comment
Open

Support RISC-V assembler pseudo-instructions #17

dnpetrov-sc opened this issue Apr 29, 2022 · 1 comment

Comments

@dnpetrov-sc
Copy link

For a full list see, for example, https://riscv.org/wp-content/uploads/2017/05/riscv-spec-v2.2.pdf, pages 110 and 111.

Currently some RISC-V assembly pseudo-instructions appearing in assembly output are decompiled to __asm statements. E.g.:

void do_integer_add () {
    a2 = *(a1);
    a1 = a2 + 57;
    a2 += 31;
    if (a0 == 0) {
        goto label_0;
    }
    do {
        a3 = a1;
        a0 += -1;
        a1 += a2;
        __asm ("negw a1, a1");
        a2 = a3;
    } while (a0 != 0);
    a0 = a3 + a1;
    void (*0x156f6)() ();
label_0:
    a0 = a2 + a1;
    return use_int ();
}

I've encountered similar issue with seqz and snez, and suspect some other pseudo-instructions are unsupported as well.

@wargio
Copy link
Member

wargio commented Apr 29, 2022

the problem is the disassembler is outputting the instructions in an old format. i need to update the disassembler first and then rewrite some stuff on jsdec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants