C++ disassembler project

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
> 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.

I see your point; thank you. I corrected it
Registered users can post here. Sign in or register to post.