Intro - Some Computer Preliminaries Before we get started,...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Some Computer Preliminaries Before we get started, let's look at some basic components that play a major role in a computer's ability to run programs: 1) Central Processing Unit: The "brains" of the computer that actually execute all the instructions the computer runs. 2) Main Memory: All running programs and data they use must be stored here. This is only active when the computer is physically on. 3) External Memory: This is more permanent memory, such as a hard-drive, floppy disk, CD, etc. In order for any programs stored on these medium to run, they have to be transferred into main memory. 4) Operating System: Provides an interface between the machine and the user and allocates the computer's resources. 5) Compiler: A "translator" which converts a program written in a high-level computer language into machine language, a set of 0s and 1s understood by the computer. 6) Application Programs: Programs intended to be used by end-users on a computer.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
How everything fits together When you boot up your computer, the first major thing that occurs, is that the operating system gets loaded into main memory. This program (the operating system), is responsible for providing the user with a nice interface, and responding to the requests of the user. For example, if the user double clicks on the Netscape icon, this invokes the computer to find the Netscape program stored on the hard drive and load it into main memory. Once the program is loaded into main memory, if no other program needs to be run, then it becomes the current program running. Any data this program needs to execute must also be loaded into main memory. All executable programs are stored in machine language, which is understood by the machine. In this class, our goal will be to learn how to write some simple programs in a high-level language, C, that can be compiled into executable programs. The vast majority of the work you all will do for this class will follow the cycle pictured on page 3 of the text. This process can be listed as follows: 1) Edit your program 2) Compile your program 3) Execute your program 4) Go to step 1, if you are not satisfied with your results. The key here is to note that changing your program doesn't automatically change how it runs. Compilation is necessary.
Background image of page 2
/* Arup Guha My First C Program 8/26/04 COP 3223 Rocks! */ #include <stdio.h> int main(void) { printf("COP 3223 Rocks!\n"); return 0; } Let's take this program apart line by line: /* Arup Guha My First C Program 8/26/04 COP 3223 Rocks! */ This is a comment, which is ignored by the compiler. The purpose of a comment is to help the reader identify key information about the program. The first comment in a program, the header comment, should identify the author of the program, the date the program was written, as well as a brief description of the program. We will talk about other types of comments later. The computer knows that this portion of the code is a comment because it starts with /*. Everything
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

Intro - Some Computer Preliminaries Before we get started,...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online