An “interactive” application An introduction to “structured” assembly language programming.

Slides:



Advertisements
Similar presentations
Introduction to Assembly language
Advertisements

Programming Types of Testing.
Introduction to Programming, Algorithms & Flow Charts
The Little man computer
19-1 Programming… The Pencil and Paper Computer The Pencil & Paper Instruction Set: (table on p148) The Operand specifies a memory location.
How does the stack work? On using the Pentium’s push, pop, call, and ret instructions.
Three types of computer languages
Computer Systems Week 8: 3-bit – The Display Amanda Oddie.
Systems Environment 3 Quick Revision Review of Exercises Introduction to TOM TOM Exercises.
Algorithm Design CS105. Problem Solving Algorithm: set of unambiguous instructions to solve a problem – Breaking down a problem into a set of sub- problems.
CMT1000: Introduction to Programming Ed Currie Lecture 2A: Pizza.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Algorithms. Introduction Before writing a program: –Have a thorough understanding of the problem –Carefully plan an approach for solving it While writing.
Chapter 1 Program Design
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Chapter 8: Introduction to High-Level Language Programming Invitation to Computer Science, C++ Version, Fourth Edition.
Sequencing Miss Regan. Blood Hound  Does anyone know what the Bloodhound project is?  Video 1 Video 1  Video 2 Video 2  Link to website Link to website.
Prototype & Design Computer Inputs. How to Prototype & Design Computer Inputs Step 1: Review Input Requirements Step 2: Select the GUI Controls Step 3:
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
Introduction to Computer Programming Computer Programming I Introduction to Aerospace Created by The North Carolina School of Science and Math.The North.
Introduction to High-Level Language Programming
COMPUTER SCIENCE I C++ INTRODUCTION
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
CSC141 Introduction to Computer Programming
COP1220/CGS2423 Introduction to C++/ C for Engineers Professor: Dr. Miguel Alonso Jr. Fall 2008.
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
1 EMT 101 – Engineering Programming Dr. Farzad Ismail School of Aerospace Engineering Universiti Sains Malaysia Nibong Tebal Pulau Pinang Week 1.
Computer Programming Basics Assistant Professor Jeon, Seokhee Assistant Professor Department of Computer Engineering, Kyung Hee University, Korea.
INTRODUCTION TO PROGRAMMING, ALGORITHMS & FLOWCHARTS Programming in C2 CHAPTER 1.
GCSE Computing#BristolMet Session Objectives#11 MUST identify what program instructions consist of SHOULD describe how instructions are coded as bit patterns.
Input, Output, and Processing
Practice and Evaluation. Practice Develop a java class called: SumCalculator.java which computes a sum of all integer from 1 to 100 and displays the result.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
INTRODUCTION Kingdom of Saudi Arabia Princess Nora bint Abdul Rahman University College of Computer Since and Information System CS240.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
Computer Systems Week 7: Looping and Input/Output with 3-bit Alma Whitfield.
ENEE150 – 0102 ANDREW GOFFIN Testing and Debugging.
Intro to Computers Computer Applications. What is a Computer? Initially the term computer referred to an individual whose job it was to perform mathematical.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
Computer Architecture and Organization
1 Pre-Exam Lecture 4 Final Examination is scheduled on Monday December 18th at 1:30PM in class 4 There are 8 questions with or without sub- parts and.
Intro to Programming Web Design ½ Shade Adetoro. Programming Slangs IDE - Integrated Development Environment – the software in which you develop an application.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
October 1, 2003Serguei A. Mokhov, 1 SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003.
Integers/Characters Input/Output Integers and Characters Input/Output System Calls. syscall Trap Handler Services for Integers and Characters Read Integer,
Irvine, Kip R. Assembly Language for x86 Processors 7/e, What's Next Linking to an External Library The Book's Link Library Stack Operations Defining.
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
Introduction to Computer Programming using Fortran 77.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
Algorithms and Flowcharts
F453 Module 8: Low Level Languages 8.1: Use of Computer Architecture.
Topic 2: Hardware and Software
The Little man computer
EGR 115 Introduction to Computing for Engineers
Print slides for students reference
Introduction to pseudocode
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Algorithm Discovery and Design
Algorithm Discovery and Design
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Introduction to Computer Programming
Computational Thinking
Quiz: Computational Thinking
CS105 Introduction to Computer Concepts Intro to programming
Presentation transcript:

An “interactive” application An introduction to “structured” assembly language programming

A human-computer dialogue Typical pattern: –Computer asks a question –Human types in a response Simple example: –Computer says: How many dots? –Human replies: 125 –Computer does as requested.

Standard C functions How can we do input/output in assembly? We can call standard C library functions But we need to know their “prototypes” For output (where STDOUT equals 1): write( STDOUT, &query, sizeof( query ) ); For input (where STDIN equals 0): read( STDIN, &buffer, sizeof( buffer ) );

Structured programming A discipline for faster program design Idea: break a big task into simple pieces It’s known as “task decomposition” We can use a diagram to illustrate it Diagram is called a “Structure Chart”

Structure Chart example main process_dataprint_outputobtain_input

Code for the ‘main’ function.section.text main:callobtain_input callprocess_data callprint_output ret.globlmain

Stubs You can write empty ‘stubs’ (for testing) obtain_input:ret process_data:ret print_output:ret Now you can ‘test’ your skeleton program (e.g. assemble, link, and execute)

Add details for each ‘stub’ First write your final subroutine, so you can see “something” on the screen You can use ‘dummy’ data temporarily Get it working correctly (debugged) Then you can focus on you next ‘stub’

Main algorithm Converting user’s input-string to a number That is “the hard part” in this example Idea: “scan” the array of character-codes Test each code (to see if it’s a valid digit) It must lie between ‘0’ and ‘9’ (ascii codes) If code is not not valid, the scanning stops Otherwise, adjust the accumulated total

Some new directives.ascii.asciz.long.byte.space

Some new CPU instructions sub dec cmp jg jl jz jnz movzx loop imul

Exercise with ASCII codes See what happens if you change the ascii code used for as value of the ‘dot’ variable Try using ascii value 7 Try using ascii value 9 Try using ascii value 10 Try using ascii value 111 Try using ascii value 250