mysql 数字除以100_用16位数字除以8位数字| 8086微处理器

mysql 数字除以100

Problem statement:

问题陈述:

Write an assembly language program in 8086 microprocessor to divide a 16 bit number by an 8 bit number.

在8086微处理器中编写汇编语言程序,将16位数字除以8位数字。

Algorithm:

算法:

  1. Assign value 500 in SI and 600 in DI

    在SI中分配值500在DI中分配值600

  2. Move the contents of [SI] in BL and increment SI by 1

    移动BL中[SI]的内容并将SI递增1

  3. Move the contents of [SI] and [SI + 1] in AX

    在AX中移动[SI]和[SI + 1]的内容

  4. Use DIV instruction to divide AX by BL

    使用DIV指令将AX除以BL

  5. Move the contents of AX in [DI].

    在[DI]中移动AX的内容。

  6. Stop the program.

    停止程序。

Assumption: Initial value of each segment register is 00000.

假设:每个段寄存器的初始值为00000。

Calculation of physical memory address: Memory Address = Segment Register * 10(H) + offset,

物理内存地址的计算:内存地址=段寄存器* 10(H)+偏移量,

Program:

程序:

ADDRESSMNEMONICSCOMMENTS
0400MOV SI, 500SI
0403MOV DI, 600DI
0406MOV BL, [SI]BL
0408INC SISI
0409MOV AX, [SI]AX
040BDIV BLAX
040DMOV [DI], AX[DI]
040FHLTEnd of program
地址 记忆 注释
0400 MOV SI,500 SI
0403 MOV DI,600 DI
0406 MOV BL,[SI] BL
0408 INC SI SI
0409 MOV AX,[SI] 斧头
040B DIV BL 斧头
040D MOV [DI],AX [DI]
040F HLT 程序结束

Explanation: Registers used AX, BL, SI, DI

说明:使用的寄存器AX,BL,SI,DI

  1. MOV SI, 500 assigns 500 to SI

    MOV SI ,500将500分配给SI

  2. MOV DI, 600 assigns 600 to DI

    MOV DI ,600将600分配给DI

  3. MOV BL, [SI] moves the content of [SI] to BL register i.e. value of divisor will be stored in BL

    MOV BL ,[SI]将[SI]的内容移至BL寄存器,即除数的值将存储在BL中

  4. INC SI increment the content of SI by 1

    INC SISI的内容增加1

  5. MOV AX, [SI] moves the content of [SI] and [SI + 1] to AX register i.e. value of dividend will be stored in AX

    MOV AX ,[SI]将[SI]和[SI + 1]的内容移至AX寄存器,即,股息值将存储在AX中

  6. DIV BL divide the content of AX by BL, after execution of this instruction the quotient get stored in AL and remainder in AH

    DIV BL将AX的内容除以BL,执行此指令后,商将存储在AL中,余数存储在AH中

  7. MOV [DI], AX moves the content of AX to [DI]

    MOV [DI] ,AX将AX的内容移至[DI]

  8. HLT stops executing the program and halts any further execution

    HLT停止执行程序,并停止任何进一步的执行

翻译自: https://www.includehelp.com/embedded-system/divide-a-16-bits-number-by-an-8-bits-number.aspx

mysql 数字除以100

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值