Lecture 1 Instruction set of 8086 Лектор: Люличева И.А. 1.

Slides:



Advertisements
Similar presentations
Intel 8086.
Advertisements

Registers of the 8086/ /2002 JNM.
80x86 Instruction Set Dr. Qiang Lin.
Gursharan Singh Tatla 21-Nov-20101www.eazynotes.com.
8086 : INSTRUCTION SET By, Pramod Sunagar Assistant Professor
8-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Flow Control Instructions
9-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Microcomputer & Interfacing Lecture 3
80x86 Processor Architecture
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
Microprocessor Programming II
3.7 String Instructions Specifying the Operands’ Size and Address and the String Direction STRING = a data collection in memory. String ELEMENTS can be:
Types of Registers (8086 Microprocessor Based)
Chapter 4 - Implementing Standard Program Structures in 8086 Assembly Language from Microprocessors and Interfacing by Douglas Hall.
CE302 MICROPROCESSORS Levent EREN Izmir University of Economics.
Strings, Procedures and Macros
ICS312 Lecture13 String Instructions.
Click to add Title Comunicación y Gerencia Click To add Subtitle Click to add Text Fundamentals of Assembly Language.
Microprocessor Programming II To discuss more complicated programming techniques Flag control instructions Compare and jump Subroutines Loop and string.
LEA instruction The LEA instruction can be used to get the offset address of a variable Example ORG 100h MOV AL, VAR1 ; check value of VAR1 by moving it.
3.4 Addressing modes Specify the operand to be used. To generate an address, a segment register is used also. Immediate addressing: the operand is a number.
Jumps, Loops and Branching. Unconditional Jumps Transfer the control flow of the program to a specified instruction, other than the next instruction in.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Lecture 2 Programming of 8086 Лектор: Люличева И.А. 1.
Format of Assembly language
Chapter Nov-2010
Data Transfers, Addressing, and Arithmetic
Assembly 07 String Processing.
Introduction to 8086 Microprocessor
BYTE AND STRING MANIPULATON
8086 Microprocessor.
8086 MICROPROCESSOR.
Today we are going to discuss about,
Instruksi Set Prosesor 8088
Microprocessor and Assembly Language
EE3541 Introduction to Microprocessors
Morgan Kaufmann Publishers Computer Organization and Assembly Language
INSTRUCTION SET.
Machine control instruction
INSTRUCTION SET.
Assembly Language Programming Part 2
ECE 353 Introduction to Microprocessor Systems
Microprocessor and Assembly Language
Assembly Lang. – Intel 8086 Addressing modes – 1
Chapter 3 Addressing Modes
CS 301 Fall 2002 Control Structures
Introduction to Assembly Language
Flags Register & Jump Instruction
CS-401 Computer Architecture & Assembly Language Programming
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
Program Logic and Control
Program Logic and Control
Symbolic Instruction and Addressing
Assembly Language for Intel-Based Computers, 5th Edition
Flow Control Instructions
T opic: S TRING I NSTRUCTION P RESENTED B Y: N OOR FATIMA M AHA AKRAM ASIF.
Introduction to 8086 Assembly Language Programming
X86 Assembly Review.
EECE.3170 Microprocessor Systems Design I
Chapter 6 –Symbolic Instruction and Addressing
Assembly Language for Intel 8086 Jump Condition
CNET 315 Microprocessor & Assembly Language
Chapter 7 –Program Logic and Control
Intel 8086.
The JUMP GROUP Unconditional Jump (JMP).
Chapter 8: Instruction Set 8086 CPU Architecture
Chapter 7 –Program Logic and Control
UNIT-II ADDRESSING MODES & Instruction set
Presentation transcript:

Lecture 1 Instruction set of 8086 Лектор: Люличева И.А. 1

Content 80286 MP block-diagram Universal microprocessors instruction groups Examples of programs

80286 MP block-diagram 3

80286 MP The second generation of x86 16-bit processors, Intel 80286, was released in 1982. The major new feature of the 80286 microprocessor was protected mode. Instruction set was changed by adding some new instructions to the existing six groups.

Universal microprocessors instruction groups Instruction set of MP x86 consist of 6 groups: 1. Data transfer instructions. 2. Arithmetical instructions. 3. Logical operations and shift instructions. 4. Flow control instructions. 5. Chains (arrays) instructions. 6. Microprocessor control instructions. 5

Basics of instruction set of MP or MC 3 types of instruction format http://www.c- jump.com/ 6

Flow control instructions Segmentation leads to two types of the flow control: Inside the segment - only IP changes. Type - NEAR, or short addressing. Outside the segment. Type - FAR - both IP and CS change (segment: bias) ES:DI Segment registers are CS, DS, ES, SS 7

Flow control instructions May be divided on 5 subgroups: Unconditional jumps, Conditional branches, Subroutines call and return, cycles Interrupts instructions Let us look at each groups . 8

Flow control instructions Unconditional JMPs may be short or long and direct/indirect. JMP dispL 16- short jump JMP mem/reg - near indirect jump JMP addr32 - far jump JMP mem - far indirect jump 9

Flow control instructions 19 conditional branches All of them are short and may be executed ander some condition: Mnemonics: 1) for unsigned data JA/JNBE - if more (>); JAE/JNB/JNC - >= JB/JNAE/JC - <; JBE/JNA - <=. 2) For signed data: JG/JNLE - >; JGE/JNL - >=; JL/JNGE - <; JLE/JNG - <=; JNS - >0; JS - <0. 10

Flow control instructions 3) Conditional jumps: JE/JZ — jump if equal (if zero); JNE/JNZ — if not zero ; JNO/JNC - jump if not carry; JO/JC- jump on carry. Additional instr: JCXZ - jump ix CX=0; JNP/JPO - jump if odd (not parity); JP/JPE - if even (if parity) . 11

Flow control instructions 3 instr for cycles - use CX as a counter. Only short jumps on -128 - +127 bytes from current point. LOOP make CX-- and continue the cycle until CX=0 For example @m1: … Loop @m1 12

Flow control instructions Short delay subroutin MOV CX, 1000 M1: DEC CX JNZ M1 You my write the same in a short way, using loop instruction: M1: LOOP M1 13

Flow control instructions For work with subroutines Call subroutine: Call @Pr1 …. @Pr1: Push ax Add ax, bx Mov ES:[di], ax Pop ax Ret 14

6. MP control instructions Control MP functioning. For 8086 only work with flags and synhroniz.(NOP, wait etc). In 80286, 80386 ++ - additional 10 - 20 mnemonics. 15

Work with chains Chain is a consequence of chained bytes or words, которые находятся в смежных ячейках памяти. MP 8086 has 5 chains instructions They may work with the special prefixes 16

Work with chains Simple pref is REP, wich leads to the repetition of action on the next chain element. Повторение рассчитано на максимальную длину цепочек 64К и выполняется значительно быстрее цикла LOOP. Цепочечные команды могут иметь только один операнд-источник, или операнд-получатель или оба операнда одновременно. В качестве адреса операнда-источника (SRC) всегда используется регистровая пара DS:SI. Операнд-получатель – всегда пара ES:DI. 17

Work with chains Instruction MOVS sends one byte or word from the chain, addressed by DS:SI, into the chain, addressed by ES:DI. Format: MOWSB or MOVSW Works with the REP prefix 18

Work with chains Compare bytes or words in a chain with AL or AX CMPS Formate: CMPSB or CMPSW Works with REPE or REPNE prefix 19

Work with chains Instructions STOSB/W save AL or AX into a chain, addressed by ES:DI. Format STOSB, STOSW Below are 2 examples of long description of these instr. 20

Instruction STOSB Store byte in AL into ES:[DI]. Update DI. Algorithm:  ES:[DI] = AL if DF = 0 then DI = DI + 1 else DI = DI - 1 21

Instruction STOSW Store word in AX into ES:[DI]. Update DI. Algorithm:  ES:[DI] = AX if DF = 0 then DI = DI + 2 else DI = DI - 2 22

Example of using STOSB/W for clear screen. Block diagram Work with chains Example of using STOSB/W for clear screen. Block diagram 23 23

Work with chains MOV ES, AX { futher! } Example of program. MOV AX, 0B800H { Do not repeat MOV ES, AX { futher! } XOR DI,DI MOV CX, 80*25 XOR AX,AX REP STOSW 24

Examples of programs Block-diagr of using STOSB/W for filling 10th line of Pc screen by number 3. 25 25

Examples of programs Example of using STOSB/W for filling 10th line of Pc screen by number 3. MOV DI, 160*10 (1 -2 bytes!) MOV CX, 80 MOV AX, 1E33Н (33Н – ASCII code for 3) REP STOSW 26

Block-diagr for filling the colomn. Examples of programs Block-diagr for filling the colomn. 27 27

Self-control questions Groups of instr 8086 Far and long jumps. Поясните особенности команд работы с цепочками и сегментных регистров. Приведите примеры использования команд работы с цепочками. Приведите пример программы циклического опроса 20 портов и укажите использованные виды адресации 28