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

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
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
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
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
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Recently uploaded (20)

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
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
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
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
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
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
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

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