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