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:
算法:
Assign value 500 in SI and 600 in DI
在SI中分配值500在DI中分配值600
Move the contents of [SI] in BL and increment SI by 1
移动BL中[SI]的内容并将SI递增1
Move the contents of [SI] and [SI + 1] in AX
在AX中移动[SI]和[SI + 1]的内容
Use DIV instruction to divide AX by BL
使用DIV指令将AX除以BL
Move the contents of AX in [DI].
在[DI]中移动AX的内容。
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:
程序:
ADDRESS | MNEMONICS | COMMENTS |
---|---|---|
0400 | MOV SI, 500 | SI |
0403 | MOV DI, 600 | DI |
0406 | MOV BL, [SI] | BL |
0408 | INC SI | SI |
0409 | MOV AX, [SI] | AX |
040B | DIV BL | AX |
040D | MOV [DI], AX | [DI] |
040F | HLT | End 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
MOV SI, 500 assigns 500 to SI
MOV SI ,500将500分配给SI
MOV DI, 600 assigns 600 to DI
MOV DI ,600将600分配给DI
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中
INC SI increment the content of SI by 1
INC SI将SI的内容增加1
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中
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中
MOV [DI], AX moves the content of AX to [DI]
MOV [DI] ,AX将AX的内容移至[DI]
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