.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 […