.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data.code
main PROCmov al,'A'mov bl,'B'mov cl,'C'mov dl,'D'xchg al,dlxchg bl,clINVOKE ExitProcess,0
main ENDP
END main
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data.code
main PROC mov al,75h ;假设信息字节为 01110101add al,1;加1,如果奇偶标志位为1,那么信息字节就是偶校验否则是奇校验INVOKE ExitProcess,0
main ENDP
END main
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
val1 DWORD 11
val2 DWORD 22
val3 DWORD 33val4 WORD 44
val5 WORD 55.code
main PROC;EAX =-val2+7-val3+val1neg val2mov eax,val2add eax,7sub eax,val3add eax,val1;AX =(val4+BX)-val5mov ax,val4add ax,bxsub ax,val5INVOKE ExitProcess,0
main ENDP
END main
5: 在一个双字数组中迭代,用带比例因子的变址寻址,计算元素总和
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
listD DWORD 1,2,3,4,5,6.code
main PROCmov eax,0mov ecx,LENGTHOF listDmov esi,ecx
L1: sub esi,1add eax,listD[esi * TYPE listD]loop L1INVOKE ExitProcess,0
main ENDP
END main
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
bigEndian BYTE 12h,34h,56h,78h
littleEndian DWORD ?.code
main PROCmov eax,DWORD PTR bigEndianmov littleEndian,eaxINVOKE ExitProcess,0
main ENDP
END main
8: 交换数组元素对,元素i与元素i+1交换,元素i+2与元素i+3交换
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
dwordList DWORD 1,2,3,4,5,6.code
main PROCmov ecx,LENGTHOF dwordListmov eax,0
L1: mov esi,dwordList[eax * TYPE dwordList]inc eaxxchg esi,dwordList [eax * TYPE dwordList]dec eaxmov dwordList [eax * TYPE dwordList],esiadd eax,2dec ecxloop L1INVOKE ExitProcess,0
main ENDP
END main
9: 数组元素间隔之和,假设数组为0、2、5、9、10,则元素间隔为2、3、4、1,总和为10
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
dwordList DWORD 0,2,5,9,10.code
main PROCmov ecx,LENGTHOF dwordList -1mov eax,0
L1: mov ebx,ecxmov esi,dwordList[ebx * TYPE dwordList]dec ebxsub esi,dwordList[ebx * TYPE dwordList]add eax,esiloop L1INVOKE ExitProcess,0
main ENDP
END main
10: 将字数组复制到双字数组
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
wordList WORD 1,2,3,4,5,6
dwordList DWORD 5DUP(?).code
main PROCmov ecx,LENGTHOF wordList
L1: dec ecxmovzx eax,wordList[ecx * TYPE wordList]mov dwordList[ecx * TYPE dwordList],eaxinc ecxloop L1INVOKE ExitProcess,0
main ENDP
END main
bcd码二进制转十进制Prerequisite: Number systems 先决条件: 数字系统 BCD Code (8421 Code): In BCD 8421 code, each decimal digit is represented using a 4-bit binary number. The 4-bit binary numbers have their weights attached as 8, 4, 2, 1 from MS…
C#类和结构 (C# class and structure) In C# and other programming languages, structure and classes are used to define a custom data type, that we can organize according to our need with different types of variables, methods etc. 在C#和其…
原文地址:SQL Plus 一些使用技巧作者:☆水『若寒Sql*plus的使用 Sql*plus介绍 Sql*plus是oracle提供的一个工具程序,既可以在oracle服务器使用,也可以在oracle客户端使用。在windows下分两种,sqlplus.exe是命令行程序&…
If you assign a string to the character variable, it may cause a warning or error (in some of the compilers) or segmentation fault error occurs. 如果将字符串分配给字符变量,则可能会导致警告或错误(在某些编译器中)或发生分段错误。 Consider the code…
bfs广度优先搜索算法What you will learn? 您将学到什么? How to implement Breath first search of a graph? 如何实现图的呼吸优先搜索? Breadth First Search is a level-wise vertex traversal process. Like a tree all the graphs have verte…
JavaScript | Math.PI属性 (JavaScript | Math.PI Property) Math.PI is a property in math library of JavaScript that is used to find the value of PI(π) which is a mathematical constant whose value is 3.141. It is generally used to solve problems related to c…