Problem – Write an assembly language program in 8086 microprocessor to divide a 16 bit number by an 8 bit number.
- Assign value 500 in SI and 600 in DI
- Move the contents of [SI] in
Problem – Write an assembly language program in 8086 microprocessor to divide a 16 bit number by an 8 bit number.
- Assign value 500 in SI and 600 in DI
- Move the contents of [SI] in BL and increment SI by 1
- Move the contents of [SI] and [SI + 1] in AX
- Use DIV instruction to divide AX by BL
- Move the contents of AX in [DI].
- Halt the program.
Assumption – Initial value of each segment register is 00000.
Calculation of physical memory address –
Memory Address = Segment Register * 10(H) + offset,
where Segment Register and Offset is decided on the basis of following table.
|Instruction fetching||Code Segment||Instruction Pointer|
|Data operation||Data Segment||Base Register [BX], Displacement [DISP]|
|Stack operation||Stack Segment||Stack Pointer (SP), Base Pointer (BP)|
|String as a source||Data Segment||Source Indexed (SI)|
|String as a destination||Extra 