Binary 如何在8085微处理器中使用移位和加法运算将两个8位数字相乘?
我们应该使用8085微处理器的移位和加法运算将两个8位数字相乘。答案应该是16位数字。必须使用shift和add操作才能理解解决方案。您必须熟悉8085中的旋转说明,尤其是对于此解决方案,您需要了解两件事Binary 如何在8085微处理器中使用移位和加法运算将两个8位数字相乘?,binary,8085,Binary,8085,我们应该使用8085微处理器的移位和加法运算将两个8位数字相乘。答案应该是16位数字。必须使用shift和add操作才能理解解决方案。您必须熟悉8085中的旋转说明,尤其是对于此解决方案,您需要了解两件事 RRC指令将位向右旋转,可以从进位标志检查LSB 将数字乘以2(二进制中的10)将导致左移位乘以一位(自行验证) 将数字本身相加等于将数字乘以2(二进制中为10),因此也将位移位1位 #ORG 8000 //initializing operands LXI H,7
#ORG 8000
//initializing operands
LXI H,7000H //data is stored in 7000H
MOV E,M
MVI D,00H
INX H
MOV A,M
MVI C,08H
LXI H, 0000H
//multiplication algorithm starts here
LOOP : RRC
JNC SKIP
DAD D
//left shift is performed by adding number with itself
//three lines just below this comment is shifting DE pair to left by 1 bit
SKIP: XCHG //exchange HL and DE pair
DAD H //Add HL with itself and store in HL
XCHG //exchange HL and DE
DCR C
JNZ LOOP
SHLD 7050H
HLT
#ORG7000
#DB 25,2A
使用谷歌应该很容易找到策略,比如到目前为止你尝试了什么?