16位的數字高字節和低字節
Problem statement:
問題陳述:
To mask lower and higher nibble of 8-bit number using 8085 Microprocessor.
使用8085微處理器掩蓋8位數字的較低和較高半字節。
Algorithm:
算法:
Load the content of accumulator A with an 8bit number.
用8位數字加載累加器A的內容。
Copy the content of accumulator to the register B.
將累加器的內容復制到寄存器B中。
Perform AND operation on the content of accumulator with 0F.
用0F對累加器的內容執行AND操作。
Store the result in a memory location.
將結果存儲在存儲位置中。
Copy the content of register B to the register accumulator.
將寄存器B的內容復制到寄存器累加器。
Perform AND operation on the content of accumulator with F0.
用F0對累加器的內容執行AND操作。
Perform RLC operation 4 times.
進行4次RLC操作。
Terminate the program.
終止程序。
Program:
程序:
LDA 2051
MOV B, A
ANI 0F
STA 2052
MOV A, B
ANI F0
RLC
RLC
RLC
RLC
STA 2053
HLT
Observation:
觀察:
INPUT:
2051:16
OUTPUT:
2052:06
2053:01
Hence, we successfully masked the lower and higher nibble of 8-bit number.
因此,我們成功地掩蓋了8位數字的較低和較高的半字節 。
翻譯自: https://www.includehelp.com/embedded-system/masking-of-lower-and-higher-nibble-of-8-bit-number.aspx
16位的數字高字節和低字節