C++ disassembler project

Jun 24, 2020 at 7:44pm
I am creating a c++ disassembler (coverts from Machine code to RISC-V) project, and I am in the process of writing the I_imm, S_imm, B_imm, U_imm, J_imm. So far I wrote these:

am trying to do S_imm and the J_imm order for jal. Can someone please help me? Thanks
Last edited on Jun 26, 2020 at 3:47pm
Jun 25, 2020 at 4:54am
> I_imm=((instWord>>20)&0x7FF)|(((instWord>>31)?0xFFFFF800:0x0));
I would suggest you try and write this out as an if / else statement, rather than trying to be clever with an overly dense ?: expression.

Jun 26, 2020 at 3:46pm
I see your point; thank you. I corrected it
Topic archived. No new replies allowed.