University of Gujrat Department of Computer Science

Slides:



Advertisements
Similar presentations
Assembly Language :CSC 225 (Lec#4: Flag Register and Conditional Statements) By Dr. Syed Noman.
Advertisements

The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
Joseph L. Lindo Assembly Programming Sir Joseph Lindo University of the Cordilleras.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
Flow Control Instructions
9-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
INTRODUCTION TO IBM PC ASSEMBLY LANGUAGE
INTRODUCTION TO IBM PC ASSEMBLY LANGUAGE
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#5) By Dr. Syed Noman.
1 Assembler A short Overview. 2 Content Language Levels High Level  micro code Machinecode language Assembler languages Structure Commands.
5. Assembly Language. Basics of AL Program data Pseudo-ops Array Program structures Data, stack, code segments.
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.
Microprocessor & Assembly Language Arithmetic and logical Instructions.
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.
Sheet 2 Introduction to Computer Organization and Assembly Language.
CS2422 Assembly Language and System Programming 0 Week 9 Data Transfers, Addressing, and Arithmetic.
Unit 1 Instruction set M.Brindha AP/EIE
Computer Architecture CST 250
Instruction set Architecture
Data Transfers, Addressing, and Arithmetic
Microprocessor Systems Design I
Microprocessor T. Y. B. Sc..
3.Instruction Set of 8085 Consists of 74 operation codes, e.g. MOV
Lecture on Microcomputer
ICS312 SET 7 Flags.
Processor Instructions set. Learning Objectives
Microprocessor Systems Design I
EE3541 Introduction to Microprocessors
Microprocessor and Assembly Language
INSTRUCTION SET.
Assembly Language Programming Part 2
University of Gujrat Department of Computer Science
Microprocessor and Assembly Language
Morgan Kaufmann Publishers Computer Organization and Assembly Language
INSTRUCTION SET OF 8086 PAWAN KUMAR SINGH.
CS-401 Assembly Language Programming
Microprocessor and Assembly Language
Arithmetic Instructions
Assembly Language for Intel-Based Computers, 4th Edition
Defining Types of data expression Dn [name] expression Dn [name]
Symbolic Instruction and Addressing
X86’s instruction sets.
University of Gujrat Department of Computer Science
Data Transfers, Addressing, and Arithmetic
8086 MICROPROCESSOR PROGRAMMING – INTEGER INSTRUCTIONS AND COMPUTATIONS Amar Saraswat.
CS-401 Computer Architecture & Assembly Language Programming
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
(Array and Addressing Modes)
(The Stack and Procedures)
University of Gujrat Department of Computer Science
Symbolic Instruction and Addressing
(Array and Addressing Modes)
Flow Control Instructions
University of Gujrat Department of Computer Science
Microprocessor and Assembly Language
UNIT-II Assembly Language Programs Involving Logical
Chapter 6 –Symbolic Instruction and Addressing
CNET 315 Microprocessor & Assembly Language
CS-401 Computer Architecture and Assembly Language Programming
Chapter 8: Instruction Set 8086 CPU Architecture
(Array and Addressing Modes)
CS-401 Computer Architecture & Assembly Language Programming
Presentation transcript:

University of Gujrat Department of Computer Science Course Code : CS-252 Computer Organization and Assembly Language Lecture # 7 Few instructions of Assembly Language University of Gujrat

Instruction Groups Data Movement Instructions Arithmetic / Logic Instructions Program Control Instructions Special Instructions University of Gujrat

Data Movement mov ax,bx ; move data from bx to ax lda 0234 ; load 0234 into ; accumulator University of Gujrat

Arithmetic and Logic Instructions and ax,1234 ; AND 1234 with ax add bx,0534 ; ADD 0534 to bx add bx,[1200] ; ADD data at address 1200 to bx add ax,[1234] ; ADD data from address 1234 to ax University of Gujrat

Program Control Instructions cmp ax, 0 ; compare ax with 0 jne 1234 ; jump if not equal to the instruction at ; address 1234 University of Gujrat

Special Instructions sti ; set the interrupt flag cli ; clear the interrupt flag sti ; set the interrupt flag University of Gujrat

Few Basic Instructions University of Gujrat

MOV instruction Used to transfer data between registers, between a register and a memory location, or to move a number directly into a register Syntax MOV destination, source e.g. MOV AX, WORD1 MOV AX, BX MOV AH, ‘A’ University of Gujrat

Legal Combinations of Operands for MOV Source Operand Destination Operand General Register Segment Register Memory Location Constant Yes No Memory Location University of Gujrat

XCHG instruction Used to exchange the contents of two registers, or a register , or a register or a memory location Syntax XCHG destination, source e.g. XCHG AH, BL XCHG AX, WORD1 University of Gujrat

Legal Combinations of Operands for XCHG Source Operand Destination Operand General Register Memory Location Yes No University of Gujrat

ADD and SUB instructions Used to add or subtract the contents of two registers, a register and a memory location and to add (subtract) a number to (from) a register or a memory location Syntax ADD destination, source SUB destination, source e.g. ADD AH, BL SUB AX, WORD1 University of Gujrat

Legal Combinations of Operands for ADD and SUB Source Operand Destination Operand General Register Memory Location Yes No Constant University of Gujrat

INC and DEC instructions INC is used to add 1 to the contents of a memory location or register and DEC is used to subtract 1 from the contents of a memory location or register Syntax INC destination DE C destination e.g. INC AX DEC WORD1 University of Gujrat

NEG instruction NEG is used to negate the contents of the destination. NEG does this by replacing the contents by its 2’s complement Syntax NEG destination e.g. NEG AX University of Gujrat