Arithmetic Instructions

Slides:



Advertisements
Similar presentations
COMP 2003: Assembly Language and Digital Logic
Advertisements

ICS312 Set 6 Operands. Basic Operand Types (1) Register Operands. An operand that refers to a register. MOV AX, BX ; moves contents of register BX to.
Department of Computer Science and Software Engineering
80x86 Instruction Set Dr. Qiang Lin.
The 8086 Assembly Programming Data Allocation & Addressing Modes
Computer Organization And Assembly Language
Gursharan Singh Tatla 21-Nov-20101www.eazynotes.com.
Joseph L. Lindo Assembly Programming Sir Joseph Lindo University of the Cordilleras.
Irvine: Assembly Language for Intel-Based Computers (1999) Symbolic Constants Equal-sign Directive EQU Directive TEXTEQU Directive.
Flow Control Instructions
9-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
CS2422 Assembly Language & System Programming September 28, 2006.
1 Homework Reading –Professional Assembly Language, pp 17-32, Continue work on mp1 –Questions? Lab with your assigned section this week.
ICS312 Set 3 Pentium Registers. Intel 8086 Family of Microprocessors All of the Intel chips from the 8086 to the latest pentium, have similar architectures.
Microprocessor Systems Design I
Chapter 4 Basic Instructions. 4.1 Copying Data mov Instructions mov (“move”) instructions are really copy instructions, like simple assignment statements.
Lect 4: Instruction Set and Addressing Modes. 386 Instruction Set (3.4)  Basic Instruction Set : 8086/8088 instruction set  Extended Instruction Set.
INTRODUCTION TO IBM PC ASSEMBLY LANGUAGE
INTRODUCTION TO IBM PC ASSEMBLY LANGUAGE
1/2002JNM1 Basic Elements of Assembly Language Integer Constants –If no radix is given, the integer is assumed to be decimal. Int 21h  Int 21 –A hexadecimal.
Introduction to 8086 Assembly Language Assembly Language Programming University of Akron Dr. Tim Margush.
Copyright 2000ELEC 242 Arithmetic Instructions1 Arithmetic Instructions Arithmetic and logical instructions modify the contents of the Flag (Status) register.
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 4 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Click to add Title Comunicación y Gerencia Click To add Subtitle Click to add Text Fundamentals of Assembly Language.
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
Review of Assembly language. Recalling main concepts.
3.4 Addressing modes Specify the operand to be used. To generate an address, a segment register is used also. Immediate addressing: the operand is a number.
B ASIC INSTRUCTIONS. I NTRODUCTION There are over a hundred instructions in the instruction set for the 8086 CPU; there are also instructions designed.
2/20/2016CAP 2211 Flow Control Instructions. 2/20/2016CAP 2212 Transfer of Control Flow control instructions are used to control the flow of a program.
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Comparison Instructions Test instruction –Performs an implied AND operation between each of the bits in 2 operands. Neither operand is modified. (Flags.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Multiplication and Division instructions Dr.Hadi AL Saadi.
Sheet 2 Introduction to Computer Organization and Assembly Language.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
CS2422 Assembly Language and System Programming 0 Week 9 Data Transfers, Addressing, and Arithmetic.
Computer Architecture CST 250
Instruction set Architecture
Data Transfers, Addressing, and Arithmetic
Microprocessor Systems Design I
ICS312 SET 7 Flags.
Assembly Language for Intel-Based Computers, 5th Edition
Assembly IA-32.
Assembly Language Programming Part 2
Microprocessor and Assembly Language
Microprocessor and Assembly Language
Assembly Language for Intel-Based Computers, 4th Edition
Symbolic Instruction and Addressing
X86’s instruction sets.
Chapter 4: Instructions
BIC 10503: COMPUTER ARCHITECTURE
Data Addressing Modes • MOV AX,BX; This instruction transfers the word contents of the source-register(BX) into the destination register(AX). • The source.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Data Transfers, Addressing, and Arithmetic
8086 Registers Module M14.2 Sections 9.2, 10.1.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
(Array and Addressing Modes)
Symbolic Instruction and Addressing
(Array and Addressing Modes)
Flow Control Instructions
University of Gujrat Department of Computer Science
Microprocessor and Assembly Language
EECE.3170 Microprocessor Systems Design I
UNIT-II Assembly Language Programs Involving Logical
Chapter 6 –Symbolic Instruction and Addressing
CNET 315 Microprocessor & Assembly Language
Chapter 8: Instruction Set 8086 CPU Architecture
(Array and Addressing Modes)
Presentation transcript:

Arithmetic Instructions ICS312 Set 5 Arithmetic Instructions

Data Transfer Instructions MOV     MOV destination, source destination operand can be register or memory operand. source operand can be register, memory, or immediate operand. source and destination operands cannot BOTH be memory operands. Examples: mov cx, ax mov account, 3

Arithmetic Instructions (ADD, SUB, INC, and DEC) ADD and SUB Instructions ADD destination, source SUB destination, source destination operand can be register or memory operand. source operand can be register, memory operand, or immediate source and destination operands cannot BOTH be memory operands. INC and DEC Instructions INC destination DEC destination Examples: inc ah dec ebx add number, 2

NEG Instruction NEG destination destination operand can be register or memory operand. Examples: neg di Note:  Type Agreement of Operands The operands of two-operand instructions must be of the same type; that is both operands must be bytes, words, or double words

Translation of High-Level Language to Assembly Language Examples:  Translate the following high-level language statements to assembly language: 1.    B = A MOV AX, A MOV B, AX 2.    A = 5 - A First method: MOV CX, 5 SUB CX, A MOV A, CX Second method: NEG A ADD A, 5 3.    A = B - 2 * A MOV DX, A ADD DX, DX NEG DX ADD DX,B MOV A,DX

Textbook Reading (Jones): Section 4.1 Addition and Subtraction