Computer Systems and Assembly Language Input and output operations

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick Strings #include using namespace std; int main () { string word; cout
Advertisements

Ch5b BR 0x0009 ;Branch around data 0003 FFFE.WORD 0xFFFE ;First BYTE 0x00 ;Second BYTE 'U' ;Third WORD 1136 ;Fourth.
Assembly Language Part 3. Symbols Symbols are assembler names for memory addresses Can be used to label data or instructions Syntax rules: –start with.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
Programming Functions: Passing Parameters by Reference.
Assembly Language part 2. Program example 2 BR 0x0008.ASCII "#?".ASCII "\n".BLOCK 2 CHARO 0x0003, d CHARO 0x0004, d DECI 0x0006, d CHARO 0x0005, d DECO.
1 Objectives Understand streamed input and output.
More on Functions Programming. COMP104 Lecture 19 / Slide 2 Passing Parameters by Reference l To have a function with multiple outputs, we have to use.
1 10/20/08CS150 Introduction to Computer Science 1 do/while and Nested Loops Section 5.5 & 5.11.
1 10/11/06CS150 Introduction to Computer Science 1 do/while and Nested Loops.
1 9/1/06CS150 Introduction to Computer Science 1 What Data Do We Have? CS 150 Introduction to Computer Science I.
Functions:Passing Parameters by Value Programming.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
1 September 6, 2005CS150 Introduction to Computer Science I What Actions Do We Have Part 1 CS150 Introduction to Computer Science I.
1 CS150 Introduction to Computer Science 1 Exponents & Output page & Section 3.8.
1 10/25/06CS150 Introduction to Computer Science 1 Reading from and Writing to Files.
1 9/26/07CS150 Introduction to Computer Science 1 Exponents & Output page & Section 3.8.
Programming is instructing a computer to perform a task for you with the help of a programming language.
Assembly Language Part 5. Reference parameter/global variable model C++ reference parameters are references to the actual arguments (as opposed to copies.
Assembly Language part 1.
Programming Functions: Passing Parameters by Reference.
Recursion Chapter Nature of Recursion t Problems that lend themselves to a recursive solution have the following characteristics: –One or more.
CS1201: Programming Language 2 Recursion By: Nouf Almunyif.
Current Assignments Homework 3 is due tonight. Iteration and basic functions. Exam 1 on Monday.
TOPIC : Programming Model UNIT 1: Modeling Digital Circuits Module 1 : Functional Modeling.
First steps Jordi Cortadella Department of Computer Science.
Tracing through E01, question 9 – step 1 // p02.cc P. Conrad, for CISC181 07S // Exam question for E01 #include using namespace std; void mysteryFunction(int.
Review the following : Flowcharting Variable declarations Output Input Arithmetic Calculations Conditional Statements Loops.
A first program 1. #include 2. using namespace std; 3. int main() { 4. cout
Objective: Students will be able to: Declare and use variables Input integers.
Quiz 2 Results. What Is Wrong? #include using namespace std int Main() { // Say Hello 4 times for(i == 0; i < 3; i++) { cout >> "Hello World!"
CS1201: PROGRAMMING LANGUAGE 2 FUNCTIONS. OVERVIEW What is a Function? Function Prototype Vs Decleration Highlight Some Errors in Function Code Parameters.
1 For Loops l From Chapter 9 l A shorthand way of coding count loops.
REPETITION STATEMENTS - Part1  Also called LOOP STATEMENTS OR LOOP STRUCTURES 1 C++ Statements that repeat one or more actions while some condition is.
April 11, 2005 More about Functions. 1.Is the following a function call or a function header? calcTotal(); 2.Is the following a function call or a function.
1 Structure of Simple C++ Program Chapter 1 09/09/13.
1 17/4/1435 h Monday Lecture 3 The Parts of a C++ Program.
Chapter five exercises. a. false; b. true; c. false; d. true; e. true; f. true; g. true; h. false.
Introduction to Computers and C++ Programming
What Actions Do We Have Part 1
Recursion Chapter 12.
Revision.
Pointer Data Type and Pointer Variables
CS 1430: Programming in C++ Turn in your Quiz1-2 No time to cover HiC.
Functions A function is a “pre-packaged” block of code written to perform a well-defined task Why? Code sharing and reusability Reduces errors Write and.
Screen output // Definition and use of variables
Starting Out with C++: From Control Structures through Objects
Pointers & Functions.
 Student:Risvayeva Charos  Group: 220.
Introduction to C++ Introduced by Bjarne Stroustrup of AT&T’s Bell Laboratories in mid-1980’s Based on C C++ extended C to support object-oriented programming.
CS150 Introduction to Computer Science 1
Computer Architecture and Assembly Language CS 233 Lecture 1
Let’s all Repeat Together
Mr. Dave Clausen La Cañada High School
CS1201: Programming Language 2
do/while Selection Structure
What Actions Do We Have Part 1
The Von Neumann Machine
Using string type variables
Pointers & Functions.
Pointer Data Type and Pointer Variables
COMS 261 Computer Science I
The .ASCII and .END Assembler Input ;Stan Warford ;January 13, 2005
CS31 Discussion 1D Winter19: week 3
Computer Architecture and Assembly Language CS 233 Lecture 1
Reading from and Writing to Files Part 2
CS150 Introduction to Computer Science 1
CS31 Discussion 1H Fall18: week 3
Odds and Ends.
Presentation transcript:

Computer Systems and Assembly Language Input and output operations Eltayeb Abuelyaman CS233 Week # 15

Character Operations chari 0x000d,d chari 0x000e,d charo 0x000e,d charo 0x000d,d stop .block 1 .end

Input and Output Operations Determine the object code and predict the output of the following program DECO ‘m’,i CHARO ‘\n’,i DECO “mm”,i CHARO ‘\n’,I CHARO 0x0026,I STOP .END

Labels Determine the values of the symbols here and there and write the object code in hexadecimal BR there here: .word 9 there: DECO here,d STOP .END

An HLL program to compute modulo 16 of input numbers #include <isotream> Using namespace std; Int num; Int main() { cin >> num; remain = num %16; cout << “num = “” << endl; return 0; }

A program to compute Modulo a Number br start num: .block 1 result: .ASCII " sum = \X00" start: deci num,d lda num,d anda 0x000f,i sta num,d stro result,d deco num,d charo '\n',i stop .end

Stack Relative Addressing br reverse first: .word 'S' second: .word 'U' third: .word 'B' reverse: lda first,d stbytea -1,s lda second,d stbytea -2,s lda third,d stbytea -3,s subsp 3,i charo 0,s charo 1,s charo 2,s