Lecture1

Put 0 in variable i copy the value of y into variable

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cmp bne #0, x #1, y #0, i y, t x, y t, x #1, i i, n loop Put 0 in variable x What does Put 1 in variable y this do? Put 0 in variable i Copy the value of y into variable t Add the value of x to variable y Copy the value of t into variable x Add 1 to variable i Compare the values of variables i and n If they are not equal, go back to “loop:" loop: ❖ Assembler is a program that converts programs written in the Assembly language into machine language (binary). Lecture Unit 1 ECE15: Introduction to Computer Programming Using the C Language 17 Software: High-Level Languages ❖ Examples: Fortran, Pascal, C, C++, Java, Lisp, etc. x = 0; y = 1; i = 0; n = 30; do { t= y= x= } while y; y + x; t; (i++ < n); What does this do? y = 1, 1, 2, 3, 5, 8, 13, 21, 34, … i = 0, 1, 2, 3, 4, 5, 6, 7, 8, … ‣ High-level languages include more powerful instructions than an Assembly language. Easier to write and understand. ‣ Compiler is a program that converts programs written in a high-level language into machine language of a specific computer. ECE15: Introduction to Computer Programming Using the C Language Lecture Unit 1 18 Software: Operating Systems ❖ An operating system is a collection of programs that ‣ Initiates the execution of all other programs ‣ Allocates resources (memory, CPU cycles) to other programs ‣ Controls the entire computer system and its peripherals ❖ Whenever a computer is powered on, an operating system is running in the background, managing the computer. ❖ The operating system effectively mediates between all of the hardware and software in a computer. ❖ Examples: inu L x Lecture Unit 1 ECE15: Introduction to Computer Programming Using the C Language 19 The Five Steps of Software Writing Step 1: Analysis -- definition of the input and desired output Step 2: Design of the program: ‣ Developing an algorithm for producing desired output from input ‣ Designing the appropriate data structures ‣ Breaking down the algorithm into simple components Step 3: Implementation -- coding using the chosen language St...
View Full Document

This note was uploaded on 04/15/2010 for the course ECE ECE15 taught by Professor Vardy during the Fall '08 term at UCSD.

Ask a homework question - tutors are online