Work environment
Questions |
Answers |
System Capstone runs on OS/arch/bits |
Windows x86_64 |
Capstone module affected |
riscv |
Source of Capstone |
git clone |
Version/git commit |
latest next, Commit 280b749 |
Instruction bytes giving faulty results
Expected results
It should be:
Custom Extension / disassembly failed
Steps to get the wrong result
With cstool
:
or with Python
Additional Logs, screenshots, source code, configuration dump, ...
Instruction is disassembled as
0 15 93 c.srli a4, 0x25
ID: 128 (c.srli)
op_count: 2
operands[0].type: REG = a4
operands[1].type: IMM = 0x25
Groups: hasStdExtC
But according to
https://lists.riscv.org/g/tech-unprivileged/attachment/536/0/unpriv-isa-asciidoc.pdf (p. 105)
the shift value must not be greater than 31 (shamt[5], bit12 must be zero as shamt[5] == 1 is designated space for custom extensions in RISCV32.