Handout 2 Digital System Engineering (EE-390)

Slides:



Advertisements
Similar presentations
Programming 8086 – Part IV Stacks, Macros
Advertisements

Register In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than.
Chapter 2 (cont.) An Introduction to the 80x86 Microprocessor Family Objectives: The different addressing modes and instruction types available The usefulness.
There are two types of addressing schemes:
COMP 2003: Assembly Language and Digital Logic
Introduction to 8086 Microprocessor
Computers organization & Assembly Language
ICS312 Set 6 Operands. Basic Operand Types (1) Register Operands. An operand that refers to a register. MOV AX, BX ; moves contents of register BX to.
1/2002JNM1 AL 00 Immediate Addressing Mode Mov AL, 3CH AL 3C.
Chapter 3 Addressing Modes
Chapter Four–80x86 Instruction Set Principles of Microcomputers 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 2015年5月17日 1 Chapter four 80x86.
6-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 Addressing modes.
CM404.12TO131 Name : C. S. Manjula, Grad IETE Designation : Lab Mechanic Branch: Computer Engineering Institute: S.P.W. Polytechnic, Tirupati, Semester:
Video systems (continue). Practice Modify the program to get a string from a keyboard to display the input string on the middle of the screen with reverse.
Lect 3: Instruction Set and Addressing Modes. 386 Instruction Set (3.4) –Basic Instruction Set : 8086/8088 instruction set –Extended Instruction Set :
Azir ALIU 1 What is an assembly language?. Azir ALIU 2 Inside the CPU.
Stack Memory H H FFFFF H FFFFE H SS 0105 SP 0008 TOS BOS BOS = FFFF = 1104F H H 1104F H.
Addressing modes – 1 The way in which an operand is specified is called the Address Mode.
The 8086 Assembly Programming Data Allocation & Addressing Modes
Addressing Modes Instruction – Op-code – Operand Addressing mode indicates a way of locating data or operands. – Any instruction may belong to one or more.
Microprocessor Systems Design I
80x86 Processor Architecture
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2013 Lecture 4: 80386DX memory, addressing.
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2014 Lecture 4: x86 memory.
Lect 4: Instruction Set and Addressing Modes. 386 Instruction Set (3.4)  Basic Instruction Set : 8086/8088 instruction set  Extended Instruction Set.
An Introduction to 8086 Microprocessor.
1/2002JNM1 Positional Notation (Hex Digits). 1/2002JNM2 Problem The 8086 has a 20-bit address bus. Therefore, it can access 1,048,576 bytes of memory.
Types of Registers (8086 Microprocessor Based)
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
UHD:CS2401: A. Berrached1 The Intel x86 Hardware Organization.
Click to add Title Comunicación y Gerencia Click To add Subtitle Click to add Text Fundamentals of Assembly Language.
10H Interrupt. Option 0H – Sets video mode. Registers used: – AH = 0H – AL = Video Mode. 3H - CGA Color text of 80X25 7H - Monochrome text of 80X25 Ex:
(-133)*33+44* *33+44*14 Input device memory calculator Output device controller Control bus data bus memory.
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.
University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
Addressing Modes Instruction – Op-code – Operand Addressing mode indicates a way of locating data or operands. – Any instruction may belong to one or more.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Computer Science 516 Intel x86 Overview. Intel x86 Family Eight-bit 8080, 8085 – 1970s 16-bit 8086 – was internally 16 bits, externally 8 bits.
ΜComputer Structure μProcessor Memory Bus System I/O Ports.
Instruction set Architecture
Microprocessor Systems Design I
Microprocessor Systems Design I
Introduction to 8086 Microprocessor
16.317: Microprocessor System Design I
ADDRESSING MODES.
16.317: Microprocessor System Design I
Microprocessor Systems Design I
EEM336 Microprocessors Laboratory Orientation
ADDRESSING MODES.
Intel 8088 (8086) Microprocessor Structure
Assembly Lang. – Intel 8086 Addressing modes – 1
Symbolic Instruction and Addressing
Introduction to Assembly Language
Data Addressing Modes • MOV AX,BX; This instruction transfers the word contents of the source-register(BX) into the destination register(AX). • The source.
שפת סף וארכיטקטורה של מעבד 8086
8086 MICROPROCESSOR PROGRAMMING – INTEGER INSTRUCTIONS AND COMPUTATIONS Amar Saraswat.
Intel 8088 (8086) Microprocessor Structure
8086 Registers Module M14.2 Sections 9.2, 10.1.
اصول اساسی برنامه نویسی به زبان اسمبلی
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
The Microprocessor & Its Architecture
Symbolic Instruction and Addressing
CNET 315 Microprocessor & Assembly Language
Computer Architecture CST 250
Unit-I 80386DX Architecture
Chapter 6 –Symbolic Instruction and Addressing
Presentation transcript:

Handout 2 Digital System Engineering (EE-390) (Ref: Text book and KFUPM Online course of EE-390) (Remember to solve all the related examples, exercises problems as given in the Syllabus)

MOV Statement 0202 01 00 IP CS SS DS ES AX BX CX DX SP BP SI DI SR Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0200 0100 XX P.A’s 00000 01200 8C MOV DX, CS 01201 CA 01202 XX Next Instruction 01203 FFFFF 0202 01 00

Addressing Modes Accumulator

A) Register Operand Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 02F0 0120 XX 1B D7 P.A’s 00000 014F0 8B MOV AX, BX 014F1 C3 014F2 XX Next Instruction 014F3 FFFFF 02F2 1B D7

A) Register Operand Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0260 45A2 1B D7 XX P.A’s 00000 45C80 8B MOV DL, BH 45C81 C3 45C82 XX Next Instruction 45C83 FFFFF 0262 1B

B) Immediate Operand Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0400 0210 XX P.A’s 00000 02500 B8 MOV AX, 4A1FH 02501 1F 02502 4A 02503 XX Next Instruction FFFFF 0403 4A 1F

B) Immediate Operand Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0400 0210 XX P.A’s 00000 02500 B6 MOV DH, 28H 02501 28 02502 XX Next Instruction FFFFF 0402 28 XX

Valid and Invalid Instructions MOV CL, AH  VALID MOV CX, SP  VALID MOV CH, DX  INVALID MOV 15H, AL  INVALID MOV CL, 1234H  INVALID MOV IP, CX  INVALID MOV CS, DS  INVALID MOV CL, 234H  INVALID

C) Memory Operand Addressing Mode 1) Direct Memory Addressing 2) Indirect Memory Addressing a) Register Indirect Addressing b) Based Addressing c) Indexed Addressing d) Based-Indexed Addressing

C) Memory Operand Addressing Mode PA = Segment Base Address (SBA) : Effective Address (EA) = SBA : EA EA (called Effective or Offset) is EA = Base + Index + Displacement PA = SBA : Base + Index + Displacement CS SS DS ES PA = : + + BX BP SI DI 8-bit displacement 16-bit displacement

1) Direct Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 6500 XX P.A’s 00000 03210 8B MOV CX, [52F1H] 03211 0E 03212 F1 03213 52 03214 XX Next Instruction 6A2F1 = DS:52F1 3F 6A2F2= DS:52F2 D2 FFFFF 0012 Code segment D2 3F data segment

1) Direct Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 6500 XX P.A’s 00000 03210 8A MOV CH, [52F1H] 03211 2E 03212 F1 03213 52 03214 XX Next Instruction 6500 : 52F1 = DS : 52F1 3F FFFFF 0014 3F XX

1) Direct Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 6500 52 XX P.A’s 00000 03210 88 MOV [52F1H], CH 03211 2E 03212 F1 03213 52 03214 XX Next Instruction 6500 : 52F1 = DS : 52F1 FFFFF 0014 52

2) Register Indirect Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 6500 XX 0528 P.A’s 00000 03210 8B MOV CX, [SI] 03211 1C 03212 XX Next Instruction 03213 03214 6500 : 0528 = DS : SI 5D 6500 : 0529 = DS : SI + 1 CA FFFFF 0012 CA 5D

2) Register Indirect Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 6500 XX 0528 P.A’s 00000 03210 8A MOV CL, [SI] 03211 0C 03212 XX Next Instruction 03213 03214 6500 : 0528 = DS : SI 5D FFFFF 0012 XX 5D

NOTE By default, using a direct address as [1FA4H], or a register indirect address as [SI] or [DI] assumes you are accessing the DATA SEGMENT. MOV AX, [1FA4H]  MOV AX, DS:[1FA4H] To access any other segment, use the “SEGMENT OVERIDE PREFIX” as MOV AX, CS:[1FA4H] MOV SS:[DI] , AX

3) Based Addressing Mode Base Register  Points to first address of data (Constant) Displacement  Contains number of bytes above base register where data of interest exists (Variable) When Base Register is BX PA = DS : BX + Displacement When Base Register is BP PA = SS : BP + Displacement These are default segments and Segment-Override Prefix changes them

3) Based Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 2577 6500 XX 12 10 15F8 P.A’s 00000 03210 8A MOV AL, [BX] + 2F10H 03211 87 03212 10 03213 2F 03214 XX Next Instruction 6500 : 1210 + 2F10 5D FFFFF 0014 XX 5D

3) Based Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 2577 6500 XX 12 10 15F8 P.A’s 00000 03210 8A MOV AL, [BP] + 2F10H 03211 86 03212 10 03213 2F 03214 XX Next Instruction 2577 : 15F8 + 2F10 5D FFFFF 0014 XX 5D

4) Indexed Addressing Mode Displacement  Points to first address of data (Constant) Index Register  Contains number of bytes above Displacement where data of interest exists (Variable) When Index Register is SI PA = DS : SI + Displacement When Base Register is DI PA = DS : DI + Displacement These are default segments and Segment-Override Prefix changes them

4) Indexed Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 2577 523C XX 76FF P.A’s 00000 03210 8A MOV AL, [SI] + 2F10H 03211 84 03212 10 03213 2F 03214 XX Next Instruction 523C : 76FF + 2F10 99 FFFFF 0014 XX 99

4) Indexed Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 2577 766A 12 10 8DA5 P.A’s 00000 03210 89 MOV [DI] + 2F10H, BX 03211 9C 03212 10 03213 2F 03214 XX Next Instruction 766A : 8DA5 + 2F10 766A : 8DA5 + 2F10 + 1 FFFFF 0014 10 12

5) Based-Indexed Addressing Mode Displacement  Points to first address of data (Constant) Base Register  Contains Matrix Column Number (Variable) Index Register  Contains Matrix Row Number (Variable) Regardless of using SI or DI When Base Register is BX PA = DS : BX + (SI or DI) + Displacement When Base Register is BP PA = SS : BP + (SI or DI) + Displacement These are default segments and Segment-Override Prefix changes them

5) Based-Indexed Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 2577 523C XX 12 34 76FF P.A’s 00000 03210 8A MOV AL, [BX][SI] + 2F10H 03211 80 03212 10 03213 2F 03214 XX Next Instruction 523C : 1234 + 76FF + 2F10 99 FFFFF 0014 XX 99

5) Based-Indexed Addressing Mode Mem. contents IP CS SS DS ES AX BX CX DX SP BP SI DI SR 0010 0320 2577 523C FF 77 12 34 76FF P.A’s 00000 03210 89 MOV [BP][SI] + 2F10H, AX 03211 82 03212 10 03213 2F 03214 XX Next Instruction 2577 : 1234 + 76FF + 2F10 FFFFF 0014 FF 77