comparison arm7dis/armdis.c @ 94:915e2ca2813d

armdis: ldm/stm decoding implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 30 Mar 2014 07:11:41 +0000
parents 5ebebbc74622
children 9ed4d0fcb1f6
comparison
equal deleted inserted replaced
93:5ebebbc74622 94:915e2ca2813d
395 ldr_str_ext(off, word); 395 ldr_str_ext(off, word);
396 else 396 else
397 multiply(word); 397 multiply(word);
398 } 398 }
399 399
400 static void
401 ldm_stm(word)
402 unsigned word;
403 {
404 int r, flag;
405
406 printf("%s%s%c%c\t%s", word&0x100000 ? "ldm" : "stm",
407 condition_decode[word>>28],
408 word&0x800000 ? 'i' : 'd', word&0x01000000 ? 'b' : 'a',
409 regnames[(word>>16)&0xF]);
410 if (word & 0x200000)
411 putchar('!');
412 fputs(", {", stdout);
413 flag = 0;
414 for (r = 0; r < 16; r++)
415 if (word & (1 << r)) {
416 if (flag)
417 fputs(", ", stdout);
418 fputs(regnames[r], stdout);
419 flag = 1;
420 }
421 putchar('}');
422 if (word & 0x400000)
423 putchar('^');
424 putchar('\n');
425 }
426
400 void 427 void
401 arm_disasm_line(off) 428 arm_disasm_line(off)
402 unsigned off; 429 unsigned off;
403 { 430 {
404 unsigned word; 431 unsigned word;
433 case 7: 460 case 7:
434 ldr_str_reg_pre(word); 461 ldr_str_reg_pre(word);
435 return; 462 return;
436 case 8: 463 case 8:
437 case 9: 464 case 9:
438 printf("<ldm/stm>\n"); 465 ldm_stm(word);
439 return; 466 return;
440 case 0xA: 467 case 0xA:
441 case 0xB: 468 case 0xB:
442 arm_branch(off, word); 469 arm_branch(off, word);
443 return; 470 return;