Menu

#53 BSR.L disassembly offset

None
closed-fixed
None
5
2015-01-11
2015-01-08
No

Hello,

The cpuDisOpcode returns an incorrect length (4 bytes instead of 6) for long branches (BSR.L, etc)
eg:

$00E59CD4   BSR.L      $00E5986E                                ; 61FF FFFFFB98
$00E59CD8   ILLEGAL                                             ; FB98
$00E59CDA   MOVE.W     D3,$000C(A7)                             ; 3F43 000C

It can be fixed in CpuModule_Disassembler.c, function cpuDisBcc

else if (disp == -1 && cpuGetModelMajor() >= 2)
{
  prc += 2;
  disp2 = memoryReadLong(prc);
  cpuDisLongAppend(disp2, sdata);
  adr = prc + disp2;
  prc += 2; <<<<< add in extra 2 bytes here
}

Discussion

  • Petter Schau

    Petter Schau - 2015-01-11

    Thanks, good catch!

     
  • Petter Schau

    Petter Schau - 2015-01-11
    • status: open --> closed-fixed
    • assigned_to: Petter Schau
    • Group: -->
     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.
Try Free →