Introduction to Computer Engineering by Richard E. Haskell Shift and Rotate Instructions Module M16.2 Section 10.3.

Slides:



Advertisements
Similar presentations
Machine Instructions Operations
Advertisements

Introduction to Computer Engineering by Richard E. Haskell BCD Arithmetic Module M16.5 Section 10.4.
Introduction to Computer Engineering by Richard E. Haskell Basic Digital Design Module M1.2 Section 3.2.
Introduction to Computer Engineering by Richard E. Haskell Multiplication and Division Instructions Module M16.4 Section 10.4.
NEG Instruction Change operand content into two’s complement (negative value) and stored back into its operand mov bl, b neg bl; bl = mov.
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. 05.c: Logical Operations Sumber: 1. Paul Carter, PC Assembly Language 2. Hamacher. Computer Organization,
Lecture 4 Basic Instructions Dr. Dimitrios S. Nikolopoulos CSL/UIUC.
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
Computer Organization & Assembly Language
80x86 Instruction Set Dr. Qiang Lin.
Logical, Shift, and Rotate Operations CS208. Logical, Shift and Rotate Operations  A particular bit, or set of bits, within the byte can be set to 1.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 7: Integer Arithmetic (c) Pearson Education, All rights reserved. You may modify.
Introduction to Computer Engineering by Richard E. Haskell Branching Instructions Module M17.2 Section 11.1.
Logical and Shift operations A particular bit, or set of bits, within the byte is set to 1 or 0 depending on conditions encountered during the execution.
Introduction to Computer Engineering by Richard E. Haskell Register Indirect Addressing Module M18.2 Section 12.3.
Introduction to Computer Engineering by Richard E. Haskell 8086 Tutor Monitor Module M14.3 Section 9.3 Appendix B.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 5 Arithmetic and Logic Instructions.
9-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Introduction to Computer Engineering by Richard E. Haskell Addition and Subtraction Instructions Module M16.3 Section 10.4.
Shift and Rotate Instructions
Introduction to Computer Engineering by Richard E. Haskell Logical Instructions Module M16.6 Section 10.5.
Practical Session 2. Labels Definition valid characters in labels are: letters, numbers, _, $, ~,., and ? first character can be: letter, _, ? and.
Introduction to Computer Engineering by Richard E. Haskell 8086 Memory Module M14.1 Sections 9.3.
Binary Operations Math/Logical. Binary Math Decimal Addition Example ) Add = 15 Write down 5, carry ) Add 3 +
Princess Sumaya Univ. Computer Engineering Dept. Chapter 7:
Ch. 7 Logic, Shift and Rotate instr.
Khaled A. Al-Utaibi  Introduction  Arithmetic Instructions  Basic Logical Instructions  Shift Instructions  Rotate Instructions.
Microprocessors Monday, Apr. 13 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
Department of Computer Science and Software Engineering
Assembly Language for Intel-Based Computers Chapter 7: Integer Arithmetic (c) Pearson Education, All rights reserved. You may modify and copy.
1 Logic, Shift, and Rotate Instructions Read Sections 6.2, 7.2 and 7.3 of textbook.
Assembly 05. Outline Bit mapping Boolean logic (review) Bitwise logic Bit masking Bit shifting Lookup table 1.
Arithmetic and Logic Instructions. Outline Declarations Moving data The Flags register Logic instructions Addition & subtraction.
Logical and Bit Operations Chapter 9 S. Dandamudi.
EEL 3801 Part V Conditional Processing. This section explains how to implement conditional processing in Assembly Language for the 8086/8088 processors.
Lecture 12 Integer Arithmetic Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
The Assemble, Unassemble commands of the debugger: U Command for converting machine code language source Equivalent machine code instructions Equivalent.
Chapter 7 Bit Manipulation. 7.1 Logical Operations.
Microprocessor & Assembly Language
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Chapter four – The 80x86 Instruction Set Principles of Microcomputers 2016年3月17日 2016年3月17日 2016年3月17日 2016年3月17日 2016年3月17日 2016年3月17日 1 Chapter Four.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Bitwise and Logical Manipulations Assembly Language Programming University of Akron Dr. Tim Margush.
Boolean, Shift and Rotate instructions Dr.Hadi AL Saadi.
CS2422 Assembly Language and System Programming 0 Week 13 & 14 Codes in Assembly Language.
Computer Architecture and Assembly Language
Microprocessor Systems Design I
Chapter 3 Bit Operations
EE3541 Introduction to Microprocessors
Instruction System - Bit Manipulation Instruction
Machine control instruction
Assembly Language Programming Part 2
Overview Introduction General Register Organization Stack Organization
INSTRUCTION SET OF 8086 PAWAN KUMAR SINGH.
UNIT: 2 INSTRUCTION SET OF 8086.
4.4 Bit Manipulation Instructions
Practical Session 2.
8086 Registers Module M14.2 Sections 9.2, 10.1.
Shift & Rotate Instructions)
ADDITION Register Addition. ADD AX,BX AX=AX+BX 2. Immediate Addition.
Shift & Rotate Instructions)
Assembly Language for Intel-Based Computers, 4th Edition
Assembly Language for Intel-Based Computers, 5th Edition
Shift, Multiply, and Divide
Computer Architecture and System Programming Laboratory
Chapter 5 Arithmetic and Logic Instructions
Microprocessor and Assembly Language
Computer Organization and Assembly Language
Shift and Rotate Instructions.
CS-401 Computer Architecture & Assembly Language Programming
Presentation transcript:

Introduction to Computer Engineering by Richard E. Haskell Shift and Rotate Instructions Module M16.2 Section 10.3

Introduction to Computer Engineering by Richard E. Haskell Shift and Rotate Instructions Can shift bytes or words in registers or memory left or right 1 bit. Can rotate or rotate through carry bytes or words in registers or memory left or right 1 bit. Can shift bytes or words in registers or memory left or right CL bits. Can rotate or rotate through carry bytes or words in registers or memory left or right CL bits.

Introduction to Computer Engineering by Richard E. Haskell Shift Left: SHL AL,1

Introduction to Computer Engineering by Richard E. Haskell SHL AL,1 100 D = E0 E0

Introduction to Computer Engineering by Richard E. Haskell D0 E0 SHL AL,1 Tutor: /MH D0 E0 D0 E0 D0 E0 D0 E0 D0 E0 D0 E0 D0 E0 D0 E0

Introduction to Computer Engineering by Richard E. Haskell Shift Right: SHR C Bit

Introduction to Computer Engineering by Richard E. Haskell Rotate through Carry Left: RCL C Bit

Introduction to Computer Engineering by Richard E. Haskell Rotate through Carry Right: RCR C Bit

Introduction to Computer Engineering by Richard E. Haskell Rotate Left and Rotate Right: ROL and ROR C ROR C ROL (a) (b)

Introduction to Computer Engineering by Richard E. Haskell Shift Arithmetic Right: SAR C

Introduction to Computer Engineering by Richard E. Haskell Use CL to shift multiple bits 0000 B1 03 MOV CL, D2 E0 SHL AL,CL AL = 5 = shift left 3 bits = 28H = 40 = 5 x 2 3 = 5 x 8 Shifting left 1 bit multiplies by 2

Introduction to Computer Engineering by Richard E. Haskell Shifting right 1 bit divides by B1 03 MOV CL, D2 E8 SHR AL,CL AL = = 64H = shift right 3 bits = 0CH = 12 = 100 / 2 3 = 100 / 8 8 x 12 = 96 Note: Remainder of 4 = is shifted out and lost.