軟件首頁 |  文章首頁
最新更新 軟件分類 設(shè)為首頁 加入收藏 聯(lián)系我們
當(dāng)前位置:首頁文章首頁 IT學(xué)院 Delphi

DELPHI7的通配符比較的匯編函數(shù)

作者:東坡下載  來源:uzzf  發(fā)布時間:2010-10-14 9:42:35  點擊:

SUB ECX,1
//MOV AL,[ESI]

//INC ESI
CMP AL,'?'

//POP ESI

JE @@qq
CMP AL,'*'
JE @@www
CMP AL,$12
//POP EAX
JE @@found
CMP AL,$0
JE @@found
//POP EAX
SUB ESI,1
ADD ECX,1
POP EAX
POP EAX
/////////////////////////

@@loopOK: MOV AL,[ESI] { AL = first char of substr }

// INC ESI { Point ESI to 2'nd char of substr }

// SUB ECX,EDX { #positions in s to look at }
{ = Length(s) - Length(substr) + 1 }
// JLE @@fail
//MOV ECX,dlen-(EDI-edi0)-(sublen-(ESI-esi0))+1+starnum//-starnum2
MOV ECX,dlen
SUB ECX,EDI
ADD ECX,edi0
SUB ECX,sublen
ADD ECX,ESI //esi為1時,ESI0為0,所以總多一,要加多一個一
SUB ECX,esi0
//ADD ECX,2 //STRING
ADD ECX,1 //PCHAR
ADD ECX,starnum
//SUB ECX,starnum2
CMP ECX,0
JLE @@fail
REPNE SCASB
JNE @@fail
//MOV EBX,ECX { save outer loop counter }
///////////////////////////////////////////////////////
PUSH EAX
PUSH EDI
SUB EDI,1
MOV AL,[EDI]
CMP AL,$80
POP EDI
POP EAX

JNB @@IFBACK
///////////////////////////////////////////////////////
@@IFLEAD:
//ADD ESI,1
MOV ECX,sublen
SUB ECX,ESI
ADD ECX,esi0
SUB ECX,1 //PCHAR才如此也
//SUB ECX,1
PUSH ESI { save outer loop substr pointer }
INC ESI
PUSH EDI { save outer loop s pointer }
//PUSH EDX

MOV ECX,ECX
CMP ECX,0
JE @@found
//POP EDX
JMP @@loopwww
@@IFBACK:
PUSH EDI
PUSH EAX
MOV ifbacknum,0
SUB EDI,1
@@ifback2:
ADD EDI,1
CMP EDI,edi0
JE @@ifback1
MOV AL,[EDI]
CMP AL,$80
JB @@ifback1
NOT ifbacknum
JMP @@ifback2
@@ifback3:
POP EAX
POP EDI
JMP @@IFLEAD
@@ifback1:
CMP ifbacknum,0
JNE @@ifback3
POP EAX
POP EDI
ADD EDI,1
JMP @@loopOK

@@qq:

POP EAX
ADD EDI,1
///////////////
//PUSH EAX
MOV AL,[EDI]
CMP AL,$80
JNB @@chinese0
@@whatchinese0:

//POP EAX
////////////////////////
PUSH EDI

JMP @@www
@@qqq:
ADD EDI,1
///////////////
PUSH EAX

MOV AL,[EDI]
CMP AL,$80
JNB @@chinese0

POP EAX
////////////////////////
PUSH EDI

JMP @@www
@@chinese0:
ADD EDI,1
JMP @@whatchinese0

@@fail2:
POP EDX
POP EDX
@@fail:
POP EDX { get rid of saved s pointer }
XOR EAX,EAX
JMP @@exit
@@iffound1:
MOV AL,[ESI]
MOV AL,[ESI-1]
MOV AL,[EDI-1]
CMP AL,[ESI-1]
JE @@found
JMP @@iffound2
@@found:
POP EDI { restore outer loop s pointer }
POP ESI { restore outer loop substr pointer }
POP EDX { restore pointer to first char of s }
MOV EAX,EDI { EDI points of char after match }
SUB EAX,EDX { the difference is the correct index }
@@exit:
POP EDI
POP ESI
POP EBX
end;

文章評論

欄目導(dǎo)航

本類推薦文章

關(guān)于本站 | 網(wǎng)站幫助 | 廣告合作 | 下載聲明 | 友情連接 | 網(wǎng)站地圖
Copyright © 20098-2010 uzzf下載站. All Rights Reserved .