5 Using Assembly Language answer the following questions 5 W
#5 Using Assembly Language answer the following questions
5. Write a macro that divide a number by any number in power of two and store the result in the memory location.Solution
mov bx,#numberdivisor % number to be divided
mov cl,#numberpower %number in the power of 2
mov ax,#2 % moving 2 in ax
mov dx,ax
loop:mul dx % mulplying 2 number of times specified at the power the reeult will be in the ax
djnz cl,loop % when the count is zero
mov dx,ax % getting the divisior into ax and then divide with the multiplied result
mov ax,bx
div dx
mov 2000h,ax
ret

