Data Transfer Instructions www.ustudy.in. Introduction The data transfer instructions are used to move data between internal register or between internal.

Slides:



Advertisements
Similar presentations
Microprocessor Fundamentals Week 5 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.
Advertisements

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.
Department of Computer Science and Software Engineering
Lect 3: Instruction Set and Addressing Modes. 386 Instruction Set (3.4) –Basic Instruction Set : 8086/8088 instruction set –Extended Instruction Set :
80x86 Instruction Set Dr. Qiang Lin.
Chapter 6 Symbolic Instructions and Addressing. Data Transfer Instructions 資料傳輸指令 The MOV Instruction: [label:] MOV register/memory, register/memory/immediate.
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.
Assembly 02. Outline mov Command Registers Memory EFLAGS Arithmetic 1.
KMUTT: S. Srakaew Instructions Can Be Divided into 3 Classes Data movement instructions  Move data from a memory location or register to another memory.
CHAPTER 7 ASSEMBLY LANGUAGE INSTRUCTIONS
1 Lecture 4: Data Transfer, Addressing, and Arithmetic Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
Flow Control Instructions
CS2422 Assembly Language & System Programming September 28, 2006.
Microprocessor Systems Design I
Chapter 4 Basic Instructions. 4.1 Copying Data mov Instructions mov (“move”) instructions are really copy instructions, like simple assignment statements.
Lect 4: Instruction Set and Addressing Modes. 386 Instruction Set (3.4)  Basic Instruction Set : 8086/8088 instruction set  Extended Instruction Set.
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.
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
ECE291 Computer Engineering II Lecture 3 Josh Potts University of Illinois at Urbana- Champaign.
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 4 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
UHD:CS2401: A. Berrached1 The Intel x86 Hardware Organization.
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.
ECE291 Computer Engineering II Lecture 3 Josh Potts University of Illinois at Urbana- Champaign.
ECE291 Computer Engineering II Lecture 3 Dr. Zbigniew Kalbarczyk University of Illinois at Urbana- Champaign.
Review of Assembly language. Recalling main concepts.
Fall 2012 Chapter 4: Data Transfers, Addressing, and Arithmetic.
Microprocessor & Assembly Language Arithmetic and logical Instructions.
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Comparison Instructions Test instruction –Performs an implied AND operation between each of the bits in 2 operands. Neither operand is modified. (Flags.
Assembly Language Data Movement Instructions. MOV Instruction Move source operand to destination mov destination, source The source and destination are.
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.
CS2422 Assembly Language and System Programming 0 Week 9 Data Transfers, Addressing, and Arithmetic.
Instruction set Architecture
Format of Assembly language
Data Transfers, Addressing, and Arithmetic
Microprocessor Systems Design I
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
ADDRESSING MODES.
Microprocessor Systems Design I
Chapter 4 Data Movement Instructions
Assembly IA-32.
ADDRESSING MODES.
Assembly Lang. – Intel 8086 Addressing modes – 1
Arithmetic Instructions
Assembly Language for Intel-Based Computers, 4th Edition
Defining Types of data expression Dn [name] expression Dn [name]
Symbolic Instruction and Addressing
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.
Data Transfers, Addressing, and Arithmetic
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
Symbolic Instruction and Addressing
CNET 315 Microprocessor & Assembly Language
University of Gujrat Department of Computer Science
Computer Architecture CST 250
UNIT-II Assembly Language Programs Involving Logical
Chapter 6 –Symbolic Instruction and Addressing
Chapter 8: Instruction Set 8086 CPU Architecture
Division instruction.
Presentation transcript:

Data Transfer Instructions

Introduction The data transfer instructions are used to move data between internal register or between internal register and the memory. The content of the source remains the same after the execution of data transfer instructions. Flags are not affected by any of the instruction in the group.

MOV instruction Move from source to destination. Syntax: MOV destination, source – Transfers data referenced by the address of the second operand to the address of the first operand – Destination has to have the same length as source [label:] MOV register/memory register/memory/immediate Example: MOV F, AX; // Move content of AX to the variable F MOV CX, D;// Move value of D to CX MOV ES, AX MOV AX, 215

Examples on MOV BYTEFLDDB?; define byte WORDFLDDW?; define word … MOV EDX, ECX; register to register MOV BYTEFLD, DH; register to memory MOV WORDFLD, 1234; immediate to memory MOV CH, BYTEFLD; memory to register MOV CX, 40H; immediate to register MOV AX, DS; segment register to register

MOV instruction types The following are the MOV instruction types, based on the data items. 1.Immediate moves 2.Register moves 3.Direct memory moves 4.Segment register moves 5.Move and fill instructions 6.Move string instruction

Immediate Moves This type of MOV instruction moves the data in the form of byte or word data into memory location or register Examples MOV AX, 25 This instruction transfers the data 25 immediate to register AX. MOV BYTEVAL, 25 This instruction transfers the byte value data 25 immediate to memory. MOV WORDVAL[BX], 25 This instruction transfers the word value data 2 immediate to memory.

Register Moves This type of MOV instructions moves the data between internal register, or segment reg to register or register to memory. Examples MOV DS, AX This instruction transfers the 16 bit content of AX register to segment register. MOV BYTEVAL, BH This instruction transfers 8 bit data from register BH to memory using direct addressing.

Direct Memory Moves This type of MOV instruction moves the data in the form of byte or word data from memory to register. Examples MOV BH, BYTEVAL This instruction copies a 8 bit data from memory to register using direct addressing. MOV AX, WORDVAL[BX] This instruction transfers a 16 bit data from memory to AX register. The physical address is got by adding the effective address in BX register and the base address in DS register.

Segment Register Moves This type of MOV instruction moves the data from segment register to memory or register. Examples MOV AX, DS This instruction transfer a data from segment register to register AX. MOV WORDVAL, DS This instruction transfers a data from segment register to memory location

Move And Fill Instructions Move-and-Fill Instructions: MOVSX and MOVZX For the MOV instruction, size of source and destination must be same (eg, byte- to-byte, word-to-word). For MOVSX and MOVZX instructions facilitate transferring data from a byte or word source to a word or doubleword destination. Format for MOVSX and MOVZX instructions: [Label:]MOVSX/MOVZXregister/memory, register/memory/immediate

Data Transfer Instructions MOVSX used with signed arithmetic value. moves a byte or word to destination with size of word or double word and all the leftmost bits of destination will be filled with the sign bit. MOVSX CX, B; CX = MOVZX used with unsigned arithmetic value moves a byte or word to destination with size of word or double word and the leftmost bit of destination will be filled with the value 0. MOVZXCX, B; CX =

Examples: MOVSXAX, B; AX = MOVZXAX, B; AX =

XCHG Instruction This instruction is used to change the value of source into that of the destination and vice versa. The format for this instruction: Example: WORDQDW?; Word data item... XCHG CL, BH ; exchange the content of the 2 registers XCHG CX, WORDQ ; exchange the content between register ; and memory [Label :]XCHGregister/memory, register/memory

The End