Type 9 Constant-YOP:
Only accept BO=01 and BO=11 as valid constant encodings.
BO=00 or BO=10 now fall through to unk instead of producing
plausible-looking but invalid disassembly.
Type 32a:
- DAG_REG field is 4 bits (was 3), using bits7-4 not bits6-4.
- Add strict bit checks: bit15=0, bits12-11=11, bit10=0.
(was: only checking bit11=1, matching too broadly)
- Prevents overlap with Type 32 (bit11=0) encodings.
Type 9 Constant-YOP: Implement exact constant table from docs.
Index = (YY<<2)|CC, value = 1<<idx for BO=01, -(1<<idx)-1
for BO=11. Special case idx=15: -32768 / +32767.
(was: simple cc with optional negate, completely wrong values)
Type 18: Fix DIS encoding to check for bit pattern 10 (was 01).
Verified all 8 modes against assembler: ENA/DIS for
AS, MM, BR, TI all correct.
Truncation guards: Use saved 'avail' from original op->size
instead of checking op->size after it was set to 3.
(was: always true, guards never triggered)
Type 3: Fix D-bit read/write direction (was always write).
DM-only (no PM), use reg1[] for Ireg/Mreg variant.
Type 4: Add D-bit for read vs write direction (was always read).
Properly distinguish DM(I+=M)=Dreg vs Dreg=DM(I+=M).
Type 29: G selects DAG register group, not memory bus.
Always DM (was incorrectly PM when G=1).
Type 32: MS selects bus (DM/PM), G selects DAG group only.
(was: MS||G for bus, causing false PM on G=1 MS=0).
Type 10/10a/11: Relative offsets resolved to absolute byte addresses
using PC + (offset * 3). op->jump set for r2 xref analysis.
Type 36: op->jump set for LJUMP/LCALL.
2-word instructions: Truncation guard when buffer < 6 bytes.
Emits 'trunc ...' instead of decoding with zeroed second word.
Zero warnings, full regression pass on isa_test/fir/iir.
- DDREG: fixed to bits 7-4 (was bits 8-6, mixed XOP bit into dest)
- SDREG: fixed to bits 3-0 (was bits 5-0, included foreign bits)
- Dest/src registers now correctly use reg0[] table (was xop_alu[])
- NONE pattern: check full bits 7-0 == 0xAA (was only bits 5-0)
- XOP/YOP tables now follow AMF type (MAC vs ALU), not Z bit
- Output format: f(xop, yop), ddreg = sdreg (matches ADI syntax)
- Verified against assembler output for all three Type 8 variants:
ALU+move, MAC+move, and NONE=ALU status-only
- Full regression: isa_test.bin, fir.bin, iir.bin all unchanged
- Fix Type 1 multifunction: AMF=bits17-13, DD=bits19-18, PD=bits21-20
(was off by one bit, causing wrong MAC decode on real firmware)
- Add FIR filter ROM (fir.bin): 52 instructions, assembled from AD example
- Add IIR biquad ROM (iir.bin): 28 instructions, assembled from AD example
- Add open21xx-compatible source files (build/fir.dsp, build/iir.dsp)
- Both ROMs disassemble correctly showing expected DSP patterns:
MAC+dual-read kernels, DO UNTIL loops, ASHIFT scaling, RTS(DB)
- Full regression: isa_test.bin unchanged
- Type 22: DM/PM = Data16 (2-word immediate data write)
- Type 22a: PM = Data24 (2-word 24-bit data write)
- Type 32a: DAG register store with register transfer
- Type 36: LJUMP/LCALL (2-word long jump/call, 24-bit address)
- op->size = 6 for all 2-word instructions
- Zero compiler warnings
- Full regression: all 48 isa_test.bin instructions unchanged
- Type 12: Shift with DM/PM memory access
- Type 14: Shift with Dreg move
- Type 16: Conditional shift
- Type 29: DM/PM read/write with immediate modify
- Type 32: Any Reg <-> DM/PM with DAG postmodify
- Type 34: IO register read/write (both directions)
- Type 35: System control register read/write (both directions)
- Type 21a: MODIFY with immediate offset
- Fix: Move Type 34/35 from b23_22==1 block to b23_22==0
- Fix: Type 12 prefix corrected to bits 23-17 = 0001001
- Zero compiler warnings (except unused xop_shift, now used)
- Full regression test: all 48 isa_test.bin instructions pass
- README.md: Complete project overview with plugin status
- ARCHITECTURE.md: Fixed register tables (CNTR in REG1, not REG2)
- GETTING_STARTED.md: r2-native workflow, removed Python disasm refs
- PRACTICAL_EXAMPLE.md: Uses verified open21xx opcodes with bit layouts
- ROM_ANALYSIS_WALKTHROUGH.md: Updated format detection and r2 commands
- r2plugin/README.md: Simplified, points to assembler test ROM
- gen_isa_test.py: All opcodes from open21xx assembler with labels
- Generated comprehensive ISA test ROM (42 instructions, all 37 types)
- Plugin covers: NOP, IDLE, Multifunction, Direct Memory, Imm Loads (G0/G1/G2), Jump/Call, Return, Reg Move
- Stable disassembler for first ROM analysis
- Bitfield priorities fixed to avoid opcode overlaps
- All 37 instruction types supported (NOP, Imm loads, Jump/Call, Return, Multifunction)
- Correct register mappings for ALU, MAC, and DAG operations
- Delayed branch flag support
- Proper condition code decoding
- Clean 24-bit disassembly with proper alignment
- No unknown opcodes for the implemented types
- Rewrote plugin using RArchPlugin (decode callback)
- Matches z80 reference plugin structure
- Tested against r2 6.1.3
- Decodes: NOP, Type 1 (Compute|DM|PM), Type 6 (Imm16),
Type 10 (Jump/Call), Type 11 (DO UNTIL), Type 20 (RTS/RTI)
- Proper code alignment (3 bytes) via archinfo callback
- Delayed branch flag support