Re: [hatari-devel] WinUAE CPU core disassembler output options : fix for DISASM_FLAG_EA

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 25/10/2022 à 23:48, Eero Tamminen a écrit :


before:

00fc054a 4e75                     rts  == $00fc03bc

now :

00FC054A 4E75                     rts šZòºÌ^?

Bcc od DBcc are correct, they still show "== EA" after.

Can you have a look ? (maybe it's a regression in WinUae, I didn't check)

I think *both* of above behaviors are WinUAE disassembler bugs.

First bug is disassembler not respecting its DISASM_FLAG_CC / DISASM_FLAG_EA / DISASM_FLAG_VAL options being off.

Second bug is it showing garbage when it skips showing EA values for short enough instruction names.  E.g. not padding things properly (like Hatari ext disassembler does).

Just enable "uae: show EA + CC values after instruction" disassembly option until Toni fixes those bugs.


Hi

toni, I think a test is missing for DISASM_FLAG_EA in i_Bcc and i_DBcc, as the " == $%08X" is always displayed :

@@ -2408,7 +2409,9 @@ uae_u32 m68k_disasm_2(TCHAR *buf, int bufsize, uaecptr pc, uae_u16 *bufpc, int b
                                }
                        } else {
if (dp->mnemo == i_Bcc || dp->mnemo == i_DBcc) { - buf = buf_out(buf, &bufsize, disasm_lc_hex(_T(" == $%08X")), addr2);
+                                       if (disasm_flags & DISASM_FLAG_EA) {
+ buf = buf_out(buf, &bufsize, disasm_lc_hex(_T(" == $%08X")), addr2);
+                                       }
                                        if (cctrue(dp->cc)) {
buf = buf_out(buf, &bufsize, _T(" (T)"));
                                        } else {

also for RTS/RTD/RTR/RTE, the eas[] array is not init to '\0', so if DISASM_FLAG_EA is not set this will do "_tcscat(instrname, eas)" with an uninitialized eas[] and print garbage :

@@ -2367,6 +2367,7 @@ uae_u32 m68k_disasm_2(TCHAR *buf, int bufsize, uaecptr pc, uae_u16 *bufpc, int b if (lookup->mnemo == i_RTS || lookup->mnemo == i_RTD || lookup->mnemo == i_RTR || lookup->mnemo == i_RTE) {
                                        uaecptr a = regs.regs[15];
                                        TCHAR eas[100];
+                                       eas[0] = 0;
if (lookup->mnemo == i_RTE || lookup->mnemo == i_RTR) {
                                                a += 2;
                                        }


Nicolas







Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/