java 數字字母進位
Problem statement:
問題陳述:
Multiplication of two 8 bits numbers using 8085 microprocessor with carry.
使用帶有進位的8085微處理器將兩個8位數字相乘。
Algorithm:
算法:
Load HL pair with initial data using LHLD command.
使用LHLD命令向HL對加載初始數據。
Exchange the data of HL and DE pair using XCHG command.
使用XCHG命令交換HL和DE對的數據。
Copy the data of register D into Register C.
將寄存器D的數據復制到寄存器C。
Now initialize register D with 0.
現在將寄存器D初始化為0。
Also initialize HL pair with 0 using LXI command.
還可以使用LXI命令將HL對初始化為0。
Use the DAD command to add the data of DE pair into the data of HL pair and store in HL Pair.
使用DAD命令將DE對的數據添加到HL對的數據中并存儲在HL Pair中。
Decrease the value of C by one.
將C的值減一。
Check if the result from previous instruction resets the zero flag and if true, jump to address XXX.
檢查前一條指令的結果是否重置了零標志,如果為真,則跳轉到地址XXX。
Store the content of the HL pair into desired location.
將HL對的內容存儲到所需位置。
Stop.
停止。
Program:
程序:
LHLD 2050
XCHG
MOV C, D
MVI D 00
LXI H 0000
xxx DAD D
DCR C
JNZ 200A
SHLD 3050
HLT
Observation:
觀察:
INPUT:
2050:43
2051:07
OUTPUT:
3050:D5
3051:01
Hence successfully multiplied two 8 bits numbers with carry using 8085 microprocessor..
因此,使用8085微處理器成功地將兩個8位數字乘以進位。 。
翻譯自: https://www.includehelp.com/embedded-system/multiplication-of-two-8-bits-numbers-using-8085-microprocessor-with-carry.aspx
java 數字字母進位