# HG changeset patch # User Michael Spacefalcon # Date 1396163501 0 # Node ID 915e2ca2813d913fc0ce9402faf8d46cc5beefce # Parent 5ebebbc74622b3d135d1134b7de8a5ed3fed95dd armdis: ldm/stm decoding implemented diff -r 5ebebbc74622 -r 915e2ca2813d arm7dis/armdis.c --- a/arm7dis/armdis.c Sun Mar 30 01:55:46 2014 +0000 +++ b/arm7dis/armdis.c Sun Mar 30 07:11:41 2014 +0000 @@ -397,6 +397,33 @@ multiply(word); } +static void +ldm_stm(word) + unsigned word; +{ + int r, flag; + + printf("%s%s%c%c\t%s", word&0x100000 ? "ldm" : "stm", + condition_decode[word>>28], + word&0x800000 ? 'i' : 'd', word&0x01000000 ? 'b' : 'a', + regnames[(word>>16)&0xF]); + if (word & 0x200000) + putchar('!'); + fputs(", {", stdout); + flag = 0; + for (r = 0; r < 16; r++) + if (word & (1 << r)) { + if (flag) + fputs(", ", stdout); + fputs(regnames[r], stdout); + flag = 1; + } + putchar('}'); + if (word & 0x400000) + putchar('^'); + putchar('\n'); +} + void arm_disasm_line(off) unsigned off; @@ -435,7 +462,7 @@ return; case 8: case 9: - printf("\n"); + ldm_stm(word); return; case 0xA: case 0xB: