shell查找5位数字_查找8位数字的平方| 8085微处理器

shell查找5位数字

Problem: To find the square of an 8-bit number using 8085 Microprocessor.

问题:使用8085微处理器查找8位数字的平方。

Algorithm:

算法:

  1. 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。

  2. Load the content of register B with the value taken from memory.

    用从存储器获取的值加载寄存器B的内容。

  3. Add the content of M in accumulator A and decrement the value of register B by one.

    将累加器A中M的内容相加,并将寄存器B的值减1。

  4. Check if value of register B is 00 if yes then store result at memory location otherwise goto step 3.

    检查寄存器B的值是否为00(如果是),然后将结果存储在存储器位置,否则转到步骤3。

  5. 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位数字

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值