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

Slides:



Advertisements
Similar presentations
There are two types of addressing schemes:
Advertisements

MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
80x86 Instruction Set Dr. Qiang Lin.
8-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
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Microprocessor Microprocessor (cont..) It is a 16 bit μp has a 20 bit address bus can access upto 220 memory locations ( 1 MB). It can support.
Intel 8086 (8088) Microprocessor Structure
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Internal Programming Architecture or Model
BITS Pilani Pilani Campus Pawan Sharma ES C263 Microprocessor Programming and Interfacing.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
ΜComputer Structure μProcessor Memory Bus System I/O Ports.
The 8085A is a general-purpose microprocessor with low hardware overhead requirements. Within the 8085A are contained the functions of clock generation,
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
Unit Microprocessor.
Seminar On 8085 microprocessor
Assembly language programming
COURSE OUTCOMES OF Microprocessor and programming
Instruction set Architecture
Format of Assembly language
Microprocessor and Assembly Language
Part of the Assembler Language Programmers Toolbox
UNIT Architecture M.Brindha AP/EIE
UNIT – Microcontroller.
Introduction to 8086 Microprocessor
8086 Microprocessor.
Computer Organization & Assembly Language Chapter 3
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
Lecture on Microcomputer
ADDRESSING MODES.
Introduction of microprocessor
Intel 8086 MICROPROCESSOR Architecture.
EE3541 Introduction to Microprocessors
Assembly Language Programming Part 2
ADDRESSING MODES.
University of Gujrat Department of Computer Science
Intel 8088 (8086) Microprocessor Structure
CNET 315 Microprocessor & Assembly Language
Assembly Lang. – Intel 8086 Addressing modes – 1
Chapter 3 Addressing Modes
Symbolic Instruction and Addressing
Introduction to Assembly Language
BIC 10503: COMPUTER ARCHITECTURE
Data Addressing Modes • MOV AX,BX; This instruction transfers the word contents of the source-register(BX) into the destination register(AX). • The source.
Number Representations and Basic Processor Architecture
University of Gujrat Department of Computer Science
Instruction cycle Instruction: A command given to the microprocessor to perform an operation Program : A set of instructions given in a sequential.
Chapter 4 Data Movement Instructions
Intel 8088 (8086) Microprocessor Structure
8086 Registers Module M14.2 Sections 9.2, 10.1.
Lecture 1 Instruction set of 8086 Лектор: Люличева И.А. 1.
INTEL
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
CS 301 Fall 2002 Computer Organization
(The Stack and Procedures)
Symbolic Instruction and Addressing
Lecture 06 Programming language.
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
Unit-I 80386DX Architecture
Chapter 6 –Symbolic Instruction and Addressing
Process.
CNET 315 Microprocessor & Assembly Language
AGENDA Architecture Microprocessor Communication and Bus Timings
Intel 8086.
AGENDA Architecture Microprocessor Communication and Bus Timings
Microprocessor Lecture 7 (8086 Registers).
Presentation transcript:

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

Content Addressing modes of х86 Examples of programs Examples of using ports

Universal microprocessors instruction groups Instruction set of MP 8086 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. 3

Addressing modes The x86 processors support the register addressing mode , the immediate addressing mode, the direct addressing mode, implicit addressing mode, the indirect addressing mode, stack addressing mode, the base plus index addressing modes, and the base relative plus index addressing mode. 4

Addressing modes Register operands are the easiest to understand. Consider the following forms of the mov instruction: mov ax, bx or mov ax, cx Constants are also pretty easy to deal with. Consider the following instructions: mov ax, 1e41h or add di, 160

Addressing modes Direct addressing mode to Memory we rear will use: Mov ax, [100] But to ports it may be useful: In al, 40h or In ax, 60h implicit addressing mode: STOWS, MOWSW, DAA, WIAT, NOP, LOOP Stack addressing mode uses SS:SP pair Instructions: Push, Pop, Call, Ret 6

Addressing modes the indirect addressing mode may be of 3 types 1. index – using DI or SI Mov es:[di], ax 2. base – using BX or BP Mov ax, ds:[bx] 3. indirect to ports Mov dx, 3E8h In ax, dx 7

Addressing modes the base plus index addressing modes we may use for two dimensional arrays: Mov ax, [bx+di] or add [bp+si], 2000h Index or base relative addressing mode (with the bias) we used in laboratory work N1: Mov ES:[DI+2000], AX 8

Addressing modes Indirect addressing modes for 16-bit x86 processors can be summarized by this formula:

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

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 11

Block-diagr for filling the colomn . 12 12

Examples of programs Example of filling the colomn by increasing code. MOV AX, 0B800H MOV ES, AX XOR DI,DI MOV CX, 25 MOV AX, 2F41H (41H – code of А) @L1:MOV ES:[DI], AX INC AX ADD DI, 160 LOOP @L1 13 13

Microprocessor based Systems contains: CPU (central processing unit) Microprocessor core Cash memory logic circuitry for communicating with the system bus: data/address bus driver, bus controller System memory stores both program code and data ROM, BIOS (read-only memory), RAM (random access memory) Timing unit generates clock signals and is responsible for the proper operation of all system hardware crystal oscillator and timing circuitry Interrupt circuitry mechanism for the processor to respond to special external events I/O, peripherals Dicks, monitor, keyboard, mouse, printer, …

Von Naiman Model of MP system 15

Input array of data from ports

8255 parallel port diagram

8251 serial port block-diagram

8253 timer block-diagram

Control words of timer

Examples of programs Input array of data from port 40H and output it to the colomn at the screen. XOR DI,DI MOV CX, 25 @L1: IN AX, 40H {40H – address of port} MOV ES:[DI], AX ADD DI, 80 LOOP @L1 21

Examples of programs Block-diagr for 100 times input arrays from ports with the delay. 1. Counter= (100) 2. Execute the subroutine of input array from port. 4. call delay 6. counter-- 7. Counter= 0? – of NOT go to p.2 else - END. 22

Main menu for the debugger 23

Changing state of registers 24

Self-control questions Groups of instr 8086 Far and long jumps. Addressing modes in the example 1 Addressing modes in the programm of input data from the ports 25