Lines Matching refs:insn
39 char *Arm::disasm(uint32_t addr, uint32_t insn, char *result)
45 Opcode opcode = decode(insn);
69 return disasm_alu(opcode, insn, ptr);
72 return disasm_branch(addr, opcode, insn, ptr);
74 return disasm_bkpt(insn, ptr);
79 return disasm_bx(insn, ptr);
84 return disasm_clz(insn, ptr);
90 return disasm_memblock(opcode, insn, ptr);
99 return disasm_mem(insn, ptr);
104 return disasm_memhalf(insn, ptr);
107 return disasm_mcr(opcode, insn, ptr);
109 return disasm_mla(opcode, insn, ptr);
111 return disasm_mrs(insn, ptr);
113 return disasm_msr(insn, ptr);
115 return disasm_mul(opcode, insn, ptr);
117 return disasm_pld(insn, ptr);
122 return disasm_swi(insn, ptr);
125 return disasm_swp(opcode, insn, ptr);
130 return disasm_umlal(opcode, insn, ptr);
138 char *Arm::disasm_alu(Opcode opcode, uint32_t insn, char *ptr)
147 uint8_t cond = (insn >> 28) & 0xf;
148 uint8_t is_immed = (insn >> 25) & 0x1;
149 uint8_t bit_s = (insn >> 20) & 1;
150 uint8_t rn = (insn >> 16) & 0xf;
151 uint8_t rd = (insn >> 12) & 0xf;
152 uint8_t immed = insn & 0xff;
193 uint8_t shift_is_reg = (insn >> 4) & 1;
194 uint8_t rotate = (insn >> 8) & 0xf;
195 uint8_t rm = insn & 0xf;
196 uint8_t shift_type = (insn >> 5) & 0x3;
197 uint8_t rs = (insn >> 8) & 0xf;
198 uint8_t shift_amount = (insn >> 7) & 0x1f;
230 char *Arm::disasm_branch(uint32_t addr, Opcode opcode, uint32_t insn, char *ptr)
232 uint8_t cond = (insn >> 28) & 0xf;
233 uint32_t offset = insn & 0xffffff;
247 char *Arm::disasm_bx(uint32_t insn, char *ptr)
249 uint8_t cond = (insn >> 28) & 0xf;
250 uint8_t rn = insn & 0xf;
255 char *Arm::disasm_bkpt(uint32_t insn, char *ptr)
257 uint32_t immed = (((insn >> 8) & 0xfff) << 4) | (insn & 0xf);
262 char *Arm::disasm_clz(uint32_t insn, char *ptr)
264 uint8_t cond = (insn >> 28) & 0xf;
265 uint8_t rd = (insn >> 12) & 0xf;
266 uint8_t rm = insn & 0xf;
271 char *Arm::disasm_memblock(Opcode opcode, uint32_t insn, char *ptr)
275 uint8_t cond = (insn >> 28) & 0xf;
276 uint8_t write_back = (insn >> 21) & 0x1;
277 uint8_t bit_s = (insn >> 22) & 0x1;
278 uint8_t is_up = (insn >> 23) & 0x1;
279 uint8_t is_pre = (insn >> 24) & 0x1;
280 uint8_t rn = (insn >> 16) & 0xf;
281 uint16_t reg_list = insn & 0xffff;
323 char *Arm::disasm_mem(uint32_t insn, char *ptr)
325 uint8_t cond = (insn >> 28) & 0xf;
326 uint8_t is_reg = (insn >> 25) & 0x1;
327 uint8_t is_load = (insn >> 20) & 0x1;
328 uint8_t write_back = (insn >> 21) & 0x1;
329 uint8_t is_byte = (insn >> 22) & 0x1;
330 uint8_t is_up = (insn >> 23) & 0x1;
331 uint8_t is_pre = (insn >> 24) & 0x1;
332 uint8_t rn = (insn >> 16) & 0xf;
333 uint8_t rd = (insn >> 12) & 0xf;
334 uint16_t offset = insn & 0xfff;
371 uint8_t rm = insn & 0xf;
372 uint8_t shift_type = (insn >> 5) & 0x3;
373 uint8_t shift_amount = (insn >> 7) & 0x1f;
421 char *Arm::disasm_memhalf(uint32_t insn, char *ptr)
423 uint8_t cond = (insn >> 28) & 0xf;
424 uint8_t is_load = (insn >> 20) & 0x1;
425 uint8_t write_back = (insn >> 21) & 0x1;
426 uint8_t is_immed = (insn >> 22) & 0x1;
427 uint8_t is_up = (insn >> 23) & 0x1;
428 uint8_t is_pre = (insn >> 24) & 0x1;
429 uint8_t rn = (insn >> 16) & 0xf;
430 uint8_t rd = (insn >> 12) & 0xf;
431 uint8_t bits_65 = (insn >> 5) & 0x3;
432 uint8_t rm = insn & 0xf;
433 uint8_t offset = (((insn >> 8) & 0xf) << 4) | (insn & 0xf);
479 char *Arm::disasm_mcr(Opcode opcode, uint32_t insn, char *ptr)
481 uint8_t cond = (insn >> 28) & 0xf;
482 uint8_t crn = (insn >> 16) & 0xf;
483 uint8_t crd = (insn >> 12) & 0xf;
484 uint8_t cpnum = (insn >> 8) & 0xf;
485 uint8_t opcode2 = (insn >> 5) & 0x7;
486 uint8_t crm = insn & 0xf;
494 char *Arm::disasm_mla(Opcode opcode, uint32_t insn, char *ptr)
496 uint8_t cond = (insn >> 28) & 0xf;
497 uint8_t rd = (insn >> 16) & 0xf;
498 uint8_t rn = (insn >> 12) & 0xf;
499 uint8_t rs = (insn >> 8) & 0xf;
500 uint8_t rm = insn & 0xf;
501 uint8_t bit_s = (insn >> 20) & 1;
509 char *Arm::disasm_umlal(Opcode opcode, uint32_t insn, char *ptr)
511 uint8_t cond = (insn >> 28) & 0xf;
512 uint8_t rdhi = (insn >> 16) & 0xf;
513 uint8_t rdlo = (insn >> 12) & 0xf;
514 uint8_t rs = (insn >> 8) & 0xf;
515 uint8_t rm = insn & 0xf;
516 uint8_t bit_s = (insn >> 20) & 1;
524 char *Arm::disasm_mul(Opcode opcode, uint32_t insn, char *ptr)
526 uint8_t cond = (insn >> 28) & 0xf;
527 uint8_t rd = (insn >> 16) & 0xf;
528 uint8_t rs = (insn >> 8) & 0xf;
529 uint8_t rm = insn & 0xf;
530 uint8_t bit_s = (insn >> 20) & 1;
538 char *Arm::disasm_mrs(uint32_t insn, char *ptr)
540 uint8_t cond = (insn >> 28) & 0xf;
541 uint8_t rd = (insn >> 12) & 0xf;
542 uint8_t ps = (insn >> 22) & 1;
548 char *Arm::disasm_msr(uint32_t insn, char *ptr)
552 uint8_t cond = (insn >> 28) & 0xf;
553 uint8_t is_immed = (insn >> 25) & 0x1;
554 uint8_t pd = (insn >> 22) & 1;
555 uint8_t mask = (insn >> 16) & 0xf;
568 uint32_t immed = insn & 0xff;
569 uint8_t rotate = (insn >> 8) & 0xf;
577 uint8_t rm = insn & 0xf;
584 char *Arm::disasm_pld(uint32_t insn, char *ptr)
586 uint8_t is_reg = (insn >> 25) & 0x1;
587 uint8_t is_up = (insn >> 23) & 0x1;
588 uint8_t rn = (insn >> 16) & 0xf;
595 insn & 0xf;
600 uint16_t offset = insn & 0xfff;
609 char *Arm::disasm_swi(uint32_t insn, char *ptr)
611 uint8_t cond = (insn >> 28) & 0xf;
612 uint32_t sysnum = insn & 0x00ffffff;
618 char *Arm::disasm_swp(Opcode opcode, uint32_t insn, char *ptr)
620 uint8_t cond = (insn >> 28) & 0xf;
621 uint8_t rn = (insn >> 16) & 0xf;
622 uint8_t rd = (insn >> 12) & 0xf;
623 uint8_t rm = insn & 0xf;
630 Opcode Arm::decode(uint32_t insn) {
631 uint32_t bits27_26 = (insn >> 26) & 0x3;
634 return decode00(insn);
636 return decode01(insn);
638 return decode10(insn);
640 return decode11(insn);
645 Opcode Arm::decode00(uint32_t insn) {
646 uint8_t bit25 = (insn >> 25) & 0x1;
647 uint8_t bit4 = (insn >> 4) & 0x1;
649 if ((insn & 0x0ffffff0) == 0x012fff10) {
653 if ((insn & 0x0ff000f0) == 0x01600010) {
657 if ((insn & 0xfff000f0) == 0xe1200070) {
661 uint32_t bits7_4 = (insn >> 4) & 0xf;
663 if ((insn & 0x0ff00ff0) == 0x01000090) {
665 uint8_t bit22 = (insn >> 22) & 0x1;
671 return decode_mul(insn);
674 uint8_t bit7 = (insn >> 7) & 0x1;
677 return decode_ldrh(insn);
682 return decode_alu(insn);
685 Opcode Arm::decode01(uint32_t insn) {
686 uint8_t is_reg = (insn >> 25) & 0x1;
687 uint8_t bit4 = (insn >> 4) & 0x1;
690 uint8_t is_load = (insn >> 20) & 0x1;
691 uint8_t is_byte = (insn >> 22) & 0x1;
692 if ((insn & 0xfd70f000) == 0xf550f000) {
712 Opcode Arm::decode10(uint32_t insn) {
713 uint8_t bit25 = (insn >> 25) & 0x1;
716 uint8_t is_load = (insn >> 20) & 0x1;
722 uint8_t is_link = (insn >> 24) & 1;
723 uint32_t offset = insn & 0xffffff;
737 Opcode Arm::decode11(uint32_t insn) {
738 uint8_t bit25 = (insn >> 25) & 0x1;
741 uint8_t is_load = (insn >> 20) & 0x1;
750 uint8_t bit24 = (insn >> 24) & 0x1;
756 uint8_t bit4 = (insn >> 4) & 0x1;
757 uint8_t cpnum = (insn >> 8) & 0xf;
761 uint8_t opcode = (insn >> 21) & 0x7;
769 uint8_t is_mrc = (insn >> 20) & 0x1;
780 uint8_t is_mrc = (insn >> 20) & 0x1;
786 Opcode Arm::decode_mul(uint32_t insn) {
787 uint8_t bit24 = (insn >> 24) & 0x1;
793 uint8_t bit23 = (insn >> 23) & 0x1;
794 uint8_t bit22_U = (insn >> 22) & 0x1;
795 uint8_t bit21_A = (insn >> 21) & 0x1;
820 Opcode Arm::decode_ldrh(uint32_t insn) {
821 uint8_t is_load = (insn >> 20) & 0x1;
822 uint8_t bits_65 = (insn >> 5) & 0x3;
850 Opcode Arm::decode_alu(uint32_t insn) {
851 uint8_t is_immed = (insn >> 25) & 0x1;
852 uint8_t opcode = (insn >> 21) & 0xf;
853 uint8_t bit_s = (insn >> 20) & 1;
854 uint8_t shift_is_reg = (insn >> 4) & 1;
855 uint8_t bit7 = (insn >> 7) & 1;