3.6 Data transfer Instructions

Slides:



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

Addressing modes The way in which an operand is specified is called the Address Mode.
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 8: Data Transfer Instructions.
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.
Chapter 3 Addressing Modes
6-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 Addressing modes.
Using the Assembler Chapter 4 Operators and Expressions
Lect 3: Instruction Set and Addressing Modes. 386 Instruction Set (3.4) –Basic Instruction Set : 8086/8088 instruction set –Extended Instruction Set :
The 8086 Assembly Programming Data Allocation & Addressing Modes
Target Processor Directives , When using.386, the program can only run on 386 and above processors.
7-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Introduction to Assembly.
8-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Microprocessor Systems Design I
Microprocessor Systems Design I Instructor: Dr. Michael Geiger Spring 2013 Lecture 4: 80386DX memory, addressing.
Topic – string – Ch. 11 [Marut] Ch. 4 [Brey] String Data Transfer Instructions – The Direction Flag – LODS Instructions – STOS Instructions – MOVS Instructions.
Lect 4: Instruction Set and Addressing Modes. 386 Instruction Set (3.4)  Basic Instruction Set : 8086/8088 instruction set  Extended Instruction Set.
CDP ECE Spring 2000 ECE 291 Spring 2000 Lecture 7: More on Addressing Modes, Structures, and Stack Constantine D. Polychronopoulos Professor, ECE.
3.7 String Instructions Specifying the Operands’ Size and Address and the String Direction STRING = a data collection in memory. String ELEMENTS can be:
Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.
Click to add Title Comunicación y Gerencia Click To add Subtitle Click to add Text Fundamentals of Assembly Language.
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 4.
Overview of Assembly Language Chapter 4 S. Dandamudi.
Khaled A. Al-Utaibi  I/O Ports  I/O Space VS Memory Space  80x86 I/O Instructions − Direct I/O Instructions − Indirect I/O Instructions.
Microprocessors used in Personal Computers. The Memory Map of a Personal Computers Transient Program Area (TPA): Holds the operating system (interrupt.
MOV Instruction MOV destination,source  MOV AX,BX  MOV SUM,EAX  MOV EDX,ARRAY[EBX][ESI]  MOV CL,5  MOV DL,[BX]
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Assembly Language Data Movement Instructions. MOV Instruction Move source operand to destination mov destination, source The source and destination are.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Khaled A. Al-Utaibi  Introduction  The MOV Instruction  The LEA Instruction  The Stack Instructions  The String Data Transfer.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Instruction set Architecture
Presentation on Real Mode Memory Addressing
Microprocessor Systems Design I
Microprocessor Systems Design I
Microprocessor Systems Design I
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
ADDRESSING MODES.
Microprocessor Systems Design I
Chapter 4 Data Movement Instructions
EE3541 Introduction to Microprocessors
Assembly IA-32.
ADDRESSING MODES.
Assembly Lang. – Intel 8086 Addressing modes – 1
Morgan Kaufmann Publishers Computer Organization and Assembly Language
INSTRUCTION SET OF 8086 PAWAN KUMAR SINGH.
Defining Types of data expression Dn [name] expression Dn [name]
Symbolic Instruction and Addressing
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
Stack and Subroutines Module M17.1 Section 11.2.
8086 MICROPROCESSOR PROGRAMMING – INTEGER INSTRUCTIONS AND COMPUTATIONS Amar Saraswat.
Chapter 4 Data Movement Instructions
8086 Registers Module M14.2 Sections 9.2, 10.1.
اصول اساسی برنامه نویسی به زبان اسمبلی
Morgan Kaufmann Publishers Computer Organization and Assembly Language
32-bit instruction mode(80386-Pentium 4 only)
Symbolic Instruction and Addressing
(Array and Addressing Modes)
Chapter 3: Addressing Modes
Symbolic Instruction and Addressing
(Array and Addressing Modes)
CNET 315 Microprocessor & Assembly Language
3.6 Data transfer Instructions
Lecture 06 Programming language.
Data Movement Instructions
Assembler Directives end label end of program, label is entry point
Chapter 6 –Symbolic Instruction and Addressing
(Array and Addressing Modes)
Presentation transcript:

3.6 Data transfer Instructions The XCHG instruction Supposing AX=1234H, BX=5678H XCHG AX, BX After execution of XCHG, BX=1234H, AX=5678H The BSWAP instruction (386+ only) …and after execution of BSWAP EAX EAX before...

3.6 Data transfer Instructions The XLAT instruction Example: Supposing BX=200H, AL=4, DS=100H, Mem(1204H)=55H. XLAT After XLAT, AL=55H The LEA instruction Examples: LEA SI, [200H] The second operand specifies the memory location at the address 200H, so value 200H is loaded into SI MOV SI, [200H] The second operand specifies the memory location at the address 200H, so the content of memory locations at address 200H and 201H is loaded into SI Supposing (BX=20H, DI=1000H): LEA SI, [DI+BX+5H] Value 1025H is loaded into SI.

3.6 Data transfer Instructions The LDS, LES, LFS, LGS, LSS instructions Example: LDS SI, [200H] The content of memory 200H and 201H is loaded into SI, and the content of memory 202H and 203H is loaded into DS. Example: LSS ESP,FWORD PTR NEWSTACK The content of memory from address NEWSTACK to NEWSTACK+5 is loaded into ESP and SS.

3.6 Data transfer Instructions Assembler directives BYTE PTR, WORD PTR, DWORD PTR, FWORD PTR, OFFSET, SEG and DF BYTE PTR = byte pointer => the operand is a byte at the specified address in memory WORD PTR = word pointer => the operand is a word at the specified address in memory DWORD PTR = double word pointer => the operand is a double word at the specified address in memory FWORD PTR = far word pointer => the operand is a far word pointer at the specified address in memory (the four bytes at lower addresses specifying the offset and the other two bytes specifying the segment) When the operand in memory was defined using DB, DW, DD or DF the directives above are useless. DF =define far word => reserves memory space and define such a far word pointer (similar to DB) OFFSET => the operand the offset of the specified address in memory SEG = segment => the operand the value of the segment used to declare the specified data Examples: MOV WORD PTR [SI],5 The value 5 is completed at 16 bits and is loaded into memory at the address specified by DS:SI. LEA DX, MESSAGE MOV DX, OFFSET MESSAGE The same effect , but MOV instruction is faster and shorter MOV AX, SEG MESSAGE MOV DS, AX Identify the segment used when declared data MESSAGE, and load its value in DS (in two steps).