assume cs:code,ds:data
data segment
org 2000h
num1 dw 1234h
num2 dw 2345h
product dw 2d dup(0h)
data ends
code segment
start:mov ax,data
mov ds,ax
mov ax,num1
mul num2
mov product,ax
mov product+2,dx
mov ah,4ch
int 21h
code ends
end start
assume is the preprocessor directive . and we are using two segment registers one is code segment and second is the data segment register.
data segment contains the all initialization s like the starting address of the program. and the variables used and the data type of those variables. product dw 2d dup(0h) specifies the processor to load the variable memory location with the zeros.
next code segment contains the executable code which performs the desired action. the result of the multiplication is stored in the ax register automatically. mov ax,data loads the startin address of the data segment in the ax register. mov ds,ax set thememory location as the variable ds. load the number one into the ax register. and then directly multiply the content of the ax with num2. the result is stored in the ax register. then move the result into the variable product. at the endint 21h is the interrupt to the processor.
data segment
org 2000h
num1 dw 1234h
num2 dw 2345h
product dw 2d dup(0h)
data ends
code segment
start:mov ax,data
mov ds,ax
mov ax,num1
mul num2
mov product,ax
mov product+2,dx
mov ah,4ch
int 21h
code ends
end start
assume is the preprocessor directive . and we are using two segment registers one is code segment and second is the data segment register.
data segment contains the all initialization s like the starting address of the program. and the variables used and the data type of those variables. product dw 2d dup(0h) specifies the processor to load the variable memory location with the zeros.
next code segment contains the executable code which performs the desired action. the result of the multiplication is stored in the ax register automatically. mov ax,data loads the startin address of the data segment in the ax register. mov ds,ax set thememory location as the variable ds. load the number one into the ax register. and then directly multiply the content of the ax with num2. the result is stored in the ax register. then move the result into the variable product. at the endint 21h is the interrupt to the processor.
could you explain it in detail..
ReplyDelete