Sheet 2 Introduction to Computer Organization and Assembly Language.

Slides:



Advertisements
Similar presentations
Lecture 13: 10/8/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Advertisements

Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
COE Computer Organization & Assembly Language
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#4)
The 8086 Assembly Programming Data Allocation & Addressing Modes
LAB Flow Control Instructions
Joseph L. Lindo Assembly Programming Sir Joseph Lindo University of the Cordilleras.
CS2422 Assembly Language & System Programming September 28, 2006.
Microcomputer & Interfacing Lecture 3
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.
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.
Sahar Mosleh California State University San MarcosPage 1 CPU Flags and Boolean Instructions.
Introduction to 8086 Assembly Language Assembly Language Programming University of Akron Dr. Tim Margush.
Assembly Language A Brief Introduction. Unit Learning Goals CPU architecture. Basic Assembler Commands High level Programming  Assembler  Machine Language.
(Flow Control Instructions)
Computer Organization and Architecture Instructions: Language of the Machine Hennessy Patterson 2/E chapter 3. Notes are available with photocopier 24.
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.
Introduction to Assembly II Abed Asi Extended System Programming Laboratory (ESPL) CS BGU Fall 2013/2014.
Overview of Assembly Language Chapter 4 S. Dandamudi.
Review of Assembly language. Recalling main concepts.
Introduction to Computer Organization and Assembly Language
8086/8088 Instruction Set, Machine Codes and Addressing Modes.
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.
Central Processing Unit Decode Cycle. Central Processing Unit Current Instruction Register (CIR) I1 The fetch cycle has transferred an instruction from.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
1 Contents: 3.1 Instruction format and Addressing Modes 3.2 Instruction Introduction Chapter 3 Instruction system.
CS2422 Assembly Language and System Programming 0 Week 9 Data Transfers, Addressing, and Arithmetic.
Computer Architecture CST 250
Instruction set Architecture
Assembly Lab 3.
Data Transfers, Addressing, and Arithmetic
Microprocessor Systems Design I
Assembly Language for Intel-Based Computers, 5th Edition
Microprocessor and Assembly Language
8051 Addressing Modes The way, using which the data source or destination addresses are specified in the instruction mnemonic for moving the data, is.
INTRODUCTION ABOUT ASSEMBLY
Microprocessor and Assembly Language
Computer Organization & Assembly Language
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Microprocessor and Assembly Language
Arithmetic Instructions
Defining Types of data expression Dn [name] expression Dn [name]
Symbolic Instruction and Addressing
Introduction to Assembly Language
Data Transfers, Addressing, and Arithmetic
8086 MICROPROCESSOR PROGRAMMING – INTEGER INSTRUCTIONS AND COMPUTATIONS Amar Saraswat.
Computer Programming Machine and Assembly.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
(Array and Addressing Modes)
Introduction to Micro Controllers & Embedded System Design
Symbolic Instruction and Addressing
(Array and Addressing Modes)
Flow Control Instructions
University of Gujrat Department of Computer Science
Chapter 4: Representing instructions
Requirements for coding in Assembly Language
Microprocessor and Assembly Language
Assembler Directives end label end of program, label is entry point
Chapter 6 –Symbolic Instruction and Addressing
CS-401 Computer Architecture and Assembly Language Programming
Chapter 8: Instruction Set 8086 CPU Architecture
Introduction to 8086 Assembly Language
(Array and Addressing Modes)
Presentation transcript:

Sheet 2 Introduction to Computer Organization and Assembly Language

Question 1 Q1: Tell whether each of the following instructions is legal or illegal.WD1 and WD2 are word variables, and BT1 and BT2 are byte variables.

Question 1 A. ADD WD1,WD2 B. MOV AL,0AC3h C. MOV DS,BX D. ADD 03,AL E. MOV AH,WD2 F. MOV BT1,BT2 G. MOV CS,SS H. MOV DS,100h I. MOV WD2,CS J. MOV BT1,WD1 Illegal memory location & memory location Illegal out of range Legal Illegal the destination is a constant Illegal operands are not of the same type Illegal memory location & memory location Illegal segment register to segment register Illegal constant to segment register Legal segment register to memory location Illegal memory location & memory location

Question 2 Q2: Using only MOV, ADD, SUB, INC, DEC, and NEG, translate the following high-level language assignment statements into assembly language. A, B, and C are word variables.

Question 2 a. B = 3 * B + 2 MOV AX,B ADD AX,B ADD AX,2 MOV B,AX b. B = A + C MOV AX,A ADD AX,C MOV B,AX

Question 2 c. C = -(C + 1) INC C NEG C d. A = C – B MOV AX,C SUB AX,B MOV A,AX

Question 2 e. A = C - A – 1 MOV AX,C SUB AX,A DEC AX MOV A,AX

Question 3 Q3: Write assembly program that displays the following “This Program is to swap content of two memory locations”, and then define two variables (BYTE1 and BYTE2) of type byte and uninitialized, then write a transfer instruction that assign value ('A') in BYTE1 and value (45H) in BYTE2, then try to swap the values.

Question 3