In: Computer Science
Please use assembly language x86 Visual Studio
Write a program to add the following word size numbers:15F2, 9E89, 8342, 99FF, 7130 using adc instruction and a loop. The result must be in DX, AX. Show the result in debug window.
Answer:-
Code:
.model small
.data
numb dw 15F2H
dw 9E89H
number dw 8342H
dw 99FFH
dw 7130H
ans dw 0,0,0,0
.code
mov ax,@data
mov ds,ax
mov ax,numb
mul number
mov ans,ax
mov ans+2,dx
mov ax,numb+2
mul number
add ans+2,ax
adc ans+4,dx
adc ans+6,0
mov ax,numb
mul number+2
add ans+2,ax
adc ans+4,dx
adc ans+6,0
mov ax,numb+2
mul number+2
add ans+4,ax
adc ans+6,dx
mov ax,4C00h
int 21h
end
Screenshot:
I have tried to explain it in very simple language and
I hope that i have answered your question satisfactorily.Leave
doubts in comment section if any.