3.6 Data transfer Instructions

Slides:



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

There are two types of addressing schemes:
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 2 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Chapter four – The 80x86 Instruction Set Principles of Microcomputers 2015年5月14日 2015年5月14日 2015年5月14日 2015年5月14日 2015年5月14日 2015年5月14日 1 Chapter Four.
Lect 3: Instruction Set and Addressing Modes. 386 Instruction Set (3.4) –Basic Instruction Set : 8086/8088 instruction set –Extended Instruction Set :
Data Movement Instructions
Computer Organization And Assembly Language
8086 : INSTRUCTION SET By, Pramod Sunagar Assistant Professor
Assembly Language for Intel-Based Computers Chapter 5: Procedures Kip R. Irvine.
Practical Session 3. The Stack The stack is an area in memory that its purpose is to provide a space for temporary storage of addresses and data items.
Room: Timbalan Pengarah Pusat Komputer Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 4: Introduction.
Practical Session 3. The Stack The stack is an area in memory that its purpose is to provide a space for temporary storage of addresses and data items.
8-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
TK 2633 Microprocessor & Interfacing
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 4 Data Movement Instructions by.
80x86 Processor Architecture
Web siteWeb site ExamplesExamples Irvine, Kip R. Assembly Language for Intel-Based Computers, Stack Operations Runtime Stack PUSH Operation POP.
Chapter 3: Addressing Modes. Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. The Intel Microprocessors:
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:
Stack Operations LIFO structure (last-in,first-out) –The last value put into the stack is the first value taken out Runtime stack –A memory array that.
The x86 Architecture Lecture 15 Fri, Mar 4, 2005.
Lecture 21. _getproc proc near pushf ;Secure flag register contents push di ;== Determine whether model came before or after === xor ax,ax ;Set.
Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.
1 The Stack and Procedures Chapter 5. 2 A Process in Virtual Memory  This is how a process is placed into its virtual addressable space  The code is.
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.
Addressing Modes. Addressing Mode The data is referred as operand. The operands may be contained in registers, memory or I/O ports, within the instruction.
MOV Instruction MOV destination,source  MOV AX,BX  MOV SUM,EAX  MOV EDX,ARRAY[EBX][ESI]  MOV CL,5  MOV DL,[BX]
Assembly Language Data Movement Instructions. MOV Instruction Move source operand to destination mov destination, source The source and destination are.
Khaled A. Al-Utaibi  Introduction  The MOV Instruction  The LEA Instruction  The Stack Instructions  The String Data Transfer.
CSC 221 Computer Organization and Assembly Language Lecture 15: STACK Related Instructions.
Internal Programming Architecture or Model
MICROPROCESSOR, PROGRAMMING & INTERFACING Tutorial 4 – Module 4.
BITS Pilani Pilani Campus Pawan Sharma Lecture EEE /INSTR/CS F241 ES C263 Microprocessor Programming and Interfacing.
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.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Data Movement Instructions A Course in Microprocessor Electrical Engineering Department Universitas 17 Agustus 1945 Jakarta.
Practical Session 3.
Stack Operations Dr. Hadi AL Saadi.
Computer Architecture and Assembly Language
Lecture 2 Programming of 8086 Лектор: Люличева И.А. 1.
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
Instruksi Set Prosesor 8088
Microprocessor and Assembly Language
Chapter 4 Data Movement Instructions
EE3541 Introduction to Microprocessors
Machine control instruction
Chapter 3 Addressing Modes
Computer Organization and Assembly Language (COAL)
Symbolic Instruction and Addressing
Subject Name: Microprocesor Subject Code: 10CS45
Chapter 4: Instructions
Data Addressing Modes • MOV AX,BX; This instruction transfers the word contents of the source-register(BX) into the destination register(AX). • The source.
3.6 Data transfer Instructions
Stack and Subroutines Module M17.1 Section 11.2.
Chapter 4 Data Movement Instructions
8086 Registers Module M14.2 Sections 9.2, 10.1.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
Chapter 3: Addressing Modes
Practical Session 4.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
EE6502/MPMC/UNIT II/STACK AND SUBROUTINE/T.THARANKUMAR
Lecture 06 Programming language.
Addressing Modes MOV AX,BX Destination Source Data-Addressing Modes.
Data Movement Instructions
Chapter 6 –Symbolic Instruction and Addressing
Computer Organization and Assembly Language
Presentation transcript:

3.6 Data transfer Instructions The MOV instruction Byte 30H is loaded into AL Examples: MOV AL,30H MOV AX,30H Word 0030H is loaded into AX MOV [SI],0 Ambiguous: byte, word, double-word? Word 0000H is loaded into memory at address [SI] MOV WORD PTR [SI],0 Only 386+ AL=28H MOVSX BX,AL BX  0028H Supposing: AL=91H MOVSX BX,AL BX  FF91H AL=91H MOVZX BX,AL BX  0091H

3.6 Data transfer Instructions The PUSH and POP instructions STACK= LIFO list in memory, increasing toward 0. ... PUSH AX Examples: supposing: DS=4000H SS=0500H SP=0300H BP=0200H AX=1234H mem(40204H)=3FH mem(40205H)=2FH EBX=55AA66BBH PUSHW SP PUSHW [BP+4] PUSHD EBX ... Ph.Add.=DS*10H+BP+4 Initial stack-top … POPD EBX (EBX)55AA66BBH POPW [BP+4] mem(40204H)  3FH mem(40205H)  2FH POPW SP POP BX ... SP  2FEH BX  1234H

3.6 Data transfer Instructions The PUSHA and POPA instructions Examples: supposing: SS=0320H SP=0800H AX=00FFH CX=EEDDH DX=CCBBH BX=AA99H BP=6655H SI=4433H DI=2211H PUSHA order ... PUSHA POPA ... POPA order

3.6 Data transfer Instructions The PUSHF, PUSHFD, POPF and POPFD instructions It is not mandatory that a value pushed onto stack from a register (memory location) to be popped in the same register (memory location). But it is a usual way to do so, using a sequence of PUSH instructions at a point in program, and a corresponding reversed sequence of POP instructions later. The correct handling of the stack is the programmer responsibility. CALL, INT and RET affect stack also.

3.6 Data transfer Instructions The IN instruction A byte is read in AL from input port at address 0030H Input port address can be expressed direct (8 bits) or register indirect using DX (16 bits). Examples (DX=01FF): IN AL,30H IN AX,DX The destination is always the accumulator. A byte can be input using AL, a word using AX or a double word using EAX. A word is read in AX from input port at address 01FFH The OUT instruction A byte is written from AL at output port at address 01FFH Output port address can be expressed direct (8 bits) or register indirect using DX (16 bits). The source is always the accumulator. A byte can be output using AL, a word using AX or a double word using EAX. Examples (DX=01FF): OUT DX, AL OUT 30H, AX A word is written from AX at output port at address 0030H

3.6 Data transfer Instructions The INS instruction Input port address is always expressed register indirect using DX (16 bits). The destination is the memory location addressed by ES:DI. A byte, a word or a double word can be input. After input, DX is automatically incremented (or decremented - depending on processor direction flag) by 1, 2 or 4. The OUTS instruction Output port address is always expressed register indirect using DX (16 bits). The source is the memory location addressed by SI. A byte, a word or a double word can be output. After output, DX is automatically incremented (or decremented - depending on processor direction flag) by 1, 2 or 4.