if (fDisp32 == 0)
if ( (fReg2 == kNoReg) && (fFormat & kfmDeref) ) { *buffer = 0x00 | (reg1 << 3) | 0x05; long bsDisp32 = bswap_32( fDisp32 ); memcpy( buffer+1, &bsDisp32, 4 ); isize += 4; } else if (fDisp32 == 0)
int CInstruction::am_encode( uchar *buffer, eRegister reg1 ){    int     isize = 1;    uchar   sib=0;    bool    use_sib=false;    eFormat format=fFormat;    if ((fScale != 1) ||        (fReg3 != kNoReg) ||        ( (fReg2 == kesp) && (format & kfmDeref) ))    {        uchar   scale=1;        switch (fScale)        {            case 1:                scale = 0x00;                break;            case 2:                scale = 0x40;                break;            case 4:                scale = 0x80;                break;            case 8:                scale = 0xC0;                break;        }        if (fReg3 == kNoReg)            sib = scale | (0x04 << 3) | fReg2;        else            sib = scale | (fReg3 << 3) | fReg2;        use_sib = true;*buffer = 0xff;     // ek   must fix the order of the SIB output -> opcode, sib, disp, imm        buffer++;        isize++;    }    if (fDisp32 == 0)    {        if (format & kfmDeref)        {            *buffer = 0x00 | (reg1 << 3) | fReg2;        }        else        {            *buffer = 0xC0 | (reg1 << 3) | fReg2;        }    }    else if ( (fDisp32 >= -128) && (fDisp32 <= 127) )    {        *buffer = 0x40 | (reg1 << 3) | fReg2;        *(buffer+1) = (uchar)fDisp32;        isize++;    }    else    {        *buffer = 0x40 | (reg1 << 3) | fReg2;        long bsDisp32 = bswap_32( fDisp32 );        memcpy( buffer+1, &bsDisp32, 4 );        isize += 4;    }    if (format & kfmImm8)    {        buffer[isize] = (uchar)fImm32;        isize++;    }    else if (format & kfmImm32)    {        long bsImm32 = bswap_32( fImm32 );        memcpy( buffer+isize, &bsImm32, 4 );        isize += 4;    }    return isize;}