In assembly language 8086 we use mnemonics in order to perform arithmetic operations like in DIV/IDIV division.
So, Let's dive deep into what DIV and IDIV is ...
DIV:- It divides unsigned/signed double-word(32bit) by unsigned/signed word(16bit) .
IDIV:- It divides signed double-word(32bit) by signed word(16bit) .
DIV:- It divides unsigned/signed double-word(32bit) by unsigned/signed word(16bit) .
IDIV:- It divides signed double-word(32bit) by signed word(16bit) .
Signed 32/16 bit division:-
data segment
no1 dd 02h
no2 dw 03h
q dw ?
r dw ?
data ends
code segment
start : assume cs :code, ds :data
mov ax ,data
mov ds , ax
lea si , no1
mov ax, [ si ]
mov dx,[ si+2 ]
IDIV no2
mov q , ax
mov r , dx
mov ah ,4ch
int 21h
code ends
end start
Programs:-
For many other Assembly Language Programs related to microprocessor 8086 visit our BLOG
There are programs of largest ,smallest ,division ,multiplication,odd/even,block operation ,string operations,BCD ,et
No comments:
Post a Comment