March 2005 1R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class More “Clarifications” ?More “Clarifications” ? Interrupts – integrating.

Slides:



Advertisements
Similar presentations
March R. Smith - University of St Thomas - Minnesota Today’s Class Quiz RecapQuiz Recap Exam ReviewExam Review C MaterialC Material Matlab MaterialMatlab.
Advertisements

CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#4)
C Programming for engineers Teaching assistant: Ben Sandbank Home page:
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class ProjectsProjects 2 dimensional arrays2 dimensional arrays Higher dimensionsHigher.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Three exam questionsThree exam questions Lab with filesLab with.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class More about FunctionsMore about Functions RecursionRecursion.
March R. Smith - University of St Thomas - Minnesota Today’s Class Recap of a simple programRecap of a simple program A “history” of CA “history”
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Hard Drives – more laterHard Drives – more later MethodsMethods.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam TopicsExam Topics.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class The project assignment, againThe project assignment, again Arrays.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Functions and Array ArgumentsFunctions and Array Arguments ExamExam.
March R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Class on Wednesday – “Lab time” in OSS 230Class on Wednesday – “Lab.
March R. Smith - University of St Thomas - Minnesota Today’s Class RecapRecap More course thingsMore course things Work on labs/projectsWork on labs/projects.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Final Exam ReviewFinal Exam Review –Assessment –Exam Format –C –Matlab.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class I/O ObjectsI/O Objects Lab 12Lab 12.
Software Language Levels Machine Language (Binary) Assembly Language –Assembler converts Assembly into machine High Level Languages (C, Perl, Shell)
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Today’s LabToday’s Lab SortingSorting.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Reviewing previous workReviewing previous work Using a dialog boxUsing.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class End of Chapter 2: READ Section 2.15End of Chapter 2: READ Section.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class HomeworkHomework Nested LoopsNested Loops Other thingsOther things.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class The ProjectThe Project PointersPointers.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Class projectsClass projects Lab 13: Use the method documentation.
6/22/2015 1R. Smith - University of St Thomas - Minnesota QMCS Class Today St. Lukes Case StudySt. Lukes Case Study.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Exam ReviewExam Review Arithmetic - I think everyone gets thisArithmetic.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Upcoming Exam – April 8Upcoming Exam – April 8 Structures ReviewStructures.
March R. Smith - University of St Thomas - Minnesota QMCS Class Today Cryptography – introductory termsCryptography – introductory terms “Enigma”
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class RecapRecap Functions and CFunctions and C Using FunctionsUsing Functions.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class MethodsMethods Problem solving by decompositionProblem solving by.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230 – Today in Class Authorizing OvertimeAuthorizing Overtime Weird Java stuff: conditionals,
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Nested IFNested IF “Boolean” Logical Operations“Boolean” Logical.
March R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class ProjectsProjects Exam ReviewExam Review Interrupts and TrapsInterrupts.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Lab Status, Paper StatusLab Status, Paper Status Comments on Ints vs.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Random NumbersRandom Numbers Output filesOutput files Input filesInput.
6/28/2015 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class History Paper recapHistory Paper recap Finish the movieFinish the movie.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Data IndependenceData Independence Matlab #3: Exercise 5.1Matlab #3:
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Finish up Lab 13Finish up Lab 13 Lab 14 – DetailsLab 14 – Details.
March R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Administrative: do you want another lab?Administrative: do you want.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Revised Lab 14/15Revised Lab 14/15 Counting WordsCounting Words Moving.
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Homework & GradesHomework & Grades Multiple DimensionsMultiple Dimensions.
March R. Smith - University of St Thomas - Minnesota Today’s Class Homework NotesHomework Notes –Always try to match the printed output if I give.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Change in order of topicsChange in order of topics –Starting Chapter.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class The ExamThe Exam Homework NotesHomework Notes.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Peek at Lab 16Peek at Lab 16 Side effects and arraysSide effects and.
COMP 110: Introduction to Programming Tyler Johnson January 14, 2009 MWF 11:00AM-12:15PM Sitterson 014.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
9/21/2015 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class RecapRecap Files, writing filesFiles, writing files 1D Array Recap1D.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
CS 106 Introduction to Computer Science I 01 / 25 / 2010 Instructor: Michael Eckmann.
The string data type String. String (in general) A string is a sequence of characters enclosed between the double quotes "..." Example: Each character.
Introduction to Computer Systems and the Java Programming Language.
5/27/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class RecapRecap Drawing in 2 dimensionsDrawing in 2 dimensions Vertical HistogramVertical.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Grades & Lab 12Grades & Lab 12 Upcoming ExamUpcoming Exam StructuresStructures.
March R. Smith - University of St Thomas - Minnesota QMCS Class Today “Enigma” recap and finish“Enigma” recap and finish The quiz/surveyThe.
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
By Mr. Muhammad Pervez Akhtar
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
2/22/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class History Paper scheduleHistory Paper schedule RecapRecap Plus PlusPlus.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class What’s on the Exam Next Week?What’s on the Exam Next Week? Lab 8Lab.
Chapter 1: Introduction to Computers and Programming.
INTRODUCTION TO PROGRAMING System Development Mansoura October 2015.
7/6/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Collect PapersCollect Papers Review: Our ZeroesReview: Our Zeroes Review:
7/6/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Computer HardwareComputer Hardware Recap: next programRecap: next program.
Engineering Problem Solving With C An Object Based Approach
Chapter 11 Introduction to Programming in C
Chapter 6 Programming the basic computer
Presentation transcript:

March R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class More “Clarifications” ?More “Clarifications” ? Interrupts – integrating hardware & softwareInterrupts – integrating hardware & software C – getting a compilerC – getting a compiler C – doing itC – doing it

March R. Smith - University of St Thomas - Minnesota Interrupts The ‘ask a question’ analogyThe ‘ask a question’ analogy –Prioritizing First come first servedFirst come first served Favorites firstFavorites first Integrating hardware and softwareIntegrating hardware and software –What does the hardware do? –What does the software do?

March R. Smith - University of St Thomas - Minnesota Examples Where do interrupts get involved?Where do interrupts get involved? Start “keyboard read”Start “keyboard read” Start “printer output”Start “printer output” Start “disk read”Start “disk read” Start “disk write”Start “disk write” Page interruptPage interrupt

March R. Smith - University of St Thomas - Minnesota Programming Languages Compilers vs InterpretersCompilers vs Interpreters –Perl, Lisp, Basic are usually interpreters –C, Fortran, “classic” languages are compiled The 3 step processThe 3 step process –Code – compile – run C generates “machine code”C generates “machine code” –Java produces ‘machine independent bytecodes’ C is “just a little” above assembly languageC is “just a little” above assembly language –You get to play with RAM addresses

March R. Smith - University of St Thomas - Minnesota The C Compiler PreprocessorPreprocessor –Handles operations with # in column 1 CompilerCompiler –Two phases build and use a symbol table, like assemblers –Phase 1 reads the code and analyzes its structure Finds syntax errorsFinds syntax errors –Phase 2 generates the actual executable code LinkerLinker –For ‘linking together’ binaries that were compiled separately –Combine a ‘main’ program with library procedures getchar(), putchar(), println()getchar(), putchar(), println()

March R. Smith - University of St Thomas - Minnesota Getting a C Compiler They’re all “pretty” standardThey’re all “pretty” standard We are doing “standard I/O”We are doing “standard I/O” –No graphics, windows, ad nauseum If you have one, keep with itIf you have one, keep with it I’ll be using Watcom (University of Waterloo)I’ll be using Watcom (University of Waterloo) Monday’s Assignment: get a compiler and write ‘Hello World’ with it. Hand in a ‘reflection’ on it.Monday’s Assignment: get a compiler and write ‘Hello World’ with it. Hand in a ‘reflection’ on it.

March R. Smith - University of St Thomas - Minnesota Using C We’ve all taken Java or something, right?We’ve all taken Java or something, right? C is Java without objectsC is Java without objects –Or, with address calculations substituted for objects –Some would say it’s a good trade Others would compare it with trading a safety razor for a straight razor (or a sharp knife)Others would compare it with trading a safety razor for a straight razor (or a sharp knife) The safety razor requires more “infrastructure”The safety razor requires more “infrastructure” the straight razor is more versatile and more dangerousthe straight razor is more versatile and more dangerous Hello World?Hello World?

March R. Smith - University of St Thomas - Minnesota C weirdnesses Actual code starts with: int main() {Actual code starts with: int main() { –Like public static int main(String[] args) in java EVERYTHING Returns a ValueEVERYTHING Returns a Value –Assignment statements, many procedures, conditionals, etc. Avoid weird, stupid, and/or dangerous thingsAvoid weird, stupid, and/or dangerous things –Increment operators except in selected places –Using the result of an assignment statement –I won’t use the “assignment operators” Can’t avoid all such thingsCan’t avoid all such things –Address arithmetic is unavoidable

March R. Smith - University of St Thomas - Minnesota I/O makes a program ‘interesting’ #include #include getchar() returns the next charactergetchar() returns the next character –Greater than zero is a character –Treat 0 as end of file –Look for ‘\n’ to find the end of a line putchar(ch) writes the character ‘ch’ to outputputchar(ch) writes the character ‘ch’ to output –Again, ‘\n’ starts a new line printf(“Text string\n”)printf(“Text string\n”) –Prints text strings –Can also do outbound number conversion

March R. Smith - University of St Thomas - Minnesota Inbound Number Conversion A good exerciseA good exercise –Gets us thinking about the difference between numbers and their representations –We can generalize this to all bases Num = (Num * Base) + (NextChar – ‘0’)Num = (Num * Base) + (NextChar – ‘0’) Just loop till NextChar isn’t a digit.Just loop till NextChar isn’t a digit.

March R. Smith - University of St Thomas - Minnesota That’s it. Questions?Questions? Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.