changeset 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 fcf1ef773a57
children 1cd11badf287
files leo-obj/frame_na7_db_fl/Makefile leo-obj/frame_na7_db_fl/os_pro.hints leo-obj/tool/thumbdis.c
diffstat 3 files changed, 24 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/leo-obj/frame_na7_db_fl/Makefile	Thu May 01 01:01:58 2014 +0000
+++ b/leo-obj/frame_na7_db_fl/Makefile	Fri May 02 04:12:14 2014 +0000
@@ -7,10 +7,10 @@
 all:	${TARGETS}
 
 %.disasm:	%.obj %.hints
-	${TOOL} $*.obj disasm -h $*.hints > $@
+	${TOOL} $*.obj disasm -gl -h $*.hints > $@
 
 %.disasm:	%.obj
-	${TOOL} $*.obj disasm > $@
+	${TOOL} $*.obj disasm -gl > $@
 
 ${TARGETS}:	${TOOL} Makefile
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/leo-obj/frame_na7_db_fl/os_pro.hints	Fri May 02 04:12:14 2014 +0000
@@ -0,0 +1,8 @@
+[.text]
+
+1e linebrk
+3bc linebrk
+44c asciz
+490 asciz
+4a0 d32
+4a4 d32
--- 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