📄 dsmlib.c
字号:
{ case 2: printf ("#%#x\n", binInst [2]); break; case 3: printf ("#%#x%04x\n", binInst [2], binInst [3]); break; case 4: printf ("#0\n"); break; } break; /* fpp instructions */ case itFb: if(binInst[0] & 0x40) printf ("#%#x\n", binInst[1]); else printf ("#%#x%04x\n", binInst[1], binInst[2]); break; case itFrestore: case itFsave: case itFs: prEffAddr((binInst[0] & 0x38)>>3, binInst[0] & 0x7, &binInst[1], 0, prtAddress); printf ("\n"); break; case itFdb: printf ("D%x,#%#x\n",binInst[0] & 0x7, binInst[2]); break; case itFtrap: switch(binInst[0] & 7) { case 2: printf ("#%#x\n",binInst[2]); break; case 3: printf ("#%#x%04x\n", binInst[2], binInst[3]); break; case 4: printf ("#0\n"); break; } break; case itFtst: if (binInst[1] & 0x4000) prEffAddr((binInst[0] & 0x38)>>3, binInst[0] & 0x7, &binInst[2], 0, prtAddress); else printf ("F%x", (binInst[1] & 0x0380)>>7); printf ("\n"); break; case itFmovek: printf ("F%x,", (binInst[1] & 0x0380)>>7); prEffAddr((binInst[0] & 0x38) >> 3, binInst[0] & 0x7, &binInst[2], 0, prtAddress); printf ("\n"); break; case itFmovel: if (binInst[1] & 0x2000) { prFmovemcr ((binInst[1] & 0x1c00) >> 10); printf (","); prEffAddr((binInst[0] & 0x38) >> 3, binInst[0] & 0x7, &binInst[2], 0, prtAddress); } else { prEffAddr((binInst[0] & 0x38) >> 3, binInst[0] & 0x7, &binInst[2], 0, prtAddress); printf (","); prFmovemcr ((binInst[1] & 0x1c00) >> 10); } printf ("\n"); break; case itFmovecr: printf ("#%#x,", binInst[1] & 0x7f); printf ("F%x\n",(binInst[1] & 0x0380) >> 7); break; case itFmovem: if (binInst[1] & 0x2000) { prFmovemr((binInst[1] & 0x1800) >> 11, binInst[1] & 0xff); printf (","); prEffAddr((binInst[0] & 0x38) >> 3, binInst[0] & 0x7, &binInst[2], 0, prtAddress); } else { prEffAddr((binInst[0] & 0x38) >> 3, binInst[0] & 0x7, &binInst[2], 0, prtAddress); printf (","); prFmovemr ((binInst[1] & 0x1800) >> 11, binInst[1] & 0xff); } printf ("\n"); break; case itFmovemc: if (binInst[1] & 0x2000) { prFmovemcr ((binInst[1] & 0x1c00) >> 10); printf (","); prEffAddr((binInst[0] & 0x38) >> 3, binInst[0] & 0x7, &binInst[2], 0, prtAddress); } else { prEffAddr ((binInst[0] & 0x38) >> 3, binInst[0] & 0x7, &binInst[2], 0, prtAddress); printf (","); prFmovemcr ((binInst[1] & 0x1c00) >> 10); } printf ("\n"); break; case itFsincos: if (binInst[1] & 0x4000) prEffAddr((binInst[0] & 0x38) >> 3, binInst[0] & 0x7, &binInst[2], 0, prtAddress); else printf ("F%x,", (binInst[1] & 0x1c00) >> 10); printf (",F%x:F%x\n", (binInst[1] & 0x7), (binInst[1] & 0x380) >> 7); break; case itFabs: case itFacos: case itFadd: case itFasin: case itFatan: case itFatanh: case itFcmp: case itFcos: case itFcosh: case itFdiv: case itFetox: case itFetoxm1: case itFgetexp: case itFgetman: case itFint: case itFintrz: case itFlog10: case itFlog2: case itFlogn: case itFlognp1: case itFmod: case itFmove: case itFmul: case itFneg: case itFnop: case itFrem: case itFscale: case itFsgldiv: case itFsglmul: case itFsin: case itFsinh: case itFsqrt: case itFsub: case itFtan: case itFtanh: case itFtentox: case itFtwotox: if (binInst[1] & 0x4000) { switch ((binInst [1] & 0x1c00) >> 10) { case LONGINT: sizeData = 4; break; case SINGLEREAL: sizeData = 4; break; case EXTENDEDREAL: sizeData = 12; break; case PACKEDDECIMAL: sizeData = 12; break; case WORDINT: sizeData = 2; break; case DOUBLEREAL: sizeData = 8; break; case BYTEINT: sizeData = 2; break; default: sizeData = 4; break; } prEffAddr((binInst[0] & 0x38) >> 3, binInst[0] & 0x7, &binInst[2], sizeData, prtAddress); printf (",F%x", (binInst[1] & 0x0380) >> 7); } else printf ("F%x,F%x", (binInst[1] & 0x1c00) >> 10, (binInst[1] & 0x0380) >> 7); printf ("\n"); break; case itCpush:#ifdef INCLUDE_V4 printf ("%s,(A%x)\n", (binInst[0] & 0x00c0) == 0x0040 ? "DC" : (binInst[0] & 0x00c0) == 0x0080 ? "IC" : "BC", binInst [0] & 0x07);#else printf ("(A%x)\n", binInst [0] & 0x07);#endif break; case itWDebug: prEffAddr ((binInst [0] & 0x38) >> 3, binInst [0] & 0x7, &binInst [2], 0, prtAddress); printf ("\n"); /* MAC instructions for Coldfire 5206 & 53xx */ case itMoveFACC: printf ( "ACC, %c%x\n" ,((binInst [0] & 0x8) == 0) ? 'D' : 'A' ,binInst [0] & 0x7 ); break; case itMoveTACC: prEffAddr ( ( binInst [0] & 0x38) >> 3, binInst [0] & 0x7, &binInst [1], 4, prtAddress ); printf( ", ACC\n"); break; case itMoveFMACSR: printf ( "MACSR, %c%x\n", ((binInst [0] & 0x8) == 0) ? 'D' : 'A', binInst [0] & 0x7); break; case itMoveTMACSR: prEffAddr ( ( binInst [0] & 0x38) >> 3, binInst [0] & 0x7, &binInst [1], 4, prtAddress); printf (", MACSR\n"); break; case itMoveFMASK: printf ("MASK, %c%x\n", ((binInst [0] & 0x8) == 0) ? 'D' : 'A', binInst [0] & 0x7); break; case itMoveTMASK: prEffAddr ( (binInst [0] & 0x38) >> 3, binInst [0] & 0x7, &binInst [1], 4, prtAddress); printf( ", MASK\n"); break; case itMoveTCCR: printf ( "MACSR, CCR\n"); break; case itMsac: case itMac: { USHORT binInst0 = binInst [0]; USHORT binInst1 = binInst [1]; /* SF Scale Factor */ switch ((binInst1 & 0x0600) >> 9) { case 1: shift = ",<<"; break; case 3: shift = ",>>"; break; default: shift = NULL; break; } /* print operand upper/lower half only for word operands (SZ flag is 0)*/ if (0 == (binInst1 & 0x0800) ) { /* U/LX Source X Word Select field */ switch (binInst1 & 0x0080) { case 0: sourceXword = ".l"; break; default: sourceXword = ".u"; break; } /* U/LY Source Y Word Select field */ switch (binInst1 & 0x0040) { case 0: sourceYword = ".l"; break; default: sourceYword = ".u"; break; } } else { sourceXword = NULL; sourceYword = NULL; } printf ( "%c%x%s,%c%x%s%s\n" ,((binInst0 & 0x0008) == 0) ? 'D' : 'A' ,binInst0 & 0x0007 ,((sourceYword == NULL) ? "" : sourceYword) ,((binInst0 & 0x0040) == 0) ? 'D' : 'A' ,((binInst0 & 0x0e00) >> 9) ,((sourceXword == NULL) ? "" : sourceXword) ,((shift == NULL) ? "" : shift) ); } break; case itMsacl: case itMacl: { USHORT binInst0 = binInst [0]; USHORT binInst1 = binInst [1]; /* SF Scale Factor */ switch ((binInst1 & 0x0600) >> 9) { case 1: shift = ",<<"; break; case 3: shift = ",>>"; break; default: shift = NULL; break; } /* print operand upper/lower half only for word operands (SF flag is zero) */ if (0 == (binInst1 & 0x0800)) { /* U/LY Source Y Word Select field */ switch (binInst1 & 0x0040) { case 0: sourceYword = ".l"; break; default: sourceYword = ".u"; break; } /* U/LX Source X Word Select field */ switch (binInst1 & 0x0080) { case 0: sourceXword = ".l"; break; default: sourceXword = ".u"; break; } } else { sourceXword = NULL; sourceYword = NULL; } /* MAM (MASK) field */ switch (binInst1 & 0x0020) { case 0: mam = NULL; break; default: mam = "&"; break; } /* * MACL .<size> Ry.<ul>, Rx.<ul>, <ea>, Rw no shift * MACL .<size> Ry.<ul>, Rx.<ul>,<shift>, <ea>, Rw shift * MACL .<size> Ry.<ul>, Rx.<ul>,<shift>, <ea>&, Rw shift and mask */ /* Ry Data or Address */ printf (((binInst1 & 0x0008) == 0) ? "D" : "A"); /* Ry register number */ printf ( "%d",binInst1 & 0x0007 ); /* Ry upper/lower half */ if ( sourceYword ) printf( sourceYword ); printf ( "," ); /* now for Rx */ /* Rx Data or Address */ printf (((binInst1 & 0x8000) == 0) ? "D" : "A"); /* Rx register number */ printf ( "%d",(binInst1 & 0x7000) >> 12 ); /* Rx upper/lower half */ if ( sourceXword ) printf( sourceXword ); /* shift ? */ if ( shift ) printf ( shift ); /* effective address */ printf ( "," ); prEffAddr ( ( binInst0 & 0x38) >> 3, binInst0 & 0x7, &binInst [2], 4, prtAddress); /* Mask Addressing Mode Modifier */ if ( mam ) printf ( mam ); /* Rw destination register */ printf ( "," ); /* Rw Data or Address */ printf (((binInst0 & 0x0040) == 0) ? "D" : "A"); /* Rw register number */ printf ( "%d\n",(binInst0 & 0x0e00) >> 9 ); } break; /* End of "MAC instructions for Coldfire 5206 & 53xx" */ /* Coldfire version 4 instruction set enhancements */ case itMove3q:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -