if (retInstr == NULL)   retInstr = new CInstruction();
if (retInstr == NULL) { if (!gfirst) { cout << (unsigned long)*pCode << " was the first\n"; cout << (unsigned long)*(pCode+1) << "\n"; } gfirst = true; retInstr = new CInstruction(); }
CInstruction* get_next_instruction( uchar *pCode ){    CInstruction    *retInstr=NULL;    uchar           *reg = pCode+1;    switch (*pCode)    {        case 0x00:            retInstr = new CAdd( reg, (eFormat)(kfrm32_r32 | kfmSize8) );            break;        case 0x01:            retInstr = new CAdd( reg, kfrm32_r32 );            break;        case 0x02:            retInstr = new CAdd( reg, (eFormat)(kfr32_rm32 | kfmSize8) );            break;        case 0x03:            retInstr = new CAdd( reg, kfr32_rm32 );            break;        case 0x28:            retInstr = new CSub( reg, (eFormat)(kfrm32_r32 | kfmSize8) );            break;        case 0x29:            retInstr = new CSub( reg, kfrm32_r32 );            break;        case 0x2A:            retInstr = new CSub( reg, (eFormat)(kfr32_rm32 | kfmSize8) );            break;        case 0x2B:            retInstr = new CSub( reg, kfr32_rm32 );            break;        case 0x31:            retInstr = new CXor( reg, kfrm32_r32 );            break;        case 0x40:        case 0x41:        case 0x42:        case 0x43:        case 0x44:        case 0x45:        case 0x46:        case 0x47:            retInstr = new CInc( (eRegister)(*pCode & 0x07) );            break;        case 0x50:        case 0x51:        case 0x52:        case 0x53:        case 0x54:        case 0x55:        case 0x56:        case 0x57:            retInstr = new CPush( (eRegister)(*pCode & 0x07) );            break;        case 0x58:        case 0x59:        case 0x5a:        case 0x5b:        case 0x5c:        case 0x5d:        case 0x5e:        case 0x5f:            retInstr = new CPop( (eRegister)(*pCode & 0x07) );            break;        case 0x80:            switch (DIGIT_MAP[*reg])            {                case 0:                    retInstr = new CAdd( reg, (eFormat)(kfrm32 | kfmImm8 | kfmSize8) );                    break;                case 5:                    retInstr = new CSub( reg, (eFormat)(kfrm32 | kfmImm8 | kfmSize8) );                    break;                case 7:                    retInstr = new CCmp( reg, (eFormat)(kfrm32 | kfmImm8 | kfmSize8) );                    break;                default://                    retInstr = am_rm32_imm8( kunknown, reg );                    break;            }            break;        case 0x81:            switch (DIGIT_MAP[*reg])            {                case 0:                    retInstr = new CAdd( reg, (eFormat)(kfrm32 | kfmImm32) );                    break;                case 5:                    retInstr = new CSub( reg, (eFormat)(kfrm32 | kfmImm32) );                    break;                case 7:                    retInstr = new CCmp( reg, (eFormat)(kfrm32 | kfmImm32) );                    break;                default://                    retInstr = am_rm32_imm8( kunknown, reg );                    break;            }            break;        case 0x83:            switch (DIGIT_MAP[*reg])            {                case 0:                    retInstr = new CAdd( reg, (eFormat)(kfrm32 | kfmImm8) );                    break;                case 5:                    retInstr = new CSub( reg, (eFormat)(kfrm32 | kfmImm8) );                    break;                case 7:                    retInstr = new CCmp( reg, (eFormat)(kfrm32 | kfmImm8) );                    break;                default://                    retInstr = am_rm32_imm8( kunknown, reg );                    break;            }            break;        case 0x89:            retInstr = new CMov( reg, kfrm32_r32 );            break;        case 0x88:        case 0x8a:            break;        case 0x8b:            retInstr = new CMov( reg, kfr32_rm32 );            break;        case 0x8c:        case 0x8e:            break;        case 0x8D:            retInstr = new CLea( reg,  kfr32_rm32 );            break;        case 0x90:            retInstr = new CNop();            break;        case 0xC3:            retInstr = new CRet();            break;        case 0xC7:            retInstr = new CMov( reg, (eFormat)(kfrm32 | kfmImm32) );            break;        case 0x7E:            retInstr = new CJmp( kjle, *reg );            break;        case 0xE8:            retInstr = new CCall( (long)bswap_32( *(long*)reg ));            break;        case 0xEB:            retInstr = new CJmp( kjt, *reg );            break;        case 0xFF:            switch (DIGIT_MAP[*reg])            {                case 0:                    retInstr = new CInc( reg, (eFormat)(kfrm32 | kfmSize16) );                    break;                case 6:                    retInstr = new CPush( reg, kfrm32 );                    break;                default://                    retInstr = am_rm32_imm8( kunknown, reg );                    break;            }             break;        default://            retInstr = am_rm32_imm8( kunknown, reg);            break;    }// ek only until the table above is completed    if (retInstr == NULL)   retInstr = new CInstruction();    return retInstr;}