University of Pune                                           S.E. I.T.                            Subject code: 214447  Pr...
Program Development• Assembly Language Program Development
DATA     SEGMENT               ;Data segment declaration    MULTIPLICAND      DW 341AH    MULTIPLIER DW 20F4H    PRODUCT  ...
8086 Instructions•   Data transfer•   Arithmetic•   Bit manipulation•   String•   Program execution transfer•   Processor ...
Data Transfer Instructions                             General•   MOV•   PUSH•   POP•   PUSHA•   POPA•   XCHG•   XLAT
MOV Destination, Source•   MOV CX, 045FH•   MOV BL, [43E4H]•   MOV AX, DX•   MOV DH, [BX]•   MOV DS, BX•   MOV RESULTS[BP]...
PUSH Source • PUSH BX • PUSH DS • PUSH TABLE[BX]POP Destination • POP BX • POP DS • POP TABLE[BX]
• PUSHA• POPA• XLAT / XLATBXCHG Destination, Source• XCHG AX, BX• XCHG AL, CH• XCHG AL, PRICES[BX]
Data Transfer Instructions• IN             Simple IO port transfer• OUT• LEA             Special address transfer• LDS• LE...
IN Accumulator, Port • IN AL, 0C4H • IN AX, 34HOUT Port, Accumulator • OUT 3BH, AL • OUT 2CH, AX
LES Register, Memory addr of first word • LES BX, [789AH] • LES DI, [BX]LEA Register, Source • LEA BX, PRICES • LEA BP, SS...
LDS Register, Memory addr of first word • LDS BX, [789AH] • LDS DI, [BX]
Flag Transfer Instructions•   LAHF    [Load AH With Flags]•   SAHF    [Store AH in Flags]•   PUSHF      [Push flags on sta...
Arithmetic Instructions•   ADD           •   AAS•   ADC           •   DAS•   INC           •   MUL•   AAA           •   IM...
ADD Destination, Source•   ADD AL, 74H•   ADD CL, BL•   ADD DX, BX•   ADD DX, [SI]    ADC Destination, Source•   ADC AL, 7...
INC Destination• INC BL• INC CX• INC VARIABLEAAA    [ASCII Adjust Accumulator After Addition]DAA    [Decimal Adjust Accumu...
SUB Destination, Source•   SUB CX, BX•   SUB CH, AL•   SUB AX, 4563H•   SUB PRICES[BX], 04H    SBB Destination, Source• SB...
DEC Destination• DEC AL• DEC BP• DEC VARIABLE NEG Destination• NEG AL• NEG BX• NEG BYTE PTR[BX]
CMP Destination, Source•   CMP AL, 01H•   CMP BH, CL•   CMP CX, TEMP_MIN•   CMP TEMP_MIN, CX    AAS [ASCII Adjust Accumula...
MUL Source• MUL BH• MUL CX• MUL BYTE PTR[BX]AAM  [BCD Adjust Accumulator After Multiply]
DIV Source• DIV BH• DIV CX• DIV BYTE PTR[BX]AAD  [Binary Adjust Accumulator Before Division]
CBWConvert Signed Byte to Signed WordCWDConvert Signed Word to Signed Double Word
Bit Manipulation Instructions      Logical       Shift       Rotate  •   NOT       •   SAL     •   ROL  •   AND       •   ...
NOT Destination• NOT BX• NOT BYTE PTR[BX]AND Destination, Source•   AND BH, CL•   AND CX, [SI]•   AND BX, 00FFH•   AND DX,...
OR Destination, Source•   OR BH, CL•   OR CX, [SI]•   OR BX, 00FFH•   OR DX, BXXOR Destination, Source• XOR BH, CL• XOR BP...
TEST Destination, Source•   TEST BH, CL•   TEST CX, [SI]•   TEST BX, 00FFH•   TEST DX, BX
SAL / SHL Destination, Count•   SAL BX, 01•   SAL BP, CL•   MOV CL, 04H•   SAL AL, CL            C     B7 B6 B5 B4 B3 B2 B...
SHR Destination, Count• SHR BP, 01• SHR AL, CL               B7 B6 B5 B4 B3 B2 B1 B0   C         0     1 0 1 1 0 1 1 1    ...
SAR Destination, Count• SAR DI, 1• SAR AL, 01               B7 B6 B5 B4 B3 B2 B1 B0   C               1 0 1 1 0 1 1 1     ...
ROL Destination, Count• ROL AX, 1• ROL BL, CL          C    B7 B6 B5 B4 B3 B2 B1 B0         0     1 0 1 1 0 1 1 1         ...
RCL Destination, Count• RCL AX, 1• RCL BL, CL          C    B7 B6 B5 B4 B3 B2 B1 B0          0    1 0 1 1 0 1 1 1         ...
ROR Destination, Count• ROR BL, 01• ROR AL, CL               B7 B6 B5 B4 B3 B2 B1 B0   C               1 0 1 1 0 1 1 1    ...
RCR Destination, Count• RCR BL, 01• RCR AL, CL               B7 B6 B5 B4 B3 B2 B1 B0   C               1 0 1 1 0 1 1 1    ...
Program Execution TransferCALL name of procedure• CALL SQRT• CALL BX• CALL WORD PTR(BX)RET
Jump Instructions• JMP label Instruction Description (Jump if)       Conditions JA/JNBE      Above/Below Not Equal      C=...
Jump InstructionsInstruction Description (Jump if)       ConditionsJG/JNLE     Greater/Not Less Than or    C=O, Z=0       ...
Jump InstructionsInstruction Description (Jump if)   ConditionsJNO         Not Overflow            O=0JNP/JPO     Not Pari...
Iteration Control InstructionsInstruction         Description           Conditions                                        ...
Processor Control Instructions •   STC •   CLC •   CMC •   STD •   CLD •   STI •   CLI
External Hardware Synchronization  •   HLT  •   WAIT  •   ESC  •   LOCK  •   NOP
Interrupt Instructions• INT• INTO• IRET
References• “Microprocessors and Interfacing” by Douglas  Hall, Tata McGraw Hill Publishing.
Upcoming SlideShare
Loading in...5
×

8086 instruction set with types

10,109

Published on

all details of 8086

0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
10,109
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
470
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

8086 instruction set with types

  1. 1. University of Pune S.E. I.T. Subject code: 214447 Processor Architecture and InterfacingPart 02: Assembly Language Programming With 8086 Tushar B Kute, Sandip Institute of Technology and Research Centre, Nashik tbkute@gmail.com
  2. 2. Program Development• Assembly Language Program Development
  3. 3. DATA SEGMENT ;Data segment declaration MULTIPLICAND DW 341AH MULTIPLIER DW 20F4H PRODUCT DW 2 DUP(0)DATA ENDSCODE SEGMENT ASSUME CS:CODE, DS:DATASTART: MOV AX, DATA MOV DS, AX Example Code MOV AX, MULTIPLICAND MUL MULTIPLIER MOV PRODUCT, AX MOV PRODUCT+2, DX INT 3CODE ENDS END START
  4. 4. 8086 Instructions• Data transfer• Arithmetic• Bit manipulation• String• Program execution transfer• Processor control
  5. 5. Data Transfer Instructions General• MOV• PUSH• POP• PUSHA• POPA• XCHG• XLAT
  6. 6. MOV Destination, Source• MOV CX, 045FH• MOV BL, [43E4H]• MOV AX, DX• MOV DH, [BX]• MOV DS, BX• MOV RESULTS[BP], AX
  7. 7. PUSH Source • PUSH BX • PUSH DS • PUSH TABLE[BX]POP Destination • POP BX • POP DS • POP TABLE[BX]
  8. 8. • PUSHA• POPA• XLAT / XLATBXCHG Destination, Source• XCHG AX, BX• XCHG AL, CH• XCHG AL, PRICES[BX]
  9. 9. Data Transfer Instructions• IN Simple IO port transfer• OUT• LEA Special address transfer• LDS• LES• LAHF• SAHF Flag transfer• PUSHF• POPF
  10. 10. IN Accumulator, Port • IN AL, 0C4H • IN AX, 34HOUT Port, Accumulator • OUT 3BH, AL • OUT 2CH, AX
  11. 11. LES Register, Memory addr of first word • LES BX, [789AH] • LES DI, [BX]LEA Register, Source • LEA BX, PRICES • LEA BP, SS:STACK_TOP • LEA CX, [BX][DI]
  12. 12. LDS Register, Memory addr of first word • LDS BX, [789AH] • LDS DI, [BX]
  13. 13. Flag Transfer Instructions• LAHF [Load AH With Flags]• SAHF [Store AH in Flags]• PUSHF [Push flags on stack]• POPF [Pop stack top to flags]
  14. 14. Arithmetic Instructions• ADD • AAS• ADC • DAS• INC • MUL• AAA • IMUL• DAA • AAM• SBB • DIV• SUB • IDIV• DEC • AAD• NEG • CBW• CMP • CDW
  15. 15. ADD Destination, Source• ADD AL, 74H• ADD CL, BL• ADD DX, BX• ADD DX, [SI] ADC Destination, Source• ADC AL, 74H• ADC CL, BL• ADC DX, BX• ADC DX, [SI]
  16. 16. INC Destination• INC BL• INC CX• INC VARIABLEAAA [ASCII Adjust Accumulator After Addition]DAA [Decimal Adjust Accumulator After Addition]
  17. 17. SUB Destination, Source• SUB CX, BX• SUB CH, AL• SUB AX, 4563H• SUB PRICES[BX], 04H SBB Destination, Source• SBB CX, BX• SBB CH, AL• SBB AX, 4563H
  18. 18. DEC Destination• DEC AL• DEC BP• DEC VARIABLE NEG Destination• NEG AL• NEG BX• NEG BYTE PTR[BX]
  19. 19. CMP Destination, Source• CMP AL, 01H• CMP BH, CL• CMP CX, TEMP_MIN• CMP TEMP_MIN, CX AAS [ASCII Adjust Accumulator For Subtraction] DAS [Decimal Adjust Accumulator For Subtraction]
  20. 20. MUL Source• MUL BH• MUL CX• MUL BYTE PTR[BX]AAM [BCD Adjust Accumulator After Multiply]
  21. 21. DIV Source• DIV BH• DIV CX• DIV BYTE PTR[BX]AAD [Binary Adjust Accumulator Before Division]
  22. 22. CBWConvert Signed Byte to Signed WordCWDConvert Signed Word to Signed Double Word
  23. 23. Bit Manipulation Instructions Logical Shift Rotate • NOT • SAL • ROL • AND • SHL • RCL • OR • SAR • ROR • XOR • SHR • RCR • TEST
  24. 24. NOT Destination• NOT BX• NOT BYTE PTR[BX]AND Destination, Source• AND BH, CL• AND CX, [SI]• AND BX, 00FFH• AND DX, BX
  25. 25. OR Destination, Source• OR BH, CL• OR CX, [SI]• OR BX, 00FFH• OR DX, BXXOR Destination, Source• XOR BH, CL• XOR BP, DI• XOR DX, BX
  26. 26. TEST Destination, Source• TEST BH, CL• TEST CX, [SI]• TEST BX, 00FFH• TEST DX, BX
  27. 27. SAL / SHL Destination, Count• SAL BX, 01• SAL BP, CL• MOV CL, 04H• SAL AL, CL C B7 B6 B5 B4 B3 B2 B1 B0 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0
  28. 28. SHR Destination, Count• SHR BP, 01• SHR AL, CL B7 B6 B5 B4 B3 B2 B1 B0 C 0 1 0 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 1
  29. 29. SAR Destination, Count• SAR DI, 1• SAR AL, 01 B7 B6 B5 B4 B3 B2 B1 B0 C 1 0 1 1 0 1 1 1 0 1 1 0 1 1 0 1 1 1
  30. 30. ROL Destination, Count• ROL AX, 1• ROL BL, CL C B7 B6 B5 B4 B3 B2 B1 B0 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 1
  31. 31. RCL Destination, Count• RCL AX, 1• RCL BL, CL C B7 B6 B5 B4 B3 B2 B1 B0 0 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 1 0
  32. 32. ROR Destination, Count• ROR BL, 01• ROR AL, CL B7 B6 B5 B4 B3 B2 B1 B0 C 1 0 1 1 0 1 1 1 0 1 1 0 1 1 0 1 1 1
  33. 33. RCR Destination, Count• RCR BL, 01• RCR AL, CL B7 B6 B5 B4 B3 B2 B1 B0 C 1 0 1 1 0 1 1 1 0 1 1 0 1 1 0 1 1 1
  34. 34. Program Execution TransferCALL name of procedure• CALL SQRT• CALL BX• CALL WORD PTR(BX)RET
  35. 35. Jump Instructions• JMP label Instruction Description (Jump if) Conditions JA/JNBE Above/Below Not Equal C=0, Z=0 JAE/JNB Above or Equal/ Not Below C=0, Z=1 JB/JNAE Below/Not Above nor Equal C=1, Z=0 JBE/JNA Below or Equal/Not Above C=1, Z=1 JC Carry flag=1 C=1 JE/JZ Equal / Zero Z=1
  36. 36. Jump InstructionsInstruction Description (Jump if) ConditionsJG/JNLE Greater/Not Less Than or C=O, Z=0 EqualJGE/JNL Greater Than or Equal/Not S=O Less ThanJL/JNGE Less Than/Not Greater S≠O Than or EqualJLE/JNG Less Than or Equal/Not S=O, Z=1 Greater ThanJNC No Carry C=0JNE/JNZ Not Equal / Not Zero Z=0
  37. 37. Jump InstructionsInstruction Description (Jump if) ConditionsJNO Not Overflow O=0JNP/JPO Not Parity/Parity Odd P=0JNS Not Sign S=0JO Overflow O=1JP/JPE Parity/Parity Even P=1JS Sign Flag S=1JCXZ CX is Zero CX=0
  38. 38. Iteration Control InstructionsInstruction Description Conditions for ExitLOOP Loop through sequence of CX=0 instructionsLOOPE/ Loop through sequence of CX=0 or instructions ZF=0LOOPZLOOPNE/ Loop through sequence of CX=0 or instructions ZF=1LOOPNZ
  39. 39. Processor Control Instructions • STC • CLC • CMC • STD • CLD • STI • CLI
  40. 40. External Hardware Synchronization • HLT • WAIT • ESC • LOCK • NOP
  41. 41. Interrupt Instructions• INT• INTO• IRET
  42. 42. References• “Microprocessors and Interfacing” by Douglas Hall, Tata McGraw Hill Publishing.
  1. Gostou de algum slide específico?

    Recortar slides é uma maneira fácil de colecionar informações para acessar mais tarde.

×