Add instruction in Assembly programming with examples:
video link: https://www.youtube.com/watch?v=LtYX_pkWghE&feature=youtu.be
Size: 266.45 KB
Language: en
Added: May 21, 2020
Slides: 9 pages
Slide Content
ADD instructions
Part #1
University of Duhok,
Computer Science Dept.
ADD instruction
The ADD instruction has the following format:
ADD destination,source
The ADD instruction tells the CPU to add the source and the
destination operands and put the result in the destination.
Destination = Destination + Source
• The destination operand can be a register or a memory location.
•The source operand can be an immediate, a register, or a memory
location.
By: Jawaher A. Fadhil Computer Science Dept.
•Two memory operands cannot be used in one instruction.
• When an immediate value is used as an operand, it is sign-
extended to the length of the destination operand format.
ADD AL,1355H
ADD instruction
ADD [500],[502]
By: Jawaher A. Fadhil Computer Science Dept.
Example#1
To add two numbers such as 25H and 34H, each can be
moved to a register and then added together: