SlideShare a Scribd company logo
1 of 20
1
2
A FEW BASICA FEW BASIC
INSTRUCTIONSINSTRUCTIONS
Presented By
Contents
There are over a hundred instructions in
the instruction set for the 8086 CPU.
Here we discuss 7 of the most useful
instructions for transferring data and
doing arithmetic.
The discussed instructions are……..
MOV,XCHG,ADD,SUB,INC,DEC,NEG.
5
IntroductionIntroduction
MOVMOV
 Transfer data
◦ Between registers
◦ Between register and a memory location
◦ Move a no. directly to a register or a
memory location
 Syntax
MOV destination, source
 Example
MOV AX, WORD1
6
How?
XCHG
 Exchange the contents of
◦ Two registers
◦ Register and a memory location
 Syntax
XCHG destination, source
 Example
XCHG AH, BL
7
AL
BL
00 1A
05 00
AH AL
BH BL
How?
Legal Combinations of Operands forLegal Combinations of Operands for
MOV And XCHGMOV And XCHG
Destina
tion
Operan
d
Source
Opera
nd
Legal
General
Register
General
Register
YES
General
Register
Memory
Locatio
n
YES
Memory
Location
General
Register
YES
Memory
Location
Memory
Locatio
n
NO
Destination
Operand
Source
Operand
Legal
General
Register
General
Register
YES
General
Register
Memory
Location
YES
General
Register
Segment
Register
YES
General
Register
Constant YES
Memory
Location
General
Register
YES
Memory
Location
Memory
Location
NO
Memory
Location
Segment
Register
YES
Memory Constant YES
MOV
XCHG
ADD InstructionADD Instruction
To add contents of:
◦ Two registers
◦ A register and a memory location
◦ A number to a register
◦ A number to a memory location
Example
ADD WORD1, AX
9
How?
SUB InstructionSUB Instruction
To subtract the contents of:
◦ Two registers
◦ A register and a memory location
◦ A number from a register
◦ A number from a memory location
 Example
SUB AX, DX
10
How?
Legal Combinations of Operands forLegal Combinations of Operands for
ADD & SUB instructionsADD & SUB instructions
11
Destination Operand Source Operand Legal
General Register General Register YES
General Register Memory Location YES
General Register Constant YES
Memory Location General Register YES
Memory Location Memory Location NO
Memory Location Constant YES
INC & DECINC & DEC
 INC (increment) instruction is used to add 1 to
the contents of a register or memory location.
◦ Syntax: INC destination
◦ Example: INC WORD1
 DEC (decrement) instruction is used to subtract 1
from the contents of a register or memory
location.
◦ Syntax: DEC destination
◦ Example: DEC BYTE1
12
Destination can be 8-bit or 16-bits wide.
Destination can be a register or a memory
location.
13
INC WORD1
DEC BYTE1
INC & DECINC & DEC
How?
How?
NEGNEG
 Used to negate the contents of destination.
 Replace the contents by its 2’s complement.
 Syntax:
NEG destination
 Example:
NEG BX
14How?
ExamplesExamples
 Consider instructions: MOV, ADD, SUB,
INC, DEC, NEG
 A and B are two word variables
 Translate statements into assembly language:
15
Statement Translation
A =-( A+1)
MOV AX,A
INC AX
NEG AX
MOV A,AX
B= 3B-7
MOV AX,B
ADD AX,B
ADD AX,B
SUB AX,7
MOV B,AX
Example:1
Example:2
Statem
ent
Translation
A = B –
A-1
MOV AX,B
SUB AX,A
DEC AX
MOV A,AX
Example:3
16
ApplicationApplication
.data
msg1 DB 'Input Any number From
1 To 9:$' ; Data segment
msg2 DB 'The Series Summation
Is:$'
.code
main proc
mov AX,@DATA ; Data
segment
mov DS,AX
lea dx,msg1 ;showing
msg1
mov ah,9
int 21h
mov ah,1 ;taking input
int 21h
xor ah,ah
sub al,30h
XOR CX,CX ;loop same as
input
mov cx,ax
XOR bx,bx
## A series
summation
of n numbers
where
1<=n<=9
17
sub bx,0Ah
add ax,1 ;counter=ax=3
CMP bx ,39h ;bx<39h
JL DISPLAY
sub bx,0Ah
add ax,1 ;counter=ax=4
CMP bx ,39h ;bx<39h
JL DISPLAY
DISPLAY:
add al,30h
mov cl,al
lea dx,msg2 ;showing msg2
mov ah,9
int 21h
mov ah,2
mov dl,cl
int 21h
mov dl,bl
int 21h
ApplicationApplication
TOP:
add bx,cx ;adding
LOOP TOP
mov ah,2
mov dl,0Dh
int 21h ;printing new
line
mov dl,0Ah
int 21h
xor ax,ax
add bx,30h
CMP bx ,39h ;bx<39h
JL DISPLAY
sub bx,0Ah
add ax,1 ;counter=ax=1
CMP bx ,39h ;bx<39h
JL DISPLAY
sub bx,0Ah
add ax,1 ;counter=ax=2
CMP bx ,39h ;bx<39h
JL DISPLAY
18
? ?
<
Assembly

More Related Content

What's hot

1327 Addressing Modes Of 8086
1327 Addressing Modes Of 80861327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086techbed
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
 
Backus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal FormsBackus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal FormsAshutosh Pandey
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly languageMir Majid
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programmingKartik Sharma
 
10 8086 instruction set
10 8086 instruction set10 8086 instruction set
10 8086 instruction setShivam Singhal
 
8086 arch instns
8086 arch instns8086 arch instns
8086 arch instnsRam Babu
 
Pack/Unpack: manipulate binary data
Pack/Unpack: manipulate binary dataPack/Unpack: manipulate binary data
Pack/Unpack: manipulate binary dataLambert Lum
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorAshita Agrawal
 
Instructionset8085
Instructionset8085Instructionset8085
Instructionset8085Fawad Pathan
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086aviban
 
Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programmingKartik Sharma
 
Fixed Field Values By Horizon Name
Fixed Field Values By Horizon NameFixed Field Values By Horizon Name
Fixed Field Values By Horizon NameLowell Ashley
 
instruction set of 8086
instruction set of 8086instruction set of 8086
instruction set of 8086muneer.k
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086Akhila Rahul
 

What's hot (20)

1327 Addressing Modes Of 8086
1327 Addressing Modes Of 80861327 Addressing Modes Of 8086
1327 Addressing Modes Of 8086
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Assembly Language -I
Assembly Language -IAssembly Language -I
Assembly Language -I
 
Backus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal FormsBackus Naur and Chomsky Normal Forms
Backus Naur and Chomsky Normal Forms
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly language
 
Unit 3 – assembly language programming
Unit 3 – assembly language programmingUnit 3 – assembly language programming
Unit 3 – assembly language programming
 
10 8086 instruction set
10 8086 instruction set10 8086 instruction set
10 8086 instruction set
 
8086 arch instns
8086 arch instns8086 arch instns
8086 arch instns
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
Pack/Unpack: manipulate binary data
Pack/Unpack: manipulate binary dataPack/Unpack: manipulate binary data
Pack/Unpack: manipulate binary data
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
8086 add mod
8086 add mod8086 add mod
8086 add mod
 
8086 instruction set
8086 instruction set8086 instruction set
8086 instruction set
 
Instructionset8085
Instructionset8085Instructionset8085
Instructionset8085
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programming
 
Fixed Field Values By Horizon Name
Fixed Field Values By Horizon NameFixed Field Values By Horizon Name
Fixed Field Values By Horizon Name
 
instruction set of 8086
instruction set of 8086instruction set of 8086
instruction set of 8086
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
8085 is details
8085 is details8085 is details
8085 is details
 

Viewers also liked

Assembly Language Lecture 2
Assembly Language Lecture 2Assembly Language Lecture 2
Assembly Language Lecture 2Motaz Saad
 
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6Thanawat Boontan
 
Sweet spot
Sweet spotSweet spot
Sweet spott7260678
 
Cat p5 diary power point
Cat p5 diary power pointCat p5 diary power point
Cat p5 diary power pointTLeeTSIS
 
Enhancing employability through enterprise education - Maureen Tibby
Enhancing employability through enterprise education - Maureen TibbyEnhancing employability through enterprise education - Maureen Tibby
Enhancing employability through enterprise education - Maureen TibbyHEA_AH
 
World Usability Day 2014 - David Lai — Stakeholders!
World Usability Day 2014 - David Lai — Stakeholders!World Usability Day 2014 - David Lai — Stakeholders!
World Usability Day 2014 - David Lai — Stakeholders!UXPALA
 
Effecive Project Management Leadership as a Project Success
Effecive Project Management Leadership as a Project SuccessEffecive Project Management Leadership as a Project Success
Effecive Project Management Leadership as a Project SuccessSam muwanei
 
Engagement through partnership: students as partners in learning and teaching...
Engagement through partnership: students as partners in learning and teaching...Engagement through partnership: students as partners in learning and teaching...
Engagement through partnership: students as partners in learning and teaching...HEA_AH
 
Zasięg blogosfery w Polsce
Zasięg blogosfery w PolsceZasięg blogosfery w Polsce
Zasięg blogosfery w Polsceblogifirmowe.com
 
ANC 1C presentation-Kalorama Park Plaza-Dec 3 2014
ANC 1C presentation-Kalorama Park Plaza-Dec 3 2014ANC 1C presentation-Kalorama Park Plaza-Dec 3 2014
ANC 1C presentation-Kalorama Park Plaza-Dec 3 2014Cynthia Pols
 
Nandan’s Diary - 18 November 2014
Nandan’s Diary - 18 November 2014Nandan’s Diary - 18 November 2014
Nandan’s Diary - 18 November 2014TLeeTSIS
 
Storyboard First Draft
Storyboard First DraftStoryboard First Draft
Storyboard First Draftkatyevans25
 
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6Thanawat Boontan
 

Viewers also liked (19)

Assembly Language Lecture 2
Assembly Language Lecture 2Assembly Language Lecture 2
Assembly Language Lecture 2
 
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6
 
DP UMROH 3,5 JT
DP UMROH 3,5 JTDP UMROH 3,5 JT
DP UMROH 3,5 JT
 
Sweet spot
Sweet spotSweet spot
Sweet spot
 
Cat p5 diary power point
Cat p5 diary power pointCat p5 diary power point
Cat p5 diary power point
 
Enhancing employability through enterprise education - Maureen Tibby
Enhancing employability through enterprise education - Maureen TibbyEnhancing employability through enterprise education - Maureen Tibby
Enhancing employability through enterprise education - Maureen Tibby
 
World Usability Day 2014 - David Lai — Stakeholders!
World Usability Day 2014 - David Lai — Stakeholders!World Usability Day 2014 - David Lai — Stakeholders!
World Usability Day 2014 - David Lai — Stakeholders!
 
EFFECT OF ILLUMINATION INTENSITY ON THE PERFORMANCE OF PHOTOELECTRO CHEMICAL ...
EFFECT OF ILLUMINATION INTENSITY ON THE PERFORMANCE OF PHOTOELECTRO CHEMICAL ...EFFECT OF ILLUMINATION INTENSITY ON THE PERFORMANCE OF PHOTOELECTRO CHEMICAL ...
EFFECT OF ILLUMINATION INTENSITY ON THE PERFORMANCE OF PHOTOELECTRO CHEMICAL ...
 
Effecive Project Management Leadership as a Project Success
Effecive Project Management Leadership as a Project SuccessEffecive Project Management Leadership as a Project Success
Effecive Project Management Leadership as a Project Success
 
лямблиоз
лямблиозлямблиоз
лямблиоз
 
вгв+д
вгв+двгв+д
вгв+д
 
Engagement through partnership: students as partners in learning and teaching...
Engagement through partnership: students as partners in learning and teaching...Engagement through partnership: students as partners in learning and teaching...
Engagement through partnership: students as partners in learning and teaching...
 
Zasięg blogosfery w Polsce
Zasięg blogosfery w PolsceZasięg blogosfery w Polsce
Zasięg blogosfery w Polsce
 
MUET
MUETMUET
MUET
 
ANC 1C presentation-Kalorama Park Plaza-Dec 3 2014
ANC 1C presentation-Kalorama Park Plaza-Dec 3 2014ANC 1C presentation-Kalorama Park Plaza-Dec 3 2014
ANC 1C presentation-Kalorama Park Plaza-Dec 3 2014
 
Nandan’s Diary - 18 November 2014
Nandan’s Diary - 18 November 2014Nandan’s Diary - 18 November 2014
Nandan’s Diary - 18 November 2014
 
Storyboard First Draft
Storyboard First DraftStoryboard First Draft
Storyboard First Draft
 
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6
ข้อสอบการงานอาชีพและเทคโนโลยี O-net ม.6
 
RMCN Credentials
RMCN CredentialsRMCN Credentials
RMCN Credentials
 

Similar to Assembly

Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language BasicsEducation Front
 
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
 
4. Instruction Set Of MP 8085.pptx
4. Instruction Set Of MP 8085.pptx4. Instruction Set Of MP 8085.pptx
4. Instruction Set Of MP 8085.pptxISMT College
 
Types of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessorTypes of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessorsamarthpawar9890
 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptssuserb448e2
 
Intel8086_Flags_Addr_Modes_sample_pgms.pdf
Intel8086_Flags_Addr_Modes_sample_pgms.pdfIntel8086_Flags_Addr_Modes_sample_pgms.pdf
Intel8086_Flags_Addr_Modes_sample_pgms.pdfAnonymous611358
 
itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085Shifali Sharma
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085saleForce
 
Microprocessor system - summarize
Microprocessor system - summarizeMicroprocessor system - summarize
Microprocessor system - summarizeHisham Mat Hussin
 
Chap 3_2.ppt
Chap 3_2.pptChap 3_2.ppt
Chap 3_2.pptinian2
 
Https _doc-0o-c4-apps-viewer.googleusercontent
Https  _doc-0o-c4-apps-viewer.googleusercontent Https  _doc-0o-c4-apps-viewer.googleusercontent
Https _doc-0o-c4-apps-viewer.googleusercontent vijaydeepakg
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction setStefan Oprea
 
8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONSRamaPrabha24
 
Introduction to Assembly Language & various basic things
Introduction to Assembly Language & various basic thingsIntroduction to Assembly Language & various basic things
Introduction to Assembly Language & various basic thingsishitasabrincse
 

Similar to Assembly (20)

Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
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 ...
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 
4. Instruction Set Of MP 8085.pptx
4. Instruction Set Of MP 8085.pptx4. Instruction Set Of MP 8085.pptx
4. Instruction Set Of MP 8085.pptx
 
8085 Instructions.pdf
8085 Instructions.pdf8085 Instructions.pdf
8085 Instructions.pdf
 
Lecture5
Lecture5Lecture5
Lecture5
 
Lecture5(1)
Lecture5(1)Lecture5(1)
Lecture5(1)
 
Types of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessorTypes of instruction in 8085 microprocessor
Types of instruction in 8085 microprocessor
 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).ppt
 
Intel8086_Flags_Addr_Modes_sample_pgms.pdf
Intel8086_Flags_Addr_Modes_sample_pgms.pdfIntel8086_Flags_Addr_Modes_sample_pgms.pdf
Intel8086_Flags_Addr_Modes_sample_pgms.pdf
 
itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
 
Microprocessor system - summarize
Microprocessor system - summarizeMicroprocessor system - summarize
Microprocessor system - summarize
 
Chap 3_2.ppt
Chap 3_2.pptChap 3_2.ppt
Chap 3_2.ppt
 
Coal (1)
Coal (1)Coal (1)
Coal (1)
 
Https _doc-0o-c4-apps-viewer.googleusercontent
Https  _doc-0o-c4-apps-viewer.googleusercontent Https  _doc-0o-c4-apps-viewer.googleusercontent
Https _doc-0o-c4-apps-viewer.googleusercontent
 
8051 instruction set
8051 instruction set8051 instruction set
8051 instruction set
 
8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS
 
Introduction to Assembly Language & various basic things
Introduction to Assembly Language & various basic thingsIntroduction to Assembly Language & various basic things
Introduction to Assembly Language & various basic things
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 

More from Umme habiba

Compiler lab final report writing
Compiler lab final report writingCompiler lab final report writing
Compiler lab final report writingUmme habiba
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking systemUmme habiba
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking systemUmme habiba
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking systemUmme habiba
 
Accounting adjusting
Accounting adjustingAccounting adjusting
Accounting adjustingUmme habiba
 
Economic.assignment
Economic.assignmentEconomic.assignment
Economic.assignmentUmme habiba
 
Major economic problems of bangladesh
Major economic problems of bangladeshMajor economic problems of bangladesh
Major economic problems of bangladeshUmme habiba
 
Overview of various types of operating system
Overview of various types of operating systemOverview of various types of operating system
Overview of various types of operating systemUmme habiba
 
Os lab report(shell coding)
Os lab report(shell coding)Os lab report(shell coding)
Os lab report(shell coding)Umme habiba
 
Ecommerce(online Shopping)
Ecommerce(online Shopping)Ecommerce(online Shopping)
Ecommerce(online Shopping)Umme habiba
 
Different types of Addressing.cao
Different types of Addressing.caoDifferent types of Addressing.cao
Different types of Addressing.caoUmme habiba
 
2nd generation of computer
2nd generation of computer2nd generation of computer
2nd generation of computerUmme habiba
 
Art_of_living assignment
Art_of_living assignmentArt_of_living assignment
Art_of_living assignmentUmme habiba
 
Informationsecurity
InformationsecurityInformationsecurity
InformationsecurityUmme habiba
 
SQL Joinning.Database
SQL Joinning.DatabaseSQL Joinning.Database
SQL Joinning.DatabaseUmme habiba
 
WLAN of networking.ppt
WLAN of networking.pptWLAN of networking.ppt
WLAN of networking.pptUmme habiba
 
simpson's in numerical method
simpson's in numerical methodsimpson's in numerical method
simpson's in numerical methodUmme habiba
 
Error detection in Data comunication
 Error detection in Data comunication Error detection in Data comunication
Error detection in Data comunicationUmme habiba
 
microsoft word & powerpoint
 microsoft word & powerpoint microsoft word & powerpoint
microsoft word & powerpointUmme habiba
 

More from Umme habiba (20)

Compiler lab final report writing
Compiler lab final report writingCompiler lab final report writing
Compiler lab final report writing
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking system
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking system
 
online bus ticket booking system
online bus ticket booking systemonline bus ticket booking system
online bus ticket booking system
 
Accounting adjusting
Accounting adjustingAccounting adjusting
Accounting adjusting
 
Economic.assignment
Economic.assignmentEconomic.assignment
Economic.assignment
 
Major economic problems of bangladesh
Major economic problems of bangladeshMajor economic problems of bangladesh
Major economic problems of bangladesh
 
Overview of various types of operating system
Overview of various types of operating systemOverview of various types of operating system
Overview of various types of operating system
 
Os lab report(shell coding)
Os lab report(shell coding)Os lab report(shell coding)
Os lab report(shell coding)
 
Ecommerce(online Shopping)
Ecommerce(online Shopping)Ecommerce(online Shopping)
Ecommerce(online Shopping)
 
Different types of Addressing.cao
Different types of Addressing.caoDifferent types of Addressing.cao
Different types of Addressing.cao
 
2nd generation of computer
2nd generation of computer2nd generation of computer
2nd generation of computer
 
Art_of_living assignment
Art_of_living assignmentArt_of_living assignment
Art_of_living assignment
 
Art_of_living
Art_of_livingArt_of_living
Art_of_living
 
Informationsecurity
InformationsecurityInformationsecurity
Informationsecurity
 
SQL Joinning.Database
SQL Joinning.DatabaseSQL Joinning.Database
SQL Joinning.Database
 
WLAN of networking.ppt
WLAN of networking.pptWLAN of networking.ppt
WLAN of networking.ppt
 
simpson's in numerical method
simpson's in numerical methodsimpson's in numerical method
simpson's in numerical method
 
Error detection in Data comunication
 Error detection in Data comunication Error detection in Data comunication
Error detection in Data comunication
 
microsoft word & powerpoint
 microsoft word & powerpoint microsoft word & powerpoint
microsoft word & powerpoint
 

Recently uploaded

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 

Recently uploaded (20)

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 

Assembly

  • 1. 1
  • 2. 2 A FEW BASICA FEW BASIC INSTRUCTIONSINSTRUCTIONS
  • 5. There are over a hundred instructions in the instruction set for the 8086 CPU. Here we discuss 7 of the most useful instructions for transferring data and doing arithmetic. The discussed instructions are…….. MOV,XCHG,ADD,SUB,INC,DEC,NEG. 5 IntroductionIntroduction
  • 6. MOVMOV  Transfer data ◦ Between registers ◦ Between register and a memory location ◦ Move a no. directly to a register or a memory location  Syntax MOV destination, source  Example MOV AX, WORD1 6 How?
  • 7. XCHG  Exchange the contents of ◦ Two registers ◦ Register and a memory location  Syntax XCHG destination, source  Example XCHG AH, BL 7 AL BL 00 1A 05 00 AH AL BH BL How?
  • 8. Legal Combinations of Operands forLegal Combinations of Operands for MOV And XCHGMOV And XCHG Destina tion Operan d Source Opera nd Legal General Register General Register YES General Register Memory Locatio n YES Memory Location General Register YES Memory Location Memory Locatio n NO Destination Operand Source Operand Legal General Register General Register YES General Register Memory Location YES General Register Segment Register YES General Register Constant YES Memory Location General Register YES Memory Location Memory Location NO Memory Location Segment Register YES Memory Constant YES MOV XCHG
  • 9. ADD InstructionADD Instruction To add contents of: ◦ Two registers ◦ A register and a memory location ◦ A number to a register ◦ A number to a memory location Example ADD WORD1, AX 9 How?
  • 10. SUB InstructionSUB Instruction To subtract the contents of: ◦ Two registers ◦ A register and a memory location ◦ A number from a register ◦ A number from a memory location  Example SUB AX, DX 10 How?
  • 11. Legal Combinations of Operands forLegal Combinations of Operands for ADD & SUB instructionsADD & SUB instructions 11 Destination Operand Source Operand Legal General Register General Register YES General Register Memory Location YES General Register Constant YES Memory Location General Register YES Memory Location Memory Location NO Memory Location Constant YES
  • 12. INC & DECINC & DEC  INC (increment) instruction is used to add 1 to the contents of a register or memory location. ◦ Syntax: INC destination ◦ Example: INC WORD1  DEC (decrement) instruction is used to subtract 1 from the contents of a register or memory location. ◦ Syntax: DEC destination ◦ Example: DEC BYTE1 12 Destination can be 8-bit or 16-bits wide. Destination can be a register or a memory location.
  • 13. 13 INC WORD1 DEC BYTE1 INC & DECINC & DEC How? How?
  • 14. NEGNEG  Used to negate the contents of destination.  Replace the contents by its 2’s complement.  Syntax: NEG destination  Example: NEG BX 14How?
  • 15. ExamplesExamples  Consider instructions: MOV, ADD, SUB, INC, DEC, NEG  A and B are two word variables  Translate statements into assembly language: 15 Statement Translation A =-( A+1) MOV AX,A INC AX NEG AX MOV A,AX B= 3B-7 MOV AX,B ADD AX,B ADD AX,B SUB AX,7 MOV B,AX Example:1 Example:2 Statem ent Translation A = B – A-1 MOV AX,B SUB AX,A DEC AX MOV A,AX Example:3
  • 16. 16 ApplicationApplication .data msg1 DB 'Input Any number From 1 To 9:$' ; Data segment msg2 DB 'The Series Summation Is:$' .code main proc mov AX,@DATA ; Data segment mov DS,AX lea dx,msg1 ;showing msg1 mov ah,9 int 21h mov ah,1 ;taking input int 21h xor ah,ah sub al,30h XOR CX,CX ;loop same as input mov cx,ax XOR bx,bx ## A series summation of n numbers where 1<=n<=9
  • 17. 17 sub bx,0Ah add ax,1 ;counter=ax=3 CMP bx ,39h ;bx<39h JL DISPLAY sub bx,0Ah add ax,1 ;counter=ax=4 CMP bx ,39h ;bx<39h JL DISPLAY DISPLAY: add al,30h mov cl,al lea dx,msg2 ;showing msg2 mov ah,9 int 21h mov ah,2 mov dl,cl int 21h mov dl,bl int 21h ApplicationApplication TOP: add bx,cx ;adding LOOP TOP mov ah,2 mov dl,0Dh int 21h ;printing new line mov dl,0Ah int 21h xor ax,ax add bx,30h CMP bx ,39h ;bx<39h JL DISPLAY sub bx,0Ah add ax,1 ;counter=ax=1 CMP bx ,39h ;bx<39h JL DISPLAY sub bx,0Ah add ax,1 ;counter=ax=2 CMP bx ,39h ;bx<39h JL DISPLAY
  • 18. 18
  • 19. ? ? <

Editor's Notes

  1. Other e.g. XCHG AX, WORD1
  2. Source contents remain unchanged!