the course. description computer systems programming using the c language – and possibly a little...

10
The course

Upload: owen-gregory

Post on 05-Jan-2016

218 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction

The course

Page 2: The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction

Description

• Computer systems programming using the C language– And possibly a little C++

• Translation of C into assembly language• Introduction to fundamental data structures– array– list– tree– hash table

Page 3: The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction

Why C?

• Programs can be fast• Programs can be small• Runs on many platforms– Including embedded processors– Generally with some version of GCC

• Relatively easy to learn• Useful “standard” library• A subset of C++

Page 4: The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction

Why not C?

• Can get very obscure ++a = *p->q + b * (x>y ? 5 : 13) ;

• Can lack robustness– Many viruses “attack” servers written in C

• Mostly because of a small number of library routines

• Hard to manage large software projects– Without object-oriented techniques

• No clear standards for graphical user interfaces• C++ can be fast• Java can be small

Page 5: The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction

Which C ?

• K & R C -- 1972– The Kernighan and Richie classic

• ANCI C -- started 1983– ANSI X3.159-1989 and ISO/IEC 9899:1990– Standard C, C89, C90

• C90– Another ANSI standard (adds C++/Java syntax)

• GCC

Page 6: The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction

C with objects

• C++– Used for business and gaming applications

• Java– Used for networking and user interface– Executes on a “virtual machine”

• C#– Used by Microsoft

Page 7: The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction

Computer system programming?

• Not your father’s system(s) programming– No operating system kernels– Not for system administrators• Who probably use perl and python

– Not linux system programming

• Closer to application programming– But at an introductory level

Page 8: The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction

Translation into assembly

• Illustration of modern compilation techniques– Lexical analysis (flex)• radius is a variable• 3.14 is a constant

– Syntactic analysis (bison)• 3.14 * radius * radius is an expression

– Code generation• By example

Page 9: The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction

Fundamental data structures

• Ways of ordering information– For fast access– For growth

• The most useful ones– Generally taught in CS1 or CS2

Page 10: The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction

Student learning outcomes

• Convert the following C language elements to LC-3 assembly language: functions, pointers, arrays, structures.

• Demonstrate the use of C compilers and debugging tools.• Implement the following data structures in C: array, list, tree,

hash table• Define, implement, and use an abstract data type.• Analyze an algorithm to determine its execution time.• Design and implement a C program that performs a specified

task.