Skip to content

Fix #16533 - Decode the TriCore 1.6 BOL loads and stores ##disasm - #27333

Merged
trufae merged 1 commit into
radareorg:masterfrom
Thanatos9404:tricore-bol-ld-st
Nov 4, 2026
Merged

trufae merged 1 commit into
radareorg:masterfrom
Thanatos9404:tricore-bol-ld-st

Conversation

@Thanatos9404

Copy link
Copy Markdown
Contributor
  • Mark this if you consider it ready to merge
  • I've added tests (optional)
  • I wrote some lines in the book (optional)

Description

Fixes #16533. The TriCore table had the base + long offset (BOL) form only for ld.a, ld.w, lea, st.b and st.w. So the TriCore 1.6 BOL loads and stores decoded as invalid. For example, 39ff0c35 (ld.bu d15, [a15]0x50cc in Ghidra) gave invalid followed by a misread 16-bit ld.bu.

This adds the missing rows, each placed before its mnemonic's first 32-bit row as the ordering comment asks:

Instruction Opcode Operands
ld.b 0x79 d@w
ld.bu 0x39 d@w
ld.h 0xc9 d@w
ld.hu 0xb9 d@w
st.a 0xb5 @wa
st.h 0xf9 @wd

The opcodes match Ghidra's tricore.sinc.

The rows are gated on TRICORE_V2_UP, since these forms first appear in TC1.6; Capstone gates the same six on HasV160_UP. With the default cpu they are still invalid, and with -c v2 they decode. There is no TriCore assembler, so assembly is unaffected.

Testing

  • A new test in db/anal/tricore decodes all eleven BOL forms with -c v2. It fails on master.
  • All tests in files that mention tricore pass, except db/cmd/cmd_list "List Parser Plugins Lp", which fails on master too. sys/lint.py --all is clean.

…isasm

The opcode table had the base + long offset (BOL) forms only for ld.a,
ld.w, lea, st.b and st.w. Add ld.b, ld.bu, ld.h, ld.hu, st.a and st.h
(opcodes 0x79, 0x39, 0xc9, 0xb9, 0xb5 and 0xf9), for the v2 cpu.
@trufae
trufae merged commit 3dea21a into radareorg:master Nov 4, 2026
50 checks passed
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

Successfully merging this pull request may close these issues.

rasm2 tricore ld.bu disassembly error

2 participants