SlideShare ist ein Scribd-Unternehmen logo
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:
MOV AL,25h
MOV BL,34h
ADD AL,BL AL= 25H +34H
AL=59H BL=34H
By: Jawaher A. Fadhil Computer Science Dept.
Example#2
Write the Assembly language instructions to add the values
6BH and A8H. Place the result in register AX?
MOV AX,0000
MOV AL,6BH
ADD AL,A8
By: Jawaher A. Fadhil Computer Science Dept.
AL=AL+A8
6 B
+
A 8
HEX
0
1
2
.
.
9
A
B
C
D
E
F
10
11
12
13
14
15
16
3
1
1 1
AX= 00 13CF= 1
Example#2
Write the Assembly language instructions to add the values
6BH and A8H. Place the result in register AX?
MOV AX,0000
MOV AL,6BH
ADD AX,A8
By: Jawaher A. Fadhil Computer Science Dept.
AX=AL+A8
6 B
+
A 8
3
1
1 1
AX= 01 13
CF= 0
By: Jawaher A. Fadhil Computer Science Dept.
Add instruction-part1

Weitere ähnliche Inhalte

Ähnlich wie Add instruction-part1

MPMC UNIT-2.pdf
MPMC UNIT-2.pdfMPMC UNIT-2.pdf
MPMC UNIT-2.pdf
RAHUL RANJAN
 
Chapter 7
Chapter 7Chapter 7
4bit PC report
4bit PC report4bit PC report
4bit PC report
tanvin
 
4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]
shibbirtanvin
 
Memory reference
Memory referenceMemory reference
Memory reference
rajshreemuthiah
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
Dilum Bandara
 
CH-3 CO-all-about-operating-system(Update).pptx
CH-3 CO-all-about-operating-system(Update).pptxCH-3 CO-all-about-operating-system(Update).pptx
CH-3 CO-all-about-operating-system(Update).pptx
XyzXyz338506
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Bilal Amjad
 
Central processor organization
Central processor organizationCentral processor organization
Central processor organization
Prof. Dr. K. Adisesha
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
Aiman Hud
 
Floating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGAFloating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGA
Azhar Syed
 
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed controlB.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
Rai University
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
Education Front
 
Compreport
CompreportCompreport
Compreport
xdarlord
 
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed controlBca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
Rai University
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085
shiji v r
 
Instruction set class
Instruction set   classInstruction set   class
Instruction set class
shiji v r
 
MIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptxMIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptx
JEEVANANTHAMG6
 
Addressing Modes of 8051.pptx
Addressing Modes of 8051.pptxAddressing Modes of 8051.pptx
Addressing Modes of 8051.pptx
TumkurInfomedia
 
Algorithm manual
Algorithm manualAlgorithm manual
Algorithm manual
EfendyMasuli
 

Ähnlich wie Add instruction-part1 (20)

MPMC UNIT-2.pdf
MPMC UNIT-2.pdfMPMC UNIT-2.pdf
MPMC UNIT-2.pdf
 
Chapter 7
Chapter 7Chapter 7
Chapter 7
 
4bit PC report
4bit PC report4bit PC report
4bit PC report
 
4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]4bit pc report[cse 08-section-b2_group-02]
4bit pc report[cse 08-section-b2_group-02]
 
Memory reference
Memory referenceMemory reference
Memory reference
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
CH-3 CO-all-about-operating-system(Update).pptx
CH-3 CO-all-about-operating-system(Update).pptxCH-3 CO-all-about-operating-system(Update).pptx
CH-3 CO-all-about-operating-system(Update).pptx
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
Central processor organization
Central processor organizationCentral processor organization
Central processor organization
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Floating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGAFloating point ALU using VHDL implemented on FPGA
Floating point ALU using VHDL implemented on FPGA
 
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed controlB.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
Compreport
CompreportCompreport
Compreport
 
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed controlBca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
 
Instruction set of 8085
Instruction set  of 8085Instruction set  of 8085
Instruction set of 8085
 
Instruction set class
Instruction set   classInstruction set   class
Instruction set class
 
MIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptxMIPS IMPLEMENTATION.pptx
MIPS IMPLEMENTATION.pptx
 
Addressing Modes of 8051.pptx
Addressing Modes of 8051.pptxAddressing Modes of 8051.pptx
Addressing Modes of 8051.pptx
 
Algorithm manual
Algorithm manualAlgorithm manual
Algorithm manual
 

Mehr von Jawaher Abdulwahab Fadhil

Binary adder
Binary adderBinary adder
Number system
Number systemNumber system
Dealing with 8086 memory
Dealing with 8086 memoryDealing with 8086 memory
Dealing with 8086 memory
Jawaher Abdulwahab Fadhil
 
MOV instruction part1
MOV  instruction part1MOV  instruction part1
MOV instruction part1
Jawaher Abdulwahab Fadhil
 
Cisco webex installation guide
Cisco webex installation guideCisco webex installation guide
Cisco webex installation guide
Jawaher Abdulwahab Fadhil
 
A survey on the applications of smart home
A survey on the applications of smart homeA survey on the applications of smart home
A survey on the applications of smart home
Jawaher Abdulwahab Fadhil
 
Flag register and add instruction
Flag register and  add instructionFlag register and  add instruction
Flag register and add instruction
Jawaher Abdulwahab Fadhil
 
Computer Organization -part 1
Computer Organization -part 1Computer Organization -part 1
Computer Organization -part 1
Jawaher Abdulwahab Fadhil
 
iOS Operating System
iOS Operating SystemiOS Operating System
iOS Operating System
Jawaher Abdulwahab Fadhil
 
Android Operating system
Android Operating systemAndroid Operating system
Android Operating system
Jawaher Abdulwahab Fadhil
 
Types of Mobile Applications
Types of Mobile ApplicationsTypes of Mobile Applications
Types of Mobile Applications
Jawaher Abdulwahab Fadhil
 
Ultrasonic with buzzer
Ultrasonic with buzzerUltrasonic with buzzer
Ultrasonic with buzzer
Jawaher Abdulwahab Fadhil
 
Lecture6 modulation
Lecture6 modulationLecture6 modulation
Lecture6 modulation
Jawaher Abdulwahab Fadhil
 
Lecture 5: The Convolution Sum
Lecture 5: The Convolution SumLecture 5: The Convolution Sum
Lecture 5: The Convolution Sum
Jawaher Abdulwahab Fadhil
 
Lecture 4: Classification of system
Lecture 4: Classification of system Lecture 4: Classification of system
Lecture 4: Classification of system
Jawaher Abdulwahab Fadhil
 
Lecture3: Operations of Ct signals
Lecture3: Operations of Ct signalsLecture3: Operations of Ct signals
Lecture3: Operations of Ct signals
Jawaher Abdulwahab Fadhil
 
Lecture2 : Common continuous time signals
Lecture2 : Common continuous time signalsLecture2 : Common continuous time signals
Lecture2 : Common continuous time signals
Jawaher Abdulwahab Fadhil
 
Lecture1: Introduction to signals
Lecture1: Introduction to signalsLecture1: Introduction to signals
Lecture1: Introduction to signals
Jawaher Abdulwahab Fadhil
 
Arduino- Serial communication
Arduino-  Serial communicationArduino-  Serial communication
Arduino- Serial communication
Jawaher Abdulwahab Fadhil
 
Arduino based Applications-part 6
Arduino based Applications-part 6Arduino based Applications-part 6
Arduino based Applications-part 6
Jawaher Abdulwahab Fadhil
 

Mehr von Jawaher Abdulwahab Fadhil (20)

Binary adder
Binary adderBinary adder
Binary adder
 
Number system
Number systemNumber system
Number system
 
Dealing with 8086 memory
Dealing with 8086 memoryDealing with 8086 memory
Dealing with 8086 memory
 
MOV instruction part1
MOV  instruction part1MOV  instruction part1
MOV instruction part1
 
Cisco webex installation guide
Cisco webex installation guideCisco webex installation guide
Cisco webex installation guide
 
A survey on the applications of smart home
A survey on the applications of smart homeA survey on the applications of smart home
A survey on the applications of smart home
 
Flag register and add instruction
Flag register and  add instructionFlag register and  add instruction
Flag register and add instruction
 
Computer Organization -part 1
Computer Organization -part 1Computer Organization -part 1
Computer Organization -part 1
 
iOS Operating System
iOS Operating SystemiOS Operating System
iOS Operating System
 
Android Operating system
Android Operating systemAndroid Operating system
Android Operating system
 
Types of Mobile Applications
Types of Mobile ApplicationsTypes of Mobile Applications
Types of Mobile Applications
 
Ultrasonic with buzzer
Ultrasonic with buzzerUltrasonic with buzzer
Ultrasonic with buzzer
 
Lecture6 modulation
Lecture6 modulationLecture6 modulation
Lecture6 modulation
 
Lecture 5: The Convolution Sum
Lecture 5: The Convolution SumLecture 5: The Convolution Sum
Lecture 5: The Convolution Sum
 
Lecture 4: Classification of system
Lecture 4: Classification of system Lecture 4: Classification of system
Lecture 4: Classification of system
 
Lecture3: Operations of Ct signals
Lecture3: Operations of Ct signalsLecture3: Operations of Ct signals
Lecture3: Operations of Ct signals
 
Lecture2 : Common continuous time signals
Lecture2 : Common continuous time signalsLecture2 : Common continuous time signals
Lecture2 : Common continuous time signals
 
Lecture1: Introduction to signals
Lecture1: Introduction to signalsLecture1: Introduction to signals
Lecture1: Introduction to signals
 
Arduino- Serial communication
Arduino-  Serial communicationArduino-  Serial communication
Arduino- Serial communication
 
Arduino based Applications-part 6
Arduino based Applications-part 6Arduino based Applications-part 6
Arduino based Applications-part 6
 

Kürzlich hochgeladen

How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
Chevonnese Chevers Whyte, MBA, B.Sc.
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
dot55audits
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
spdendr
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 

Kürzlich hochgeladen (20)

How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
Constructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective CommunicationConstructing Your Course Container for Effective Communication
Constructing Your Course Container for Effective Communication
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 

Add instruction-part1

  • 1. ADD instructions Part #1 University of Duhok, Computer Science Dept.
  • 2. 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.
  • 3. • 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.
  • 4. Example#1 To add two numbers such as 25H and 34H, each can be moved to a register and then added together: MOV AL,25h MOV BL,34h ADD AL,BL AL= 25H +34H AL=59H BL=34H By: Jawaher A. Fadhil Computer Science Dept.
  • 5. Example#2 Write the Assembly language instructions to add the values 6BH and A8H. Place the result in register AX? MOV AX,0000 MOV AL,6BH ADD AL,A8 By: Jawaher A. Fadhil Computer Science Dept. AL=AL+A8 6 B + A 8 HEX 0 1 2 . . 9 A B C D E F 10 11 12 13 14 15 16 3 1 1 1 AX= 00 13CF= 1
  • 6.
  • 7. Example#2 Write the Assembly language instructions to add the values 6BH and A8H. Place the result in register AX? MOV AX,0000 MOV AL,6BH ADD AX,A8 By: Jawaher A. Fadhil Computer Science Dept. AX=AL+A8 6 B + A 8 3 1 1 1 AX= 01 13 CF= 0
  • 8. By: Jawaher A. Fadhil Computer Science Dept.