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

Презентация:



Advertisements
Похожие презентации
HPC Pipelining Parallelism is achieved by starting to execute one instruction before the previous one is finished. The simplest kind overlaps the execution.
Advertisements

CEG 320/520: Computer Organization and Assembly Language Programming1 Computer Organization and Assembly Language Programming.
© 2005 Cisco Systems, Inc. All rights reserved. BGP v Route Selection Using Policy Controls Applying Route-Maps as BGP Filters.
UNIT 2. Introduction to Computer Programming. COM E 211: Basic Computer Programming UNIT 2. Introduction to Computer Programming Algorithm & Flowcharting.
© 2006 Cisco Systems, Inc. All rights reserved. CVOICE v Configuring Voice Networks Configuring Dial Peers.
Lecture # Computer Architecture Computer Architecture = ISA + MO ISA stands for instruction set architecture is a logical view of computer system.
© 2009 Avaya Inc. All rights reserved.1 Chapter Two, Voic Pro Components Module Two – Actions, Variables & Conditions.
The 8085 is an 8-bit general purpose microprocessor that can address 64K Byte of memory. It has 40 pins and uses +5V for power. It can run at a maximum.
© 2006 Cisco Systems, Inc. All rights reserved. HIPS v Configuring Groups and Policies Configuring Policies.
Linear Block Codes Mahdi Barhoush Mohammad Hanaysheh.
© 2005 Cisco Systems, Inc. All rights reserved.INTRO v Building a Simple Ethernet Network Understanding How an Ethernet LAN Works.
Operators and Arithmetic Operations. Operators An operator is a symbol that instructs the code to perform some operations or actions on one or more operands.
Sequences Sequences are patterns. Each pattern or number in a sequence is called a term. The number at the start is called the first term. The term-to-term.
Parachuting, also known as skydiving, is the activity of jumping from enough height to deploy a fabric parachute and land. Parachuting is performed as.
Организация циклов в Ассемблере. Цикл – это многократно повторяющаяся последовательность операторов.
11 BASIC DRESS-UP FEATURES. LESSON II : DRESS UP FEATURES 12.
Loops Objectives Students will: 1. Explain what a loop is and describe the three main types of loops used in programming. 1. Дать понятие циклам. И объяснить.
What to expect? How to prepare? What to do? How to win and find a good job? BUSINESS ENGLISH COURSE NOVA KAKHOVKA GUMNASUIM 2012.
© 2009 Avaya Inc. All rights reserved.1 Chapter Three, Voic Pro Advanced Functions Module Three – TAPI.
© 2009 Avaya Inc. All rights reserved.1 Chapter Three, Voic Pro Advanced Functions Module Four – Voic Campaigns.
Транксрипт:

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

Content 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 The major new feature of the microprocessor was protected mode. Instruction set was changed by adding some new instructions to the existing six groups.

5 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.

Basics of instruction set of MP or MC 3 types of instruction format jump.com/ jump.com/ 6

7 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

8 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.

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

10 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 - =; JL/JNGE -

11 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).

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

13 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: MOV CX, 1000 M1: LOOP M1

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

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

16 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

17 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.

18 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

19 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

20 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.

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

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

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

24 Work with chains 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

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

26 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

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

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