1 - buttons Click “Step Forward” to execute one line of the program. Click “Reset” to start over. “Play,” “Stop,” and “Step Back” are disabled in this.

Slides:



Advertisements
Similar presentations
What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the.
Advertisements

IT253: Computer Organization Lecture 6: Assembly Language and MIPS: Programming Tonga Institute of Higher Education.
CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
ABNIAC The following slide presentation is to acquaint the student with ABNIAC. The version used for presentation is the Java version, which can be found.
Algorithms Series of mathematical or variable manipulations Integer a,b,c a = 12 b = 22 c = a * b (what is c?) 12 * 22 = 264.
Lecture 2 Introduction to C Programming
 2000 Prentice Hall, Inc. All rights reserved. Chapter 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line.
Introduction to C Programming
Classes, methods, and conditional statements We’re past the basics. These are the roots.
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
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?
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
Guide To UNIX Using Linux Third Edition
Introduction to C Programming
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Python. What is Python? A programming language we can use to communicate with the computer and solve problems We give the computer instructions that it.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
A First Program Using C#
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Input & Output: Console
Introduction to Buffer Overflows Author: Jedidiah R. Crandall, Distributed: 14 July 2002 Embry-Riddle Aeronautical University in Prescott,
Invitation to Computer Science, Java Version, Second Edition.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
Buffer Overflow Intro. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. Introduction to Buffer Overflows Author:
By Noorez Kassam Welcome to JNI. Why use JNI ? 1. You already have significantly large and tricky code written in another language and you would rather.
Introduction to Computer Systems and the Java Programming Language.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Introduction To PROLOG World view of imperative languages. World view of relational languages. A PROLOG program. Running a PROLOG program. A PROLOG.
1 Programming in C Hello World! Soon I will control the world! Soon I will control the world!
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
Basic Systems and Software. Were we left off Computers are programmable (formal) machines. Digital information is stored as a series of two states (1.
February ,  2/16: Exam 1 Makeup Papers Available  2/20: Exam 2 Review Sheet Available in Lecture  2/27: Lab 2 due by 11:59:59pm  3/2:
How to Use BO Demos. ©2002, Jedidiah R. Crandall, Susan L. Gerhart, Jan G. Hogle. How to Use Buffer Overflow Demos (applets)
Fall 2002CS 150: Intro. to Computing1 Streams and File I/O (That is, Input/Output) OR How you read data from files and write data to files.
CSC141 Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture - 6.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 2 - Introduction to C Programming Outline.
Characters and Strings
 2007 Pearson Education, Inc. All rights reserved. A Simple C Program 1 /* ************************************************* *** Program: hello_world.
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Sudeshna Sarkar, IIT Kharagpur 1 Programming and Data Structure Sudeshna Sarkar Lecture 3.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Chapter 1 slides1 What is C? A high-level language that is extremely useful for engineering computations. A computer language that has endured for almost.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
Bill Tucker Austin Community College COSC 1315
A variable is a name for a value stored in memory.
Topics Designing a Program Input, Processing, and Output
Key Ideas from day 1 slides
Lesson 1 An Introduction
Variables and Primative Types
Introduction to C CSE 2031 Fall /3/ :33 AM.
I/O in C Lecture 6 Winter Quarter Engineering H192 Winter 2005
Conditions and Ifs BIS1523 – Lecture 8.
Format String.
Introduction to Primitive Data types
File I/O in C Lecture 7 Narrator: Lecture 7: File I/O in C.
Introduction to TouchDevelop
Topics Designing a Program Input, Processing, and Output
Tonga Institute of Higher Education IT 141: Information Systems
Topics Designing a Program Input, Processing, and Output
Capitolo 1 – Introduction C++ Programming
Tonga Institute of Higher Education IT 141: Information Systems
Introduction to C EECS May 2019.
Chapter 1 c++ structure C++ Input / Output
Introduction to Primitive Data types
Presentation transcript:

1 - buttons Click “Step Forward” to execute one line of the program. Click “Reset” to start over. “Play,” “Stop,” and “Step Back” are disabled in this version of the applet.

2 – input text box The input text box is enabled whenever a gets() function is being executed (library functions are not treated as separate subroutines in this applet). When it is enabled you may activate it and give input to the program by typing into the input box. The text box will ignore all non-alphabetic characters (‘1’, ‘?’, ‘~’, etc.) and will covert all lower case characters to upper case before passing the input on to the program.

3 – source code This is the C source code for the program that is being executed. You should understand several things even if you are not a C programmer: 1. PasswordOkay() will call the PasswordOkay() subroutine, 2. gets() reads a string from the user and puts() prints a string, 3. strcmp() compares two strings to see if they are the same, and 4. A statement like char A[5] = “HELLO” will allocate a five byte buffer called A and initialize it to “HELLO”. char Num = ‘R’ allocates one byte called Num and sets it equal to ‘R’.

4 – highlighted line The highlighted line of code is the one currently being executed. This lets you watch the path that the program execution takes.

5 – more source code Notice that the source code for different subroutines is also different colors. Also notice how an if statement looks: if (something is true) do one thing; else do something else;

6 – notes Every line of source code has a note that is shown on the bottom of the screen as it is executed. These notes might be hints or explanations of what is going on.

7- I/O area The Input/Output area is much like the terminal of a DOS or UNIX machine. The program can print things out for you to see and it can ask you to type things in (using the input text box) for it to store. Remember that you have to activate the input text box by clicking on it to give the program any input, and that you can only do this when the input text box is enabled during a gets() statement.

8 – memory There are 256 bytes of memory. Memory is laid out in hexadecimal notation (0x??) from left to right, top to bottom like you would read a book. 0x00 is the the first byte in memory, 0xFF is the last. 0xC9 is the ‘$’. It’s just like looking something up in a table.

9 – code text Code text is the program compiled into a format that the computer can understand. It is just a series of numbers like anything else in memory, except that each number represents a unique computer instruction. Note that a ‘*’ will show the current position of the program counter (how the computer keeps track of where it is) and an ‘X’ will be placed over an instruction to signify that that instruction called another subroutine and will be returned to. The color of the C code for a subroutine is the same as the color of the code text for that subroutine in memory.

10 - stack The stack stores return pointers, temporary variables and buffers, and sometimes other things. When something stored on the stack is no longer needed it is destroyed. You can watch the stack be built and destroyed as you execute the program. Notice that a ‘$’ is a return pointer to the subroutine with the same color as the box the ‘$’ is in. A ‘?’ is a canary which only StackGuard uses.

Glossary Execute – To execute the program means to “run” it. The two terms can be used interchangeably. Source code – this is the code that the programmer writes in a high-level language like Java, BASIC, or, in this case, C. A high-level language is one that humans can easily read and understand. Terminal – A terminal is a combination of a screen and a keyboard where the user of a program can type input into the program and receive output back. Memory – Memory is where the computer stores the code text for a program, the variables, the stack, and everything else that the program needs. Hexadecimal – The decimal system uses a base of 10, where 2863 has a 2 in the 1000’s place, an 8 in the 100’s place, a 6 in the 10’s place, and a 3 in the 1’s place. Hexadecimal uses 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F instead of just 0 through 9, where A = 10, B = 11 … F = 15. The base of hexadecimal is 16, so it has a 1’s place, a 16’s place, a 256’s place, a 4096’s place, etc. 0 through 255 can be represented in hexadecimal as 0x00 through 0xFF. 0x?? is a common convention for distinguishing hexadecimal numbers from decimal numbers. Compiled – A compiler takes the source code a programmer has written and turns it into code text that a computer can easily execute. Code text is a sequence of instructions. Instruction – An instruction tells the computer what to do, but it is very low-level. Unlike source code, it works at the computer level telling the computer what elementary steps to take to execute the program. Program counter – The instructions are stored as a sequence of numbers in the computer just like anything else. The computer usually executes one instruction after another unless it is told to jump somewhere else. The program counter keeps track of what instruction in memory is being executed at any given time. Jump – A jump occurs when the computer is told to start executing instructions somewhere else besides the next instruction after the current one being executed. Canary – A canary is put in memory and if it is overwritten then something is wrong. It is analogous to the canaries used in coal mines to detect poisonous gas.