CSE 425: Target Machine Architecture Target Machine Details Many architectures can be similar in overall structure –E.g., Von Neumann with CISC instruction.

Slides:



Advertisements
Similar presentations
Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
Advertisements

ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
Computer Architecture CSCE 350
Memory allocation CSE 2451 Matt Boggus. sizeof The sizeof unary operator will return the number of bytes reserved for a variable or data type. Determine:
CSE 425: Semantic Analysis Semantic Analysis Allows rigorous specification of a program’s meaning –Lets (parts of) programming languages be proven correct.
CSE 425: Semantics II Implementing Scopes A symbol table is in essence a dictionary –I.e., every name appears in it, with the info known about it –Usually.
CSE 425: Logic Programming I Logic and Programs Most programs use Boolean expressions over data Logic statements can express program semantics –I.e., axiomatic.
Programming Declarations. COMP102 Prog. Fundamentals I: Declarations/ Slide 2 General form of a C++ program // Program description #include directives.
CSSE 332 Functions, Pointers in C. 2 Functions - why and how ? If a problem is large If a problem is large Modularization – easier to: Modularization.
Introduction to Pointers These Slides NOT From Text.
Sizes of simple data types sizeof(char) = 1 size(short) = 2 sizeof(int) = 4 size(long) = 8 sizeof(char) = 1 size(short) = 2 sizeof(int) = 2 size(long)
Dynamic Memory Allocation in C++. Memory Segments in C++ Memory is divided in certain segments – Code Segment Stores application code – Data Segment Holds.
1 CS 201 Introduction to Pointers Debzani Deb. 2 Incoming Exam Next Monday (5th March), we will have Exam #1. Closed book. Sit with an empty space in.
1 9/10/07CS150 Introduction to Computer Science 1 Data Types Section 2.7 – 2.12 CS 150 Introduction to Computer Science I.
1 Homework Turn in HW2 at start of next class. Starting Chapter 2 K&R. Read ahead. HW3 is on line. –Due: class 9, but a lot to do! –You may want to get.
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
1 Fundamental Data Types. 2 Declaration All variables must be declared before being used. –Tells the compiler to set aside an appropriate amount of space.
1 9/8/08CS150 Introduction to Computer Science 1 Data Types Section 2.7 – 2.12 CS 150 Introduction to Computer Science I.
CEG 221 Lesson 2: Homogeneous Data Types Mr. David Lippa.
Run-time Environment and Program Organization
The fundamental data type 제 4 주 강의. Declarations, Expressions, and Assignments Declaring the type of a variable  set an appropriate amount of space in.
CS150 Introduction to Computer Science 1
CSE 425: Intro to Programming Languages and their Design A Few Key Ideas No particular language is a prerequisite for this course –However you should be.
CSE 425: Object-Oriented Programming II Implementation of OO Languages Efficient use of instructions and program storage –E.g., a C++ object is stored.
CSE 425: Data Types II Survey of Common Types I Records –E.g., structs in C++ –If elements are named, a record is projected into its fields (e.g., via.
3. The Nuts and Bolts of C++ Computer Programming 3. The Nuts and Bolts of C++ 1 Learning the C++ language 3. The Nuts and Bolts of C++ (4)
CSE 425: Concurrency III Monitors A monitor is a higher level construct for synchronizing multiple threads’ access to a common code segment –Can implement.
CSE 425: Object-Oriented Programming I Object-Oriented Programming A design method as well as a programming paradigm –For example, CRC cards, noun-verb.
C programming or Fun with pointers Tutorial #2 CPSC 261.
Journal Entry: Unit #5 Entry #3 Define the following words from ch2 in your journals: Binary, bit, discrete, unambiguous signals, digital, analog signal,
CSE 425: Data Types I Data and Data Types Data may be more abstract than their representation –E.g., integer (unbounded) vs. 64-bit int (bounded) A language.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Chris Gill Department of Computer Science and Engineering Washington University in St. Louis.
ECE 103 Engineering Programming Chapter 47 Dynamic Memory Alocation Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103.
CSE 425: Syntax II Context Free Grammars and BNF In context free grammars (CFGs), structures are independent of the other structures surrounding them Backus-Naur.
Pointers: Basics. 2 What is a pointer? First of all, it is a variable, just like other variables you studied  So it has type, storage etc. Difference:
CSE 425: Control Flow I Categories of Control Flow Constructs Sequencing –order of expressions and statements Selection –if, else, switch Iteration –loops.
CSE 425: Concurrency II Semaphores and Mutexes Can avoid bad inter-leavings by acquiring locks –Guard access to a shared resource to take turns using it.
CSE 425: Control Abstraction I Functions vs. Procedures It is useful to differentiate functions vs. procedures –Procedures have side effects but usually.
Topics memory alignment and structures typedef for struct names bitwise & for viewing bits malloc and free (dynamic storage in C) new and delete (dynamic.
CS415 C++ Programming Takamitsu Kawai x4212 G11 CERC building WV Virtual Environments Lab West Virginia University.
Slide 1 WEEK 8 Imperative Programming Original by Vitaly Shmatikov.
Object Oriented Software Development 4. C# data types, objects and references.
CSE 425: Syntax I Syntax and Semantics Syntax gives the structure of statements in a language –Allowed ordering, nesting, repetition, omission of symbols.
CSE 425: Control Abstraction II Exception Handling Previous discussion focuses on normal control flow –Sometimes program reaches a point where it cannot.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 12 – C: structs, linked lists, and casts.
PHY 107 – Programming For Science. Today’s Goal  Learn how arrays normally used in real programs  Why a function returning an array causes bugs  How.
Department of Electronic & Electrical Engineering Types and Memory Addresses Pointers & and * operators.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – ARM Addressing Endianness, Loading, and Storing Data – Data Layout Struct Packing.
Announcements There is a Quiz today. There were problems with grading assignment 2, but they should be worked out today The web page for correcting the.
CSE 425: Functional Programming I Programs as Functions Some programs act like mathematical functions –Associate a set of input values from the function’s.
CSE 303 Concepts and Tools for Software Development Richard C. Davis UW CSE – 10/11/2006 Lecture 7 – Introduction to C.
Sections Basic Data Structures. 1.5 Data Structures The way you view and structure the data that your programs manipulate greatly influences your.
“Success consists of going from failure to failure without loss of enthusiasm.” Winston Churchill.
Data in Memory variables have multiple attributes symbolic name
Names and Attributes Names are a key programming language feature
CSE 374 Programming Concepts & Tools
Fundamental Data Types
CSE 425 Fall 2015 Midterm Exam 80 minutes, during the usual lecture/studio time: 10:10am to 11:30am on Monday October 12, 2015 Arrive early if you can,
Introduction to the C Language
Iteration Implemented through loop constructs (e.g., in C++)
August 29 New address for Fang-Yi
Delayed Evaluation Special forms in Scheme (e.g., if and cond) do not use applicative order evaluation Only one of two or more expressions is actually.
Comp Org & Assembly Lang
Pointers Pointers point to memory locations
Fundamental Data Types
Dynamic Memory A whole heap of fun….
What Actions Do We Have Part 1
January 16 The books are here. Assignment 1 now due Thursday 18 Jan.
CIS*2450 Advanced Programming Concepts
Presentation transcript:

CSE 425: Target Machine Architecture Target Machine Details Many architectures can be similar in overall structure –E.g., Von Neumann with CISC instruction sets is common –RISC architectures also have been used and still are For programming languages, architecture of the target machine also imposes a number of details to consider –Especially to retarget a compiler to another machine –Especially to write software that’s portable across machines –E.g., sizes, other details of memory locations and addresses Programming language details often based on them –Sizes and layouts of data types, aliases, objects, etc. –Addresses, how incremented/decremented pointers move, relative to other variables address space (local, array, heap) –Directions stack and heap grow in memory address space

CSE 425: Target Machine Architecture Example Data Size Rules (from C++) Rules governing data sizes [from Stroustrup 4 th Ed] –R1: 1 == sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long) <= sizeof(long long) –R2: 1 <= sizeof(bool) <= sizeof(long) –R3: sizeof(char) <= sizeof(wchar_t) <= sizeof(long) –R4: sizeof(float) <= sizeof(double) <= sizeof(long double) –R5: sizeof(N) == sizeof(signed N) == sizeof(unsigned N) where N is char, short, int, long, or long long (integral types) Minimum data sizes for some types [from LLM 5 th Ed] –R6: char must be at least 1 byte (8 bits) –R7: wchar_t, char16_t, short, int must be at least 2 bytes –R8: char32_t and long must be at least 4 bytes –R9: long long must be at least 8 bytes

CSE 425: Target Machine Architecture Today’s Studio Exercises We’ll look at some target machine details today –Data sizes, pointer addresses, etc. Today’s exercises are again in C++ –Please take advantage of the on-line reference manual pages that are linked on the course web site –As always, please ask us for help as needed When done, send with “Target Machine Studio” in the subject line to the course account