FreeCalypso > hg > freecalypso-reveng
diff leo-obj/tool/thumbdis.c @ 153:4d7f36110f1c
leo-obj: frame_na7_db_fl/os_pro.obj disassembles the way it should
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Fri, 02 May 2014 04:12:14 +0000 |
parents | daeaa5950d10 |
children |
line wrap: on
line diff
--- a/leo-obj/tool/thumbdis.c Thu May 01 01:01:58 2014 +0000 +++ b/leo-obj/tool/thumbdis.c Fri May 02 04:12:14 2014 +0000 @@ -23,6 +23,7 @@ unsigned word; { unsigned op, imm; + int is_mov; op = (word >> 11) & 3; if (op != 3) { @@ -35,12 +36,21 @@ return; } /* format 2 */ - printf("%s\t%s, %s, ", word&0x200 ? "sub" : "add", regnames[word&7], - regnames[(word>>3)&7]); + if ((word & 0xFDC0) == 0x1C00) { + printf("mov\t%s, %s\t\t(", regnames[word&7], + regnames[(word>>3)&7]); + is_mov = 1; + } else + is_mov = 0; + printf("%s%c%s, %s, ", word&0x200 ? "sub" : "add", + is_mov ? ' ' : '\t', regnames[word&7], regnames[(word>>3)&7]); if (word & 0x400) - printf("#%u\n", (word >> 6) & 7); + printf("#%u", (word >> 6) & 7); else - printf("%s\n", regnames[(word >> 6) & 7]); + printf("%s", regnames[(word >> 6) & 7]); + if (is_mov) + putchar(')'); + putchar('\n'); } static void