diff arm7dis/armdis.c @ 86:537cf2245d98

beginning of ARM7 disassembler
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Fri, 28 Mar 2014 07:01:27 +0000
parents
children f7fba8518fa2
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/arm7dis/armdis.c	Fri Mar 28 07:01:27 2014 +0000
@@ -0,0 +1,36 @@
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+extern char *binfilename;
+extern u_char *filemap;
+extern u_long disasm_len, base_vma;
+
+extern unsigned get_u16(), get_u32();
+
+void
+arm_disasm_line(off)
+	u_long off;
+{
+	u_long word;
+
+	word = get_u32(filemap + off);
+	printf("%8x:\t%08x\t", base_vma + off, word);
+	if ((word >> 28) == 0xF) {
+		printf("invalid\n");
+		return;
+	}
+
+
+}
+
+main(argc, argv)
+	char **argv;
+{
+	u_long off;
+
+	common_init(argc, argv, 4);
+	for (off = 0; off < disasm_len; off += 4)
+		arm_disasm_line(off);
+	exit(0);
+}