Search
lxdream.org :: lxdream/src/sh4/sh4dasm.in :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4dasm.in
changeset 597:87cbdf62aa35
prev595:02d86b836ef0
next669:ab344e42bca9
author nkeynes
date Tue Jan 22 09:45:21 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Initial VMA support for the SH4 disassembly
file annotate diff log raw
1.1 --- a/src/sh4/sh4dasm.in Mon Jan 21 11:54:47 2008 +0000
1.2 +++ b/src/sh4/sh4dasm.in Tue Jan 22 09:45:21 2008 +0000
1.3 @@ -43,14 +43,15 @@
1.4
1.5
1.6 const struct cpu_desc_struct sh4_cpu_desc =
1.7 - { "SH4", sh4_disasm_instruction, sh4_execute_instruction, mem_has_page,
1.8 + { "SH4", sh4_disasm_instruction, sh4_execute_instruction, sh4_has_page,
1.9 sh4_set_breakpoint, sh4_clear_breakpoint, sh4_get_breakpoint, 2,
1.10 (char *)&sh4r, sizeof(sh4r), sh4_reg_map,
1.11 &sh4r.pc };
1.12
1.13 -uint32_t sh4_disasm_instruction( uint32_t pc, char *buf, int len, char *opcode )
1.14 +uint32_t sh4_disasm_instruction( sh4vma_t pc, char *buf, int len, char *opcode )
1.15 {
1.16 - uint16_t ir = sh4_read_word(pc);
1.17 + sh4addr_t addr = mmu_vma_to_phys_disasm(pc);
1.18 + uint16_t ir = sh4_read_word(addr);
1.19
1.20 #define UNDEF(ir) snprintf( buf, len, "???? " );
1.21 #define RN(ir) ((ir&0x0F00)>>8)
1.22 @@ -188,7 +189,7 @@
1.23 MOV.L @Rm+, Rn {: snprintf( buf, len, "MOV.L @R%d+, R%d", Rm, Rn ); :}
1.24 MOV.L @(R0, Rm), Rn {: snprintf( buf, len, "MOV.L @(R0, R%d), R%d", Rm, Rn ); :}
1.25 MOV.L @(disp, GBR), R0 {: snprintf( buf, len, "MOV.L @(%d, GBR), R0",disp ); :}
1.26 -MOV.L @(disp, PC), Rn {: snprintf( buf, len, "MOV.L @($%xh), R%d ; <- #%08x", disp + (pc & 0xFFFFFFFC) + 4, Rn, sh4_read_long(disp+(pc&0xFFFFFFFC)+4) ); :}
1.27 +MOV.L @(disp, PC), Rn {: snprintf( buf, len, "MOV.L @($%xh), R%d ; <- #%08x", disp + (pc & 0xFFFFFFFC) + 4, Rn, sh4_read_long(disp+(addr&0xFFFFFFFC)+4) ); :}
1.28 MOV.L @(disp, Rm), Rn {: snprintf( buf, len, "MOV.L @(%d, R%d), R%d", disp, Rm, Rn ); :}
1.29 MOV.W Rm, @Rn {: snprintf( buf, len, "MOV.W R%d, @R%d", Rm, Rn ); :}
1.30 MOV.W Rm, @-Rn {: snprintf( buf, len, "MOV.W R%d, @-R%d", Rm, Rn ); :}
1.31 @@ -199,7 +200,7 @@
1.32 MOV.W @Rm+, Rn {: snprintf( buf, len, "MOV.W @R%d+, R%d", Rm, Rn ); :}
1.33 MOV.W @(R0, Rm), Rn {: snprintf( buf, len, "MOV.W @(R0, R%d), R%d", Rm, Rn ); :}
1.34 MOV.W @(disp, GBR), R0 {: snprintf( buf, len, "MOV.W @(%d, GBR), R0", disp ); :}
1.35 -MOV.W @(disp, PC), Rn {: snprintf( buf, len, "MOV.W @($%xh), R%d ; <- #%08x", disp + pc + 4, Rn, sh4_read_word(disp+pc+4) ); :}
1.36 +MOV.W @(disp, PC), Rn {: snprintf( buf, len, "MOV.W @($%xh), R%d ; <- #%08x", disp + pc + 4, Rn, sh4_read_word(disp+addr+4) ); :}
1.37 MOV.W @(disp, Rm), R0 {: snprintf( buf, len, "MOV.W @(%d, R%d), R0", disp, Rm ); :}
1.38 MOVA @(disp, PC), R0 {: snprintf( buf, len, "MOVA @($%xh), R0", disp + (pc&0xFFFFFFFC) + 4 ); :}
1.39 MOVCA.L R0, @Rn {: snprintf( buf, len, "MOVCA.L R0, @R%d", Rn ); :}
.