.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.code
main PROC;計算85-48mov bl,48hmov al,85hsub al,bl ;AL=3Dhdas ;AL =37h(調整后的結果)INVOKE ExitProcess,0
main ENDP
END main
2:DAA_DAS : DAA與DAS將進位標志位設1的情況
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.code
main PROCmov al,56hadd al,92h ;AL=E8hdaa ;AL =48,CF =1 當壓縮十進制加法的和數大于99時,進位為1mov al,56hsub al,92h ;AL = C4hdas ;AL =64h ,CF=1;當從小的壓縮十進制數減去大的壓縮十進制整數,進位為1,也就是表示是負數INVOKE ExitProcess,0
main ENDP
END main
3:QWORD類型用SBB借位減法進行計算
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
val1 QWORD 20403004362047A1h
val2 QWORD 055210304A2630B2h
result QWORD 0.code
main PROCmov ecx,8mov esi,0mov edi,0clc
top:mov al,BYTE PTR val1[esi]sbb al,BYTE PTR val2[esi]mov BYTE PTR result[edi],alinc esiinc ediloop topINVOKE ExitProcess,0
main ENDP
END main
4:編寫指令將AX符號擴展到EAX,不能使用CWD
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.code
main PROCmov ax,0123hmov bx,axsar ax,15shl eax,16mov ax,bxINVOKE ExitProcess,0
main ENDP
END main
5:不用循環移位指令,用SHR和條件判斷指令將AL循環右移一位
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.code
main PROCmov al,11hshr al,1jnc quitor al,80h
quit:INVOKE ExitProcess,0
main ENDP
END main
6:編寫一條SHLD指令,把AX寄存器的最高位移入DX的最低位,DX左移一位
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.code
main PROCmov ax,8111hmov dx,1110hshld dx,ax,1INVOKE ExitProcess,0
main ENDP
END main
7:編寫指令,把字節數組右移一位
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
byteArray BYTE 81h,20h,33h.code
main PROCmov ecx,(LENGTHOF byteArray)-1mov esi,OFFSET byteArray
L1:mov ax,WORD PTR[esi]shr ax,1mov BYTE PTR[esi],alinc esiloop L1shr BYTE PTR[esi],1INVOKE ExitProcess,0
main ENDP
END main
8: 編寫指令,把字數組左移一位
.386.model flat,stdcall.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.data
wordArray WORD 810Dh,0C064h,93ABh.code
main PROCmov ecx,(LENGTHOF wordArray )-1mov esi,(OFFSET wordArray )+(2* TYPE WORD)
L1:mov ax,[esi - TYPE WORD]shld WORD PTR[esi],ax,1sub esi,TYPE WORDloop L1shl WORD PTR[esi],1INVOKE ExitProcess,0
main ENDP
END main
include Irvine32.inc.stack 4096
ExitProcess PROTO,dwExitCode:DWORD.code
main PROCmov al,65call showDecimal8INVOKE ExitProcess,0
main ENDPshowDecimal8 PROCaam or ax,3030hmov bx,axshr ax,8call WriteCharmov ax,bxcall WriteCharret
showDecimal8 ENDP
END main
python程序執行時間The execution time of a program is defined as the time spent by the system to execute the task. As we all know any program takes some execution time but we dont know how much. So, dont worry, in this tutorial we will learn it by using the…
string.lengthC#String.Length屬性 (C# String.Length property) String.Length property is used to get the total number of characters in the string object (length of the string); it calls with this string and returns the total number of characters. …
從鍵盤輸入一個字符,判斷其是不是大寫字母,如果是則請輸出這個大寫字母,如果不是請輸出“這不是一個大寫字母”的英文信息(要求:能連續輸出直到輸出“#”結束)。
P155 例4.13
DATA SEGMENT
STR DB 0DH,0…
c語言getc函數C語言中的getc()函數 (getc() function in C) Prototype: 原型: int getc(FILE *filename);Parameters: 參數: FILE *filenameReturn type: int 返回類型: int Use of function: 使用功能: In the file handling…
c語言feof函數C語言中的feof()函數 (feof() function in C) Prototype: 原型: int feof(FILE* filename);Parameters: 參數: FILE *filenameReturn type: int(0 or 1) 返回類型: int(0或1) Use of function: 使用功能: In C l…
Modules used: 使用的模塊: For this, we will use the opencv-python module which provides us various functions to work on images. 為此,我們將使用opencv-python模塊,該模塊為我們提供了處理圖像的各種功能。 Download opencv-pytho…