addition

Assembly Program to add values using ADD instruction

ADD is keyword used for addition of two operands. It needs source and destination to perform its task. Both values are added, and answer is stored in the destination. Its syntax is as follows:

ADD destination, source

 

Destination can be a variable or register but it cannot be constant value. On the other hand, source can be a register, variable or constant value. As Assembly language is not case sensitive so “ADD” can be small or capital, it does not affect.  Examples are as follows:

  1. ADD DL, 5
  2. ADD AL, 3

 

An example of Assembly program for ADD is as follows:

.model small
.stack 100h
.data
.code
main proc
mov bl, 2
mov dl, 1
add dl, bl
add dl, 48
mov ah, 2
INT 21h
mov ah, 4ch
INT 21h

main endp
end main

1 Comment

  • Vitregu

    Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *