comparison 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
comparison
equal deleted inserted replaced
85:3c420895f68f 86:537cf2245d98
1 #include <sys/types.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4
5 extern char *binfilename;
6 extern u_char *filemap;
7 extern u_long disasm_len, base_vma;
8
9 extern unsigned get_u16(), get_u32();
10
11 void
12 arm_disasm_line(off)
13 u_long off;
14 {
15 u_long word;
16
17 word = get_u32(filemap + off);
18 printf("%8x:\t%08x\t", base_vma + off, word);
19 if ((word >> 28) == 0xF) {
20 printf("invalid\n");
21 return;
22 }
23
24
25 }
26
27 main(argc, argv)
28 char **argv;
29 {
30 u_long off;
31
32 common_init(argc, argv, 4);
33 for (off = 0; off < disasm_len; off += 4)
34 arm_disasm_line(off);
35 exit(0);
36 }