void Mask_1 - gcc汇编

来源:互联网 发布:socket() 函数源码 编辑:程序博客网 时间:2024/06/14 07:26
void Mask_1(unsigned char * const ptrDestBuffer, const unsigned char * const ptrSrcBuffer, int Width, int Height, int idLineAdd, int isLineAdd, int idPixelAdd, int isPixelAdd, int MaskColor){ const int ld = idPixelAdd + 3; const int ls = isPixelAdd + 3; const unsigned char bmaskr = (unsigned char)MaskColor; const unsigned char bmaskb = (unsigned char)(MaskColor>>16); idPixelAdd += 2; isPixelAdd += 2; Width--; int i;    register unsigned char *ptrDest = ptrDestBuffer;    register const unsigned char *ptrSrc = ptrSrcBuffer;    for (i = Height - 1; i >= 0; i--)     {      register int j = Width;      do       {        j--;        if (*ptrDest != bmaskr) //bmaskrgb[0]:Dest background color[blue part]         {          if (*ptrSrc != bmaskb) //bmaskb:Src background color[blue part]           {            *ptrDest = *ptrSrc;            ptrDest++;            ptrSrc++;            *((unsigned short int *)(ptrDest)) = *((unsigned short int *)(ptrSrc));            ptrDest += idPixelAdd;            ptrSrc += isPixelAdd;           }          else           {            ptrDest += ld;            ptrSrc += ls;           }         }        else         {          *ptrDest = *ptrSrc;          ptrDest++;          ptrSrc++;          *((unsigned short int *)(ptrDest)) = *((unsigned short int *)(ptrSrc));          ptrDest += idPixelAdd;          ptrSrc += isPixelAdd;         }       }while(j >= 0);      ptrDest += idLineAdd;      ptrSrc += isLineAdd;     }}
pushl%ebpmovl%esp, %ebpsubl$28, %espmovl32(%ebp), %eaxaddl$3, %eaxmovl%eax, -4(%ebp)movl36(%ebp), %eaxaddl$3, %eaxmovl%eax, -8(%ebp)movl40(%ebp), %eaxmovb%al, -9(%ebp)movl40(%ebp), %eaxsarl$16, %eaxmovb%al, -10(%ebp)leal32(%ebp), %eaxaddl$2, (%eax)leal36(%ebp), %eaxaddl$2, (%eax)leal16(%ebp), %eaxdecl(%eax)movl8(%ebp), %eaxmovl%eax, -20(%ebp)movl12(%ebp), %edxmovl%edx, -24(%ebp)movl20(%ebp), %eaxdecl%eaxmovl%eax, -16(%ebp)L3:cmpl$0, -16(%ebp)jsL2movl16(%ebp), %eaxmovl%eax, -28(%ebp)L6:decl-28(%ebp)movl-20(%ebp), %edxmovzbl(%edx), %eaxcmpb-9(%ebp), %aljeL9movl-24(%ebp), %edxmovzbl(%edx), %eaxcmpb-10(%ebp), %aljeL10movl-24(%ebp), %edxmovzbl(%edx), %eaxmovl-20(%ebp), %edxmovb%al, (%edx)incl-20(%ebp)incl-24(%ebp)movl-24(%ebp), %edxmovzwl(%edx), %eaxmovl-20(%ebp), %edxmovw%ax, (%edx)movl32(%ebp), %eaxaddl%eax, -20(%ebp)movl36(%ebp), %edxaddl%edx, -24(%ebp)jmpL8L10:movl-4(%ebp), %eaxaddl%eax, -20(%ebp)movl-8(%ebp), %edxaddl%edx, -24(%ebp)jmpL8L9:movl-24(%ebp), %edxmovzbl(%edx), %eaxmovl-20(%ebp), %edxmovb%al, (%edx)incl-20(%ebp)incl-24(%ebp)movl-24(%ebp), %edxmovzwl(%edx), %eaxmovl-20(%ebp), %edxmovw%ax, (%edx)movl32(%ebp), %eaxaddl%eax, -20(%ebp)movl36(%ebp), %edxaddl%edx, -24(%ebp)L8:cmpl$0, -28(%ebp)jsL7jmpL6L7:movl24(%ebp), %eaxaddl%eax, -20(%ebp)movl28(%ebp), %edxaddl%edx, -24(%ebp)leal-16(%ebp), %eaxdecl(%eax)jmpL3L2:leaveret

                                                

原创粉丝点击