Sheet 1 Introduction to Computer Organization and Assembly Language.

Slides:



Advertisements
Similar presentations
1 ICS103 Programming in C Lecture 3: Introduction to C (2)
Advertisements

1 Lecture 2  Input-Process-Output  The Hello-world program  A Feet-to-inches program  Variables, expressions, assignments & initialization  printf()
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
Assembly Language for Intel-Based Computers Chapter 3: Assembly Language Fundamentals Kip Irvine.
6.1) Assembly Language Program Format 6.2) Features of Assembly Language 6.3) Data Definition CHAPTER 6 ASSEMBLY LANGUAGE PROGRAM FORMAT AND DATA DEFINITION.
Practical Session 2. Labels Definition valid characters in labels are: letters, numbers, _, $, ~,., and ? first character can be: letter, _, ? and.
Chapter 2: Introduction to C++.
8051 ASSEMBLY LANGUAGE PROGRAMMING
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#8) By Dr. Syed Noman.
Chapter 3: Introduction to C Programming Language C development environment A simple program example Characters and tokens Structure of a C program –comment.
ECE 265 – LECTURE 9 PROGRAM DESIGN 8/12/ ECE265.
INTRODUCTION TO IBM PC ASSEMBLY LANGUAGE
INTRODUCTION TO IBM PC ASSEMBLY LANGUAGE
Fundamentals of Assembly language
CSC 125 Introduction to C++ Programming Chapter 2 Introduction to C++
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.
ASSEMBLY LANGUAGE. Assembler and Compiler Pascal A Program Compiler Version A Assembly Language Versiion A Machine Code Actual version that will be executed.
Debug and Assembler By, B.R.Chandavarkar Lect. COMP Department NITK, Surathkal.
Introduction to 8086 Assembly Language Assembly Language Programming University of Akron Dr. Tim Margush.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Copyright © 2012 Pearson Education, Inc. Chapter 2: Introduction to C++
The x86 PC Assembly Language, Design, and Interfacing By Muhammad Ali Mazidi, Janice Gillespie Mazidi and Danny Causey © 2010, 2003, 2000, 1998 Pearson.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 3 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 2: Introduction to C++
Chapter Five–80x86 Assembly program development Principles of Microcomputers 2015年11月15日 2015年11月15日 2015年11月15日 2015年11月15日 2015年11月15日 2015年11月15日 1.
Chapter 4 Requirements for Coding in Assembly Language.
CONSTANTS Constants are also known as literals in C. Constants are quantities whose values do not change during program execution. There are two types.
Assembly Language programming
Review of Assembly language. Recalling main concepts.
12/14/2016CS150 Introduction to Computer Science 1 Announcements  Website is up!   All lecture slides, assignments,
New/Old Assembler Directives Data Definition Statement syntax –[name] directive initializer [,initializer]… At least one initializer is required in a.
Silberschatz and Galvin  C Programming Language Kingdom of Saudi Arabia Ministry of Higher Education Al-Majma’ah University College of Education.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to C++
Lecture 2 Chapter 4 –Requirements for coding in Assembly Language 1.
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
1 Chapter 3 Assembly Language Fundamentals Assembly Language for Intel-Based Computers, 4th edition Revised 3/11/05.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
2.1 The Part of a C++ Program. The Parts of a C++ Program // sample C++ program #include using namespace std; int main() { cout
Assembly language programming
Introduction to assembly programmıng language
Format of Assembly language
Assembly Lab 3.
Assembly Language programming
Assembly Language Ms. V.Anitha AP/CSE SCT
ICS103 Programming in C Lecture 3: Introduction to C (2)
Additional Assembly Programming Concepts
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Chapter 3 Machine Language and Assembly Language.
Chapter 3 Machine Language and Assembly Language.
Microprocessor and Assembly Language
INTRODUCTION ABOUT ASSEMBLY
Computer Organization & Assembly Language
Section 3.2c Strings and Method Signatures
Defining Types of data expression Dn [name] expression Dn [name]
2.1 Parts of a C++ Program.
CS150 Introduction to Computer Science 1
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Chapter 4 –Requirements for coding in Assembly Language
Chapter 4 –Requirements for coding in Assembly Language
INTRODUCTION ABOUT ASSEMBLY
Chapter 4 –Requirements for coding in Assembly Language
Requirements for coding in Assembly Language
Chapter 2: Introduction to C++.
The Data Element.
Assembler Directives end label end of program, label is entry point
Computer Architecture and System Programming Laboratory
The Data Element.
Introduction to 8086 Assembly Language
Presentation transcript:

Sheet 1 Introduction to Computer Organization and Assembly Language

Program Comment A semicolon marks the beginning of this field, and the assembler ignores anything typed after the semicolon. Example: MOV CX, 0; CX counts terms, initially 0

Identifiers Can be from 1 to 31 characters long (not case sensitive). May consist of letters, digits, and the special characters. _ $ % (Thus, embedded blanks are not allowed). Names may not begin with a digit. If a dot is used, it must be the first character.

Defining Types of data [name]Dnexpression Syntax: name Dn initial_value

Defining Types of data Cont. Dn (Directive): Pseudo- op Stands for DB DW DD DQ DT Define Byte Define Word Define Doubleword Define Quadword Define Tenbytes

Question 1 Q1: Tell whether each of the following identifiers is Valid or Invalid. Identifier Valid \ Invalid Identifier Valid \ Invalid CountValid Open_File Valid First.Invalid: Dot is not the first character. Valid 2_mainInvalid: Begins with a file Invalid: Contains a blank.

Question 2 Q2: Give data definition pseudo-ops to define each of the following: a) A word variable X initialized to 41. X DW 41

Question 2 Cont. Q2: Give data definition pseudo-ops to define each of the following: b) A word variable WORD1, uninitialized. WORD1 DW ?

Question 2 Cont. Q2: Give data definition pseudo-ops to define each of the following: c) A byte variable Y initialized to 32h. Y DB 32H

Question 2 Cont. Q2: Give data definition pseudo-ops to define each of the following: d) A byte variable ITEM containing the hex equivalent to decimal 71. ITEM DB 47H

Question 2 Cont. Q2: Give data definition pseudo-ops to define each of the following: e) A word array ARRAY1, initialized to the first 5 positive integers (i.e. 1-5). ARRAY1 DW 1,2,3,4,5

Question 2 Cont. Q2: Give data definition pseudo-ops to define each of the following: f) A 30 bytes array ARR, with each entry initialized to 10H. ARR DB 30 DUP (10H)

Question 2 Cont. Q2: Give data definition pseudo-ops to define each of the following: g) A constant LENGTH with value 20, another constant WIDTH with value 10, and constant AREA using LENGTH and WIDTH that you just defined (Note: area = length * width). LENGTH EQU 20 WIDTH EQU 10 AREA EQU length * width