.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORDtempReg TEXTEQU <eax>.data
List DWORD 1,2,3,4,5.code
main PROCmov ecx,LENGTHOF List /2mov esi,0mov edi,LENGTHOF List -1
L1:mov tempReg,List[esi * TYPE List]xchg tempReg,List[edi * TYPE List]mov List[esi * TYPE List],tempReginc esidec ediloop L1INVOKE ExitProcess,0
main ENDP
END main
3: 將字符串復制相反順序到另一個字符串
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
source BYTE "This is the source string",0
target BYTE SIZEOF source DUP('#').code
main PROCmov target[SIZEOF target -1],0mov esi,SIZEOF target -2mov edi,0mov ecx,SIZEOF target -1
L1: mov al,source[esi]mov target[edi],aldec esiinc ediloop L1INVOKE ExitProcess,0
main ENDP
END main
4: 數組元素移位,數組[10,20,30,40]移位后為[40,10,20,30]
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
dwordList DWORD 10,20,30,40.code
main PROCmov esi,LENGTHOF dwordList -1mov ecx,esimov ebx,dwordList[esi * TYPE dwordList]dec esi
L1:mov edi,dwordList[esi * TYPE dwordList]inc esimov dwordList[esi * TYPE dwordList],edisub esi,2loop L1mov dwordList,ebxINVOKE ExitProcess,0
main ENDP
END main
5: PUSHFD_POPFD : 將標識寄存器入棧出棧
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
saveFlags DWORD ?.code
main PROCpushfd ;標識寄存器內容入棧pop saveFlags ;復制給一個變量push saveFlags ;被保存的標識入棧popfd ;復制給標識寄存器INVOKE ExitProcess,0
main ENDP
END main
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.code
main PROCpushad ;保存通用寄存器的內容 eax,ecx,edx,ebx,esp,ebp,esi,edi順序;mov eax,0;如果有返回值在eax中后面就要注意用popad了popad ;反順序出棧INVOKE ExitProcess,0
main ENDP
END main
7: 運用棧將字符串反轉
.386.model flat,stdcall
.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
aName BYTE "Abraham Lincoln",0
nameSize =($ - aName)-1.code
main PROC;將名字壓入棧mov ecx,nameSizemov esi,0
L1:movzx eax,aName[esi];獲取字符push eax ;壓入棧inc esiloop L1;將名字按逆序彈出棧;并存入aName數組mov ecx,nameSizemov esi,0
L2:pop eax ;獲取字符mov aName[esi],al;存入字符串inc esiloop L2INVOKE ExitProcess,0
main ENDP
END main
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
myWord WORD 1000h.code
main PROCinc myWordmov bx,myWorddec bxINVOKE ExitProcess,0
main ENDP
END main
計算機體系結構分類 (Classification of computer architecture) According to Flynns there are four different classification of computer architecture, 根據弗林的說法,計算機體系結構有四種不同的分類, 1)SISD(單指令單數據流) (1) SISD (Single…
In the below example – we are implementing a python program to print the current/ todays year, month and year. 在下面的示例中-我們正在實現一個python程序來打印當前/今天的年,月和年 。 Steps: 腳步: Import the date class from datetime …
解決方案:執行如下SQL語句即可解決:use ufsystem update ua_account_sub set bclosing0 where cacc_id001 and iyear2005 and csub_idwa 重新年結即可 問題分析:產生問題的原因是用戶進行過工資的年結,在業務數據需要調整&…
RandomAccessFile類readInt()方法 (RandomAccessFile Class readInt() method) readInt() method is available in java.io package. readInt()方法在java.io包中可用。 readInt() method is used to read signed 32-bit integer value from this RandomAccessFile. readInt()方…
java jar包示例包類的isCompatibleWith()方法 (Package Class isCompatibleWith() method) isCompatibleWith() method is available in java.lang package. isCompatibleWith()方法在java.lang包中可用。 isCompatibleWith() method is used to check the specification versi…
tooctalstring長類toOctalString()方法 (Long class toOctalString() method) toOctalString() method is available in java.lang package. toOctalString()方法在java.lang包中可用。 toOctalString() method is used to represent an octal string of the given parameter […