# HG changeset patch # User Michael Spacefalcon # Date 1396131561 0 # Node ID f68d8e7a904f421299311012af465b85ad7eebca # Parent c5d52666d2eb4749c90fc92505c9b09d68454c09 armdis: implemented decoding of multiplication instructions diff -r c5d52666d2eb -r f68d8e7a904f arm7dis/armdis.c --- a/arm7dis/armdis.c Sat Mar 29 21:36:22 2014 +0000 +++ b/arm7dis/armdis.c Sat Mar 29 22:19:21 2014 +0000 @@ -99,15 +99,8 @@ } static void -dataproc_74_overlay(off, word) - unsigned off, word; -{ - printf("\n"); -} - -static void -dataproc_tstcmp_overlay(off, word) - unsigned off, word; +dataproc_tstcmp_overlay(word) + unsigned word; { char msrmask[5], *cp; @@ -146,8 +139,8 @@ } static void -dataproc(off, word) - unsigned off, word; +dataproc(word) + unsigned word; { unsigned opc; @@ -185,11 +178,53 @@ regnames[(word>>16)&0xF]); dataproc_op2(word); } else - dataproc_tstcmp_overlay(off, word); + dataproc_tstcmp_overlay(word); return; } } +static void +multiply(word) + unsigned word; +{ + if ((word & 0x0FE000F0) == 0x90) + printf("mul%s%s\t%s, %s, %s\n", condition_decode[word>>28], + word&0x100000 ? "s" : "", regnames[(word>>16)&0xF], + regnames[word&0xF], regnames[(word>>8)&0xF]); + else if ((word & 0x0FE000F0) == 0x00200090) + printf("mla%s%s\t%s, %s, %s, %s\n", condition_decode[word>>28], + word&0x100000 ? "s" : "", regnames[(word>>16)&0xF], + regnames[word&0xF], regnames[(word>>8)&0xF], + regnames[(word>>12)&0xF]); + else if ((word & 0x0F8000F0) == 0x00800090) + printf("%c%sl%s%s\t%s, %s, %s, %s\n", + word&0x400000 ? 's' : 'u', + word&0x200000 ? "mla" : "mul", + condition_decode[word>>28], + word&0x100000 ? "s" : "", + regnames[(word>>12)&0xF], regnames[(word>>16)&0xF], + regnames[word&0xF], regnames[(word>>8)&0xF]); + else + printf("\n"); +} + +static void +ldr_str_ext(off, word) + unsigned off, word; +{ + printf("\n"); +} + +static void +dataproc_74_overlay(off, word) + unsigned off, word; +{ + if (word & 0x60) + ldr_str_ext(off, word); + else + multiply(word); +} + void arm_disasm_line(off) unsigned off; @@ -208,11 +243,11 @@ if ((word & 0x90) == 0x90) dataproc_74_overlay(off, word); else - dataproc(off, word); + dataproc(word); return; case 2: case 3: - dataproc(off, word); + dataproc(word); return; case 4: case 5: