Microprocessor and Assembly Language

Slides:



Advertisements
Similar presentations
Introduction to Computer Engineering by Richard E. Haskell Multiplication and Division Instructions Module M16.4 Section 10.4.
Advertisements

Princess Sumaya Univ. Computer Engineering Dept. Chapter 3: IT Students.
Department of Computer Science and Software Engineering
Assembly Language Lecture 9
1 Multiplication, Division, and Numerical Conversions Chapter 6.
Web siteWeb site ExamplesExamples Irvine, Kip R. Assembly Language for Intel-Based Computers, MUL Instruction The MUL (unsigned multiply) instruction.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Chapter 5 Arithmetic and Logic Instructions.
Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file).
1 Lecture 8: Binary Multiplication & Division Today’s topics:  Addition/Subtraction  Multiplication  Division Reminder: get started early on assignment.
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
Chapter 4 Basic Instructions. 4.1 Copying Data mov Instructions mov (“move”) instructions are really copy instructions, like simple assignment statements.
MUL Instruction (Unsigned Multiply) Multiplies an 8-, 16-, or 32-bit operand by either AL, AX or EAX. MUL r/m8 MUL r/m16 MUL r/m32.
Assembly Language – Lab 5
The 8051 Microcontroller and Embedded Systems
Comp Sci 251 Intro 1 Computer organization and assembly language Wing Huen.
ASCII and BCD Arithmetic Chapter 11 S. Dandamudi.
Chapter four – The 80x86 Instruction Set Principles of Microcomputers 2015年10月19日 2015年10月19日 2015年10月19日 2015年10月19日 2015年10月19日 2015年10月19日 1 Chapter.
6 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Multiplication and Division Instructions & the 0Ah function.
Microprocessors Monday, Apr. 13 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
Arithmetic Flags and Instructions
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 4 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
1 IKI10230 Pengantar Organisasi Komputer Kuliah no. 05.b: Arithmetic Operations Sumber: 1. Paul Carter, PC Assembly Language 2. Hamacher. Computer Organization,
ACOE2511 Assembly Language for the 80X86/Pentium Intel Microprocessors Lecturer: Dr. Konstantinos Tatas.
Integer Multiplication and Division ICS 233 Computer Architecture and Assembly Language Dr. Aiman El-Maleh College of Computer Sciences and Engineering.
Assembly Language for Intel-Based Computers, 4 th Edition Unpacked and Packed Integers (c) Pearson Education, All rights reserved. You may modify.
Arithmetic and Logic Instructions
Microprocessor MA Rahim Khan Computer Engineering and Networks Department.
ICS 312 SET 10 Multiplication & Division & input using function 0Ah.
The Assemble, Unassemble commands of the debugger: U Command for converting machine code language source Equivalent machine code instructions Equivalent.
Introduction Arithmetic instructions are used to perform arithmetic operation such as Addition Subtraction Multiplication Division These operations can.
Microprocessor & Assembly Language Arithmetic and logical Instructions.
Integer Multiplication and Division COE 301 Computer Organization Dr. Muhamed Mudawar College of Computer Sciences and Engineering King Fahd University.
Integer Operations Computer Organization and Assembly Language: Module 5.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Integer Multiplication and Division ICS 233 Computer Architecture & Assembly Language Prof. Muhamed Mudawar College of Computer Sciences and Engineering.
Multiplication and Division instructions Dr.Hadi AL Saadi.
Number Systems Decimal Can you write 12,045 in expanded form? Base? Allowable digits for each place?
Integer Multiplication and Division
Assembly Language for Intel-Based Computers, 5th Edition
Microprocessor and Assembly Language
Multiplication and Division Instructions
Microprocessor and Assembly Language
CS-401 Computer Architecture & Assembly Language Programming
Microprocessor and Assembly Language
Computer Organization and ASSEMBLY LANGUAGE
X86’s instruction sets.
Lecture 8: Addition, Multiplication & Division
Chapter 4: Instructions
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Lecture 8: Addition, Multiplication & Division
Shift & Rotate Instructions)
Multiplication and Division Instructions
Assembly Language for Intel-Based Computers, 4th Edition
Shift & Rotate Instructions)
Assembly Language for Intel-Based Computers, 4th Edition
Assembly Language for Intel-Based Computers, 5th Edition
EECE.3170 Microprocessor Systems Design I
Chapter 5 Arithmetic and Logic Instructions
Microprocessor and Assembly Language
Multiplication and Division Instructions
Multiplication and Division Instructions
Division instruction.
MIPS Arithmetic and Logic Instructions
Computer Architecture and System Programming Laboratory
Part I Data Representation and 8086 Microprocessors
Presentation transcript:

Microprocessor and Assembly Language Lecture-12-Multiplication and Division Instructions Muhammad Hafeez Department of Computer Science GC University Lahore

Today’s Agenda Signed and Unsigned Multiplication Signed and Unsigned Division

Multiplication Instructions The process of multiplication is different for signed and unsigned numbers Example: Take 2 number 1000 0000 and 1111 1111 As unsigned numbers are 255 and 128 Product = 32640 As signed numbers are -128 and -1 Product = 128

Instruction for Signed and Unsigned Multiplication MUL is used for Unsigned multiplication IMUL is used for singed multiplication Syntax is: MUL Source IMUL Source

Byte Form For byte x byte, one operand must be in source Second operand is assumed in AL register 16-bit result is stored in AX register The source must be a register or a memory location, constants are not allowed

Word Form For Word multiplication one number must be in source Second number is assumed in AX register 32-bit result is stored in DX:AX DX holds the Most significant bits AX holds the Least Significant bits

Examples: Translate A= 5 x A – 12 X B using IMUL Instruction.

Examples:

Division Instructions DIV instruction is used for unsigned division Syntax: DIV Divisor IDIV instruction is used for signed division Syntax IDIV Divisor

Division Instructions Byte Form: The divisor is 8-bit register or memory location The dividend is 16-bit that is assumed to be in AX After division AL = Quotient AH = Remainder Divisor must not be a constant

Division Instructions Word Form: The divisor is 16-bit register or memory location The dividend is 32-bit that is assumed to be in DX:AX After division AX = Quotient DX = Remainder Execution of DIV or IDIV could result in divide overflow

Decimal Input/ Output In memory everything is represented in binary. Decimal Input and Output could be done through a program

Decimal Input/ Output In memory everything is represented in binary. Decimal Input and Output could be done through a program

Decimal Output

Decimal Output

Test Program

Decimal Input Convert a string of ASCII digits to the binary representation of a decimal equivalent

Decimal Input

Decimal Input