CS-401 Computer Architecture & Assembly Language Programming

Slides:



Advertisements
Similar presentations
Machine Instructions Operations
Advertisements

Machine Instructions Operations 1 ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson Slides4-1.ppt Modification date: March 18, 2015.
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,
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.
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.
9-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 7: Integer Arithmetic (c) Pearson Education, All rights reserved. You may.
Shift and Rotate Instructions
Practical Session 2. Labels Definition valid characters in labels are: letters, numbers, _, $, ~,., and ? first character can be: letter, _, ? and.
Ch. 5 from Yu & Marut. Registers 14(16-bit) registers: 1.Data reg. – to hold data for an op. 2.Address reg – to hold addr of an instruction or data.
Binary Operations Math/Logical. Binary Math Decimal Addition Example ) Add = 15 Write down 5, carry ) Add 3 +
Assembly Language for Intel-Based Computers
Introduction to Computer Engineering by Richard E. Haskell Shift and Rotate Instructions Module M16.2 Section 10.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.
Lecture 05: Assembly Language Programming (2). The 80x86 IBM PC and Compatible Computers Chapter 3 Arithmetic & Logic Instructions and Programs Chapter.
11.1/36 Repeat: From Bits and Pieces Till Strings.
Microprocessors Monday, Apr. 13 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
Department of Computer Science and Software Engineering
Lecture 5 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
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.
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.
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
Computer Architecture CST 250
16.317: Microprocessor System Design I
Practical Session 2.
Microprocessor Systems Design I
Microprocessor Systems Design I
Chapter 3 Bit Operations
Microprocessor Systems Design I
EE3541 Introduction to Microprocessors
Instruction System - Bit Manipulation Instruction
Machine control instruction
Assembly Language Programming Part 2
CS-401 Assembly Language Programming
UNIT: 2 INSTRUCTION SET OF 8086.
CS 301 Fall 2002 Assembly Instructions
4.4 Bit Manipulation Instructions
Practical Session 2.
Shift & Rotate Instructions)
CS-401 Computer Architecture & Assembly Language Programming
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
Table 3‑1: Unsigned Data Range Summary in ARM
CS-401 Assembly Language Programming
Microprocessor and Assembly Language
Computer Organization and Assembly Language
Shift and Rotate Instructions.
Ch. 5 – Intel 8086 – study details from Yu & Marut
Presentation transcript:

CS-401 Computer Architecture & Assembly Language Programming Lecture-10 Bit Manipulation

In the Last Lecture We discussed -Bubble sorting

Signed/unsigned numbers

Signed / Unsigned Numbers Number Representation 2 0x0002 -2 0xFFFE ; two’s compliment of ; decimal 65534

Signed / Unsigned Numbers Example mov ax, -2 ; ax = 65534 mov ax, 2 ; bx = 2 cmp ax, bx ja label1 ; true! 65534 > 2

Signed / Unsigned Numbers Example mov ax, 65534 ; ax = 0xFFFE mov ax, -2 ; bx = 0xFFFE ; same representation ; different interpretation

Signed / Unsigned Numbers Order and Range (16 – Bit) Unsigned Numbers: 0<1<2<3<4 <………<65535 Signed Numbers: -32768<-32767<…..<0<……<32767

Multiplication 1 1 0 1 1 3 x 0 1 0 1 x 5 1 1 0 1 0 0 0 0 x 1 1 0 1 x x 0 0 0 0 x x x 1 0 0 0 0 0 0 1 6 5

Shift Instructions shr shift logical right shl shift logical left sar shift arithmetic right sal shift arithmetic left

Rotate Instructions rol rotate left rcr rotate through carry right ror rotate right rol rotate left rcr rotate through carry right rcl rotate through carry left

shr CF 1 1 1 1 1

shl CF 1 1 1 1 1

sal CF 1 1 1 1 1

sar CF 1 1 1 1 1 1 CF 1 1 1 1 1 1

ror CF 1 1 1 1

rol CF 1 1 1 1 1

rcr CF 1 1 1 1

rcl CF 1 1 1 1 1