SlideShare a Scribd company logo
1 of 37
DATA TRANSFER INSTRUCTIONS
 PUSH Operand:
 It pushes the operand into top of stack.
 E.g.: PUSH BX
 POP Des:
 It pops the operand from top of stack to Des.
 Des can be a general purpose register, segment register (except CS) or memory
location.
 E.g.: POP AX
Data Transfer Instructions
IN Accumulator, Port Address:
• It transfers the operand from specified port to accumulator register.
• E.g.: IN AX, 0028 H
OUT Port Address, Accumulator:
• It transfers the operand from accumulator to specified port.
• E.g.: OUT 0028 H, AX
LEA Register, Src [Load Effective Address]
• It loads a 16-bit register with the offset address of the data specified by the
Src.
E.g.: LEA BX, [DI]
• This instruction loads the contents of DI (offset) into the BX register.
Data Transfer Instructions
LES Des, Src [load ES register]
• It loads 32-bit pointer from memory source to destination register and ES.
• The offset is placed in the destination register and the segment is placed in ES.
• This instruction is very similar to LDS except that it initializes ES instead of DS.
• E.g.: LES BX, [0301 H]
Data Transfer Instructions
LAHF:
It copies the lower byte of flag register to AH.
SAHF:
It copies the contents of AH to lower byte of flag register.
PUSHF:
Pushes flag register to top of stack.
POPF:
Pops the stack top to flag register.
Data Transfer Instructions
Arithmetic Instructions
MUL Src:
• It is an unsigned multiplication instruction.
• It multiplies two bytes to produce a word or two words to produce a double word.
AX = AL * Src
DX : AX = AX * Src
• This instruction assumes one of the operand in AL or AX.
• Src can be a register or memory location.
IMUL Src:
• It is a signed multiplication instruction.
8 bit multiplication
 AL is multiplicand.
 AX keeps the result
 MOV AL,10h ; AL = 10h
 MOV CL,13h ; CL = 13h
 IMUL CL ; AX = 0130h
• AX is multiplicand
• DX:AX keep the result
• MOV AX,0100h ; AX = 0100h
• MOV BX,1234h ; BX = 1234h
• IMUL BX ; DX = 0012h
; AX = 3400h
16 bit multiplication
DIV Src:
• It is an unsigned division instruction.
• It divides word by byte or double word by word.
• The operand is stored in AX, divisor is Src and the result is stored as:
• AH = remainder AL = quotient
IDIV Src:
• It is a signed division instruction.
Arithmetic Instructions
 AL is dividend
 AL keep the result
 AH keep the remainder
 MOV AX, 0017h
 MOV BX, 0010h
 DIV BL ; AX = 0701
8 bit division
16 bit division
 DX:AX dividend.
 AX keep the result, DX keep the remainder.
 MOV AX,4022h ;
 MOV DX,0000h ;
 MOV CX,1000h ;
 DIV CX ;AX = 0004
;DX = 0022
Arithmetic Instructions
CBW (Convert Byte to Word):
• This instruction converts byte in AL to word in AX.
• The conversion is done by extending the sign bit of AL throughout AH.
CWD (Convert Word to Double Word):
• This instruction converts word in AX to double word in DX : AX.
• The conversion is done by extending the sign bit of AX throughout DX.
 MOV AL,22h
 CBW ; AX=0022h
 MOV AL,90h
 CBW ; AX=FF90h
 MOV AX, 3422h
 CWD ; DX=0000h
; AX=3422h
Ex. Conversion
BIT MANIPULATION INSTRUCTIONS
• These instructions are used at the bit level.
• These instructions can be used for:
Testing a zero bit
Set or reset a bit
Shift bits across registers
BIT MANIPULATION INSTRUCTIONS
XOR Des, Src:
• It performs XOR operation of Des and Src.
• Src can be immediate number, register or memory location.
• Des can be register or memory location.
• Both operands cannot be memory locations at the same time.
• CF and OF become zero after the operation.
• PF, SF and ZF are updated.
Bit Manipulation Instructions
SHL Des, Count:
• It shiftS bits of byte or word left, by count.
• It puts zero(s) in LSBs.
• MSB is shifted into carry flag.
• If the number of bits desired to be shifted is 1, then the immediate
number 1 can be written in Count.
• However, if the number of bits to be shifted is more than 1, then the
count is put in CL register.
Bit Manipulation Instructions
SHR Des, Count
• It shift bits of byte or word right, by count.
• It puts zero(s) in MSBs.
• LSB is shifted into carry flag.
• If the number of bits desired to be shifted is 1, then the immediate
number 1 can be written in Count.
• However, if the number of bits to be shifted is more than 1, then the
count is put in CL register.
SAL Des, Count:
• It shiftS bits of byte or word left, by count.
• It puts zero(s) in LSBs.
• MSB is shifted into carry flag.
• If the number of bits desired to be shifted is 1, then the immediate number 1 can be
written in Count.
• However, if the number of bits to be shifted is more than 1, then the count is put in CL
register.
Bit Manipulation Instructions
Bit Manipulation Instructions
SAR Des, Count
•It shift bits of byte or word right, by count.
•It does not change MSB, rather MSB is copied to the next bit and retains its value.
•LSB is shifted into carry flag.
•If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in
Count.
•However, if the number of bits to be shifted is more than 1, then the count is put in CL register.
Bit Manipulation Instructions
Bit Manipulation Instructions
ROL Des, Count
• It rotates bits of byte or word left, by count.
• MSB is transferred to LSB and also to CF.
• If the number of bits desired to be shifted is 1, then the immediate number 1 can be
written in Count.
• However, if the number of bits to be shifted is more than 1, then the count is put in
CL register.
Bit Manipulation Instructions
ROR Des, Count:
• It rotates bits of byte or word right, by count.
• LSB is transferred to MSB and also to CF.
• If the number of bits desired to be shifted is 1, then the immediate
number 1 can be written in Count.
• However, if the number of bits to be shifted is more than 1, then the
count is put in CL register.
Bit Manipulation Instructions
• RCR Des, Count
• Used to rotate bits of byte/word towards the right, i.e. LSB to CF and CF to MSB.
• RCL Des, Count
• Used to rotate bits of byte/word towards the left, i.e. MSB to CF and CF to LSB.
PROGRAM EXECUTION TRANSFER INSTRUCTIONS
• These instructions cause change in the sequence of the execution of instruction.
• This change can be through a condition or sometimes unconditional.
• The conditions are represented by flags.
PROGRAM EXECUTION TRANSFER INSTRUCTIONS
• CALL Des:
• This instruction is used to call a subroutine or function or procedure.
• The address of next instruction after CALL is saved onto stack.
• RET:
• It returns the control from procedure to calling program.
• Every CALL instruction should have a RET.
JMP Des:
This instruction is used for unconditional jump from one place to another.
Jxx Des (Conditional Jump):
All the conditional jumps follow some conditional statements or any instruction that
affects the flag.
PROGRAM EXECUTION TRANSFER INSTRUCTIONS
Mnemonic Meaning Jump Condition
JA Jump if Above CF = 0 and ZF = 0
JAE Jump if Above or Equal CF = 0
JB Jump if Below CF = 1
JBE Jump if Below or Equal CF = 1 or ZF = 1
JC Jump if Carry CF = 1
JE Jump if Equal ZF = 1
JNC Jump if Not Carry CF = 0
JNE Jump if Not Equal ZF = 0
JNZ Jump if Not Zero ZF = 0
JPE Jump if Parity Even PF = 1
JPO Jump if Parity Odd PF = 0
JZ Jump if Zero ZF = 1
Loop Des:
• This is a looping instruction.
• The number of times looping is required is placed in the CX register.
• With each iteration, the contents of CX are decremented.
• ZF is checked whether to loop again or not.
PROGRAM EXECUTION TRANSFER INSTRUCTIONS
String Instructions
• String in assembly language is just a sequentially stored bytes or words.
• There are very strong set of string instructions in 8086.
• By using these string instructions, the size of the program is considerably reduced.
• CMPS Des, Src
• It compares the string bytes or words.
• SCAS String
• It scans a string.
• It compares the String with byte in AL or with word in AX.
String Instructions
• MOVS / MOVSB / MOVSW:
• It causes moving of byte or word from one string to another.
• In this instruction, the source string is in Data Segment and destination string is in Extra
Segment.
• SI and DI store the offset values for source and destination index.
String Instructions
• REP (Repeat):
• This is an instruction prefix.
• It causes the repetition of the instruction until CX becomes zero.
• E.g.: REP MOVSB STR1, STR2
• It copies byte by byte contents.
• REP repeats the operation MOVSB until CX becomes zero.
String Instructions
Processor Control instruction
• STC:
• It sets the carry flag to 1.
• CLC:
• It clears the carry flag to 0.
• CMC:
• It complements the carry flag.
• STD:
• It sets the direction flag to 1.
• If it is set, string bytes are accessed from higher memory address to lower memory address.
• CLD:
• It clears the direction flag to 0.
• If it is reset, the string bytes are accessed from lower memory address to higher memory address.
Processor Control instruction
These instructions are used to execute the given instructions for a number of times.
Following is the list of instructions under this group −
•LOOP − Used to loop a group of instructions until the condition satisfies, i.e., CX = 0
•LOOPE/LOOPZ − Used to loop a group of instructions till it satisfies ZF = 1 & CX = 0
•LOOPNE/LOOPNZ − Used to loop a group of instructions till it satisfies ZF = 0 & CX = 0
•JCXZ − Used to jump to the provided address if CX = 0
Iteration Control Instructions
These instructions are used to call the interrupt during program execution.
INT
• Used to interrupt the program during execution and calling service specified.
INTO
• Used to interrupt the program during execution if OF = 1.
IRET
•Used to return from interrupt service to the main program.
Interrupt Instructions

More Related Content

Similar to Microprocessor.pptx

8086 instructions
8086 instructions8086 instructions
8086 instructionsRavi Anand
 
Arithmetic and logical instructions set
Arithmetic and logical instructions setArithmetic and logical instructions set
Arithmetic and logical instructions setRobert Almazan
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086Mahalakshmiv11
 
Chap 3_2.ppt
Chap 3_2.pptChap 3_2.ppt
Chap 3_2.pptinian2
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Bilal Amjad
 
Loop instruction, controlling the flow of progam
Loop instruction, controlling the flow of progamLoop instruction, controlling the flow of progam
Loop instruction, controlling the flow of progamDr. Girish GS
 
Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051logesh waran
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086Akhila Rahul
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptssuser2b759d
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorAshita Agrawal
 
Instruction set-of-8086
Instruction set-of-8086Instruction set-of-8086
Instruction set-of-8086mudulin
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086Vijay Kumar
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)AmitPaliwal20
 

Similar to Microprocessor.pptx (20)

8086 instructions
8086 instructions8086 instructions
8086 instructions
 
Arithmetic and logical instructions set
Arithmetic and logical instructions setArithmetic and logical instructions set
Arithmetic and logical instructions set
 
Instruction sets of 8086
Instruction sets of 8086Instruction sets of 8086
Instruction sets of 8086
 
8086 Instruction set
8086 Instruction set8086 Instruction set
8086 Instruction set
 
Chap 3_2.ppt
Chap 3_2.pptChap 3_2.ppt
Chap 3_2.ppt
 
MES_MODULE 2.pptx
MES_MODULE 2.pptxMES_MODULE 2.pptx
MES_MODULE 2.pptx
 
Assembly language programs
Assembly language programsAssembly language programs
Assembly language programs
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
 
Loop instruction, controlling the flow of progam
Loop instruction, controlling the flow of progamLoop instruction, controlling the flow of progam
Loop instruction, controlling the flow of progam
 
Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051Addressing mode and instruction set using 8051
Addressing mode and instruction set using 8051
 
8086inst logical
8086inst logical8086inst logical
8086inst logical
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Copy of 8086inst logical
Copy of 8086inst logicalCopy of 8086inst logical
Copy of 8086inst logical
 
Copy of 8086inst logical
Copy of 8086inst logicalCopy of 8086inst logical
Copy of 8086inst logical
 
mm_1.pdf
mm_1.pdfmm_1.pdf
mm_1.pdf
 
instruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.pptinstruction-set-of-8086-mr-binu-joy3.ppt
instruction-set-of-8086-mr-binu-joy3.ppt
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
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
 
Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)Instructionsetof8086 180224060745(3)
Instructionsetof8086 180224060745(3)
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 

Recently uploaded (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

Microprocessor.pptx

  • 1. DATA TRANSFER INSTRUCTIONS  PUSH Operand:  It pushes the operand into top of stack.  E.g.: PUSH BX  POP Des:  It pops the operand from top of stack to Des.  Des can be a general purpose register, segment register (except CS) or memory location.  E.g.: POP AX
  • 2.
  • 3.
  • 4. Data Transfer Instructions IN Accumulator, Port Address: • It transfers the operand from specified port to accumulator register. • E.g.: IN AX, 0028 H OUT Port Address, Accumulator: • It transfers the operand from accumulator to specified port. • E.g.: OUT 0028 H, AX
  • 5. LEA Register, Src [Load Effective Address] • It loads a 16-bit register with the offset address of the data specified by the Src. E.g.: LEA BX, [DI] • This instruction loads the contents of DI (offset) into the BX register. Data Transfer Instructions
  • 6. LES Des, Src [load ES register] • It loads 32-bit pointer from memory source to destination register and ES. • The offset is placed in the destination register and the segment is placed in ES. • This instruction is very similar to LDS except that it initializes ES instead of DS. • E.g.: LES BX, [0301 H] Data Transfer Instructions
  • 7. LAHF: It copies the lower byte of flag register to AH. SAHF: It copies the contents of AH to lower byte of flag register. PUSHF: Pushes flag register to top of stack. POPF: Pops the stack top to flag register. Data Transfer Instructions
  • 8. Arithmetic Instructions MUL Src: • It is an unsigned multiplication instruction. • It multiplies two bytes to produce a word or two words to produce a double word. AX = AL * Src DX : AX = AX * Src • This instruction assumes one of the operand in AL or AX. • Src can be a register or memory location. IMUL Src: • It is a signed multiplication instruction.
  • 9. 8 bit multiplication  AL is multiplicand.  AX keeps the result  MOV AL,10h ; AL = 10h  MOV CL,13h ; CL = 13h  IMUL CL ; AX = 0130h
  • 10. • AX is multiplicand • DX:AX keep the result • MOV AX,0100h ; AX = 0100h • MOV BX,1234h ; BX = 1234h • IMUL BX ; DX = 0012h ; AX = 3400h 16 bit multiplication
  • 11. DIV Src: • It is an unsigned division instruction. • It divides word by byte or double word by word. • The operand is stored in AX, divisor is Src and the result is stored as: • AH = remainder AL = quotient IDIV Src: • It is a signed division instruction. Arithmetic Instructions
  • 12.  AL is dividend  AL keep the result  AH keep the remainder  MOV AX, 0017h  MOV BX, 0010h  DIV BL ; AX = 0701 8 bit division
  • 13. 16 bit division  DX:AX dividend.  AX keep the result, DX keep the remainder.  MOV AX,4022h ;  MOV DX,0000h ;  MOV CX,1000h ;  DIV CX ;AX = 0004 ;DX = 0022
  • 14. Arithmetic Instructions CBW (Convert Byte to Word): • This instruction converts byte in AL to word in AX. • The conversion is done by extending the sign bit of AL throughout AH. CWD (Convert Word to Double Word): • This instruction converts word in AX to double word in DX : AX. • The conversion is done by extending the sign bit of AX throughout DX.
  • 15.  MOV AL,22h  CBW ; AX=0022h  MOV AL,90h  CBW ; AX=FF90h  MOV AX, 3422h  CWD ; DX=0000h ; AX=3422h Ex. Conversion
  • 16. BIT MANIPULATION INSTRUCTIONS • These instructions are used at the bit level. • These instructions can be used for: Testing a zero bit Set or reset a bit Shift bits across registers
  • 17. BIT MANIPULATION INSTRUCTIONS XOR Des, Src: • It performs XOR operation of Des and Src. • Src can be immediate number, register or memory location. • Des can be register or memory location. • Both operands cannot be memory locations at the same time. • CF and OF become zero after the operation. • PF, SF and ZF are updated.
  • 18. Bit Manipulation Instructions SHL Des, Count: • It shiftS bits of byte or word left, by count. • It puts zero(s) in LSBs. • MSB is shifted into carry flag. • If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in Count. • However, if the number of bits to be shifted is more than 1, then the count is put in CL register.
  • 19. Bit Manipulation Instructions SHR Des, Count • It shift bits of byte or word right, by count. • It puts zero(s) in MSBs. • LSB is shifted into carry flag. • If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in Count. • However, if the number of bits to be shifted is more than 1, then the count is put in CL register.
  • 20. SAL Des, Count: • It shiftS bits of byte or word left, by count. • It puts zero(s) in LSBs. • MSB is shifted into carry flag. • If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in Count. • However, if the number of bits to be shifted is more than 1, then the count is put in CL register. Bit Manipulation Instructions Bit Manipulation Instructions
  • 21. SAR Des, Count •It shift bits of byte or word right, by count. •It does not change MSB, rather MSB is copied to the next bit and retains its value. •LSB is shifted into carry flag. •If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in Count. •However, if the number of bits to be shifted is more than 1, then the count is put in CL register. Bit Manipulation Instructions
  • 22. Bit Manipulation Instructions ROL Des, Count • It rotates bits of byte or word left, by count. • MSB is transferred to LSB and also to CF. • If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in Count. • However, if the number of bits to be shifted is more than 1, then the count is put in CL register.
  • 23. Bit Manipulation Instructions ROR Des, Count: • It rotates bits of byte or word right, by count. • LSB is transferred to MSB and also to CF. • If the number of bits desired to be shifted is 1, then the immediate number 1 can be written in Count. • However, if the number of bits to be shifted is more than 1, then the count is put in CL register.
  • 24. Bit Manipulation Instructions • RCR Des, Count • Used to rotate bits of byte/word towards the right, i.e. LSB to CF and CF to MSB. • RCL Des, Count • Used to rotate bits of byte/word towards the left, i.e. MSB to CF and CF to LSB.
  • 25. PROGRAM EXECUTION TRANSFER INSTRUCTIONS • These instructions cause change in the sequence of the execution of instruction. • This change can be through a condition or sometimes unconditional. • The conditions are represented by flags.
  • 26. PROGRAM EXECUTION TRANSFER INSTRUCTIONS • CALL Des: • This instruction is used to call a subroutine or function or procedure. • The address of next instruction after CALL is saved onto stack. • RET: • It returns the control from procedure to calling program. • Every CALL instruction should have a RET.
  • 27. JMP Des: This instruction is used for unconditional jump from one place to another. Jxx Des (Conditional Jump): All the conditional jumps follow some conditional statements or any instruction that affects the flag. PROGRAM EXECUTION TRANSFER INSTRUCTIONS
  • 28. Mnemonic Meaning Jump Condition JA Jump if Above CF = 0 and ZF = 0 JAE Jump if Above or Equal CF = 0 JB Jump if Below CF = 1 JBE Jump if Below or Equal CF = 1 or ZF = 1 JC Jump if Carry CF = 1 JE Jump if Equal ZF = 1 JNC Jump if Not Carry CF = 0 JNE Jump if Not Equal ZF = 0 JNZ Jump if Not Zero ZF = 0 JPE Jump if Parity Even PF = 1 JPO Jump if Parity Odd PF = 0 JZ Jump if Zero ZF = 1
  • 29. Loop Des: • This is a looping instruction. • The number of times looping is required is placed in the CX register. • With each iteration, the contents of CX are decremented. • ZF is checked whether to loop again or not. PROGRAM EXECUTION TRANSFER INSTRUCTIONS
  • 30. String Instructions • String in assembly language is just a sequentially stored bytes or words. • There are very strong set of string instructions in 8086. • By using these string instructions, the size of the program is considerably reduced.
  • 31. • CMPS Des, Src • It compares the string bytes or words. • SCAS String • It scans a string. • It compares the String with byte in AL or with word in AX. String Instructions
  • 32. • MOVS / MOVSB / MOVSW: • It causes moving of byte or word from one string to another. • In this instruction, the source string is in Data Segment and destination string is in Extra Segment. • SI and DI store the offset values for source and destination index. String Instructions
  • 33. • REP (Repeat): • This is an instruction prefix. • It causes the repetition of the instruction until CX becomes zero. • E.g.: REP MOVSB STR1, STR2 • It copies byte by byte contents. • REP repeats the operation MOVSB until CX becomes zero. String Instructions
  • 34. Processor Control instruction • STC: • It sets the carry flag to 1. • CLC: • It clears the carry flag to 0. • CMC: • It complements the carry flag.
  • 35. • STD: • It sets the direction flag to 1. • If it is set, string bytes are accessed from higher memory address to lower memory address. • CLD: • It clears the direction flag to 0. • If it is reset, the string bytes are accessed from lower memory address to higher memory address. Processor Control instruction
  • 36. These instructions are used to execute the given instructions for a number of times. Following is the list of instructions under this group − •LOOP − Used to loop a group of instructions until the condition satisfies, i.e., CX = 0 •LOOPE/LOOPZ − Used to loop a group of instructions till it satisfies ZF = 1 & CX = 0 •LOOPNE/LOOPNZ − Used to loop a group of instructions till it satisfies ZF = 0 & CX = 0 •JCXZ − Used to jump to the provided address if CX = 0 Iteration Control Instructions
  • 37. These instructions are used to call the interrupt during program execution. INT • Used to interrupt the program during execution and calling service specified. INTO • Used to interrupt the program during execution if OF = 1. IRET •Used to return from interrupt service to the main program. Interrupt Instructions