Introduction to Computer Engineering by Richard E. Haskell Move and Exchange Instructions Module M16.1 Section 10.2.

Slides:



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

Introduction to Computer Engineering by Richard E. Haskell Direct Addressing Module M18.1 Sections
COMP 2003: Assembly Language and Digital Logic
Introduction to Computer Engineering by Richard E. Haskell Multiplication and Division Instructions Module M16.4 Section 10.4.
1 x86’s instruction sets. 2 Instruction Set Classification  Transfer Move  Arithmetic Add / Subtract Mul / Div, etc.  Control Jump Call / Return, etc.
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.
Department of Computer Science and Software Engineering
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
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.
Stack Memory H H FFFFF H FFFFE H SS 0105 SP 0008 TOS BOS BOS = FFFF = 1104F H H 1104F H.
Data Movement Instructions
Gursharan Singh Tatla 21-Nov-20101www.eazynotes.com.
8086 : INSTRUCTION SET By, Pramod Sunagar Assistant Professor
Introduction to Computer Engineering by Richard E. Haskell Register Indirect Addressing Module M18.2 Section 12.3.
9-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 4 Data Movement Instructions by.
Microcomputer & Interfacing Lecture 3
Lect 4: Instruction Set and Addressing Modes. 386 Instruction Set (3.4)  Basic Instruction Set : 8086/8088 instruction set  Extended Instruction Set.
COSC 456 Lesson 8 Cool Codes ADD AL,SIAL AL + SI ADD AL,[SI]AL AL + [SI] INC BXBX BX + 1 INC [BX]Ambiguity error INC BYTE PTR [BX][BX] [BX] + 1 INC WORD.
ECE291 Computer Engineering II Lecture 3 Josh Potts University of Illinois at Urbana- Champaign.
Strings, Procedures and Macros
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 4 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Addressing Modes of 8086 Processor Ammar Anwar Khan Electrical Engineer King Saud University Riyadh Saudi Arabia.
ECE291 Computer Engineering II Lecture 3 Josh Potts University of Illinois at Urbana- Champaign.
1 ASSEMBLING THE "INC" INSTRUCTION INSTRUCTIONOPERATION CODE INC AX40h INC CX41h INC DX42h 4h _h INC AX INC CX INC DX I R.
ECE291 Computer Engineering II Lecture 3 Dr. Zbigniew Kalbarczyk University of Illinois at Urbana- Champaign.
University of Tehran 1 Microprocessor System Design Omid Fatemi Machine Language Programming
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
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.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
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.
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
Microprocessor and Assembly Language
Chapter 4 Data Movement Instructions
EE3541 Introduction to Microprocessors
Assembly IA-32.
INSTRUCTION SET.
Assembly Language Programming Part 2
Chapter 3 Addressing Modes
9/17/2018 Kiến Trúc Máy Tính.
اصول اساسی برنامه نویسی به زبان اسمبلی
Arithmetic Instructions
Symbolic Instruction and Addressing
X86’s instruction sets.
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.
שפת סף וארכיטקטורה של מעבד 8086
Stack and Subroutines Module M17.1 Section 11.2.
Programming 8086 – Part IV Stacks, Macros
8086 MICROPROCESSOR PROGRAMMING – INTEGER INSTRUCTIONS AND COMPUTATIONS Amar Saraswat.
ارايه دهنده : حسن عسكرزاده
Chapter 4 Data Movement Instructions
8086 Registers Module M14.2 Sections 9.2, 10.1.
CS-401 Computer Architecture & Assembly Language Programming
اصول اساسی برنامه نویسی به زبان اسمبلی
Morgan Kaufmann Publishers Computer Organization and Assembly Language
32-bit instruction mode(80386-Pentium 4 only)
Symbolic Instruction and Addressing
Data formats or Instruction formats of 8086:
Symbolic Instruction and Addressing
Lecture 06 Programming language.
University of Gujrat Department of Computer Science
Introduction to 8086 Assembly Language Programming
UNIT-II Assembly Language Programs Involving Logical
Chapter 6 –Symbolic Instruction and Addressing
CNET 315 Microprocessor & Assembly Language
Presentation transcript:

Introduction to Computer Engineering by Richard E. Haskell Move and Exchange Instructions Module M16.1 Section 10.2

Introduction to Computer Engineering by Richard E. Haskell MOV Move Instruction Can move immediate data to a register or memory (but not a segment register). Can move data from a register to a register. Can move data from a register to memory. Can move data from memory to a register. Can NOT use MOV instruction to move data directly from one memory location to another. But can use MOVS instruction.

Introduction to Computer Engineering by Richard E. Haskell

Some MOV Instructions

Introduction to Computer Engineering by Richard E. Haskell Table A2.a Opcode Map OR b AL,imm OR w AX,imm SBB b AL,imm SBB w AX,imm SUB b AL,imm SUB w AX,imm CMP b AL,imm CMP w AX,imm 89ABCDEF A B C D E F MOV AX,imm MOV CX,imm MOV DX,imm MOV BX,imm MOV SP,imm MOV BP,imm MOV SI,imm MOV DI,imm TEST b AL,imm TEST w AL,imm OR b r/m,reg OR w OR bOR w reg,r/m SBB bSBB w SBB bSBB w SUB b SUB w SUB b SUB w CMP bCMP w CMP bCMP w PUSH CS PUSH DS POP DS SEGMENT CS SEGMENT DS DAS AAS DEC AX DEC CX DEC DX DEC BX DEC SP DEC BP DEC SI DEC DI POP AX POP CX POP DX POP BX POP SP POP BP POP SI POP DI JSJNS JP/JPEJNP/JPOJL/JNGEJNL/JGEJLE/JNG JNLE/JG MOV b r/m,reg MOV W r/m,reg MOV b reg,r/m MOV W reg,r/m MOV r/m,seg LEA reg,r/m MOV seg,r/m LAHFSAHF POPFPUSHF WAIT CALL inter CBW CWD STOS bSTOS wLODS bLODS wSCAS b SCAS w RET inter+ RET inter INT type INTINTOIRET ESC CALL intra JMP intra JMP inter JMP short IN b AL,DX IN w AX,DX OUT b DX,AL OUT w DX,AX CLC STCCLISTI CLD STD** POP r/m mov bx,ax 8B D8

Introduction to Computer Engineering by Richard E. Haskell Postbyte modregr/m mov bx,ax 8B mov w reg,r/m reg = bx = mod = 11 r/m = ax = = D8 mov bx,ax 8B D8

Introduction to Computer Engineering by Richard E. Haskell Table A2.a Opcode Map OR b AL,imm OR w AX,imm SBB b AL,imm SBB w AX,imm SUB b AL,imm SUB w AX,imm CMP b AL,imm CMP w AX,imm 89ABCDEF A B C D E F MOV AX,imm MOV CX,imm MOV DX,imm MOV BX,imm MOV SP,imm MOV BP,imm MOV SI,imm MOV DI,imm TEST b AL,imm TEST w AL,imm OR b r/m,reg OR w OR bOR w reg,r/m SBB bSBB w SBB bSBB w SUB b SUB w SUB b SUB w CMP bCMP w CMP bCMP w PUSH CS PUSH DS POP DS SEGMENT CS SEGMENT DS DAS AAS DEC AX DEC CX DEC DX DEC BX DEC SP DEC BP DEC SI DEC DI POP AX POP CX POP DX POP BX POP SP POP BP POP SI POP DI JSJNS JP/JPEJNP/JPOJL/JNGEJNL/JGEJLE/JNG JNLE/JG MOV b r/m,reg MOV W r/m,reg MOV b reg,r/m MOV W reg,r/m MOV r/m,seg LEA reg,r/m MOV seg,r/m LAHFSAHF POPFPUSHF WAIT CALL inter CBW CWD STOS bSTOS wLODS bLODS wSCAS b SCAS w RET inter+ RET inter INT type INTINTOIRET ESC CALL intra JMP intra JMP inter JMP short IN b AL,DX IN w AX,DX OUT b DX,AL OUT w DX,AX CLC STCCLISTI CLD STD** POP r/m mov bx,ax 8B D8 mov bx,ax 89 C3

Introduction to Computer Engineering by Richard E. Haskell Postbyte modregr/m mov bx,ax 89 mov w r/m, reg reg = ax = mod = 11 r/m = bx = = C3 mov bx,ax 89 C3

Introduction to Computer Engineering by Richard E. Haskell Postbyte modregr/m mov bl,[si] 8A mov b reg, r/m reg = bl = mod = 00 r/m = si = = 1C mov bl,[si] 8A 1C Move byte pointed to by si into BL

Introduction to Computer Engineering by Richard E. Haskell XCHG Exchange Instruction Can exchange AX with a 16-bit register. Can exchange an 8-bit register with another 8-bit register or an 8-bit byte in memory. Can exchange a 16-bit register with another 16-bit register or a 16-bit word in memory.

Introduction to Computer Engineering by Richard E. Haskell XCHG Instruction MachineAssembly Language Code InstructionOperation 9XXCHG reg16 Exchange AX and reg16 86 PBXCHG b r/m,reg Exchange r/m and reg bytes 87 PBXCHG w r/m,reg Exchange r/m and reg words

Introduction to Computer Engineering by Richard E. Haskell Table A2.a Opcode Map

Introduction to Computer Engineering by Richard E. Haskell Postbyte modregr/m xchg bh,al 86 xchg b r/m,reg reg = al = mod = 11 r/m = bh = = C7 xchg bh,al 86 C7