shell查找5位数字
Problem: To find the square of an 8-bit number using 8085 Microprocessor.
问题:使用8085微处理器查找8位数字的平方。
Algorithm:
算法:
Load the register H with value 20H and the register L with value 50H and the value of accumulator with 00H.
向寄存器H加载值20H,向寄存器L加载值50H,向累加器加载00H。
Load the content of register B with the value taken from memory.
用从存储器获取的值加载寄存器B的内容。
Add the content of M in accumulator A and decrement the value of register B by one.
将累加器A中M的内容相加,并将寄存器B的值减1。
Check if value of register B is 00 if yes then store result at memory location otherwise goto step 3.
检查寄存器B的值是否为00(如果是),然后将结果存储在存储器位置,否则转到步骤3。
Terminate the program.
终止程序。
Program:
程序:
MVI L 50
MVI H 20
MVI A 00
MOV B, M
**ADD M
DCR B
JNZ **
STA 3050
HLT
Observation:
观察:
INPUT:
2050 : 03
OUTPUT:
3050 : 09
Hence, we successfully find the square of an 8-bit number using 8085 Microprocessor.
因此,我们使用8085微处理器成功找到了8位数字的平方 。
翻译自: https://www.includehelp.com/embedded-system/find-square-of-an-8-bit-number.aspx
shell查找5位数字