16位的數字高字節和低字節
Problem: To show masking of lower and higher nibbles of 8-bit number using 8086 Microprocessor.
問題:使用8086微處理器顯示8位低半字節和高半字節的屏蔽。
Assumption:
假設:
Number is stored at memory location 0600.
編號存儲在內存位置0600。
Result will be stored at memory location 0601 and 0602.
結果將存儲在存儲器位置0601和0602。
Algorithm:
算法:
Load first number to the register AL.
將第一個數字加載到寄存器AL中。
Move the content of register AL to register BL.
將寄存器AL的內容移至寄存器BL。
Apply AND operation on register AL with 0F.
對0F的AL寄存器進行AND運算。
Now Apply AND operation on register BL with F0.
現在,用F0對AND BL進行AND操作。
Rotate the content of register BL 4 times.
將寄存器BL的內容旋轉4次。
Now move the content of register AL to memory location [0601].
現在將寄存器AL的內容移動到存儲器位置[0601]。
Now move the content of register BL to memory location [0602].
現在將寄存器BL的內容移至存儲位置[0602]。
Terminate the program.
終止程序。
Program:
程序:
MOV AL, [0600]
MOV BL, AL
AND AL, 0F
AND BL, F0
MOV CL, 04
ROR BL, CL
MOV [0601], AL
MOV [0602], BL
HLT
Observation:
觀察:
INPUT:
0600: 12
OUTPUT:
0601:02
0602:01
Hence, we successfully masked the higher and lower nibble of an 8-bit number using 8086 Microprocessor.
因此,我們使用8086微處理器成功掩蓋了8位數字的高半字節和低半字節 。
翻譯自: https://www.includehelp.com/embedded-system/show-masking-of-lower-and-higher-nibbles-of-8-bit-number.aspx
16位的數字高字節和低字節