<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_plain.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="Module.2004-02-25.2729">
  <name xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">1.1 - What is a program?</name>
  <metadata xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
  <md:version xmlns:bib="http://bibtexml.sf.net/">1.2</md:version>
  <md:created xmlns:bib="http://bibtexml.sf.net/">2006/05/18 11:01:30 GMT-5</md:created>
  <md:revised xmlns:bib="http://bibtexml.sf.net/">2006/05/18 11:20:39.651 GMT-5</md:revised>
  <md:authorlist xmlns:bib="http://bibtexml.sf.net/">
      <md:author xmlns:bib="http://bibtexml.sf.net/" id="nanand">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Naren</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Anand</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">nanand@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist xmlns:bib="http://bibtexml.sf.net/">
    <md:maintainer xmlns:bib="http://bibtexml.sf.net/" id="nanand">
      <md:firstname xmlns:bib="http://bibtexml.sf.net/">Naren</md:firstname>
      
      <md:surname xmlns:bib="http://bibtexml.sf.net/">Anand</md:surname>
      <md:email xmlns:bib="http://bibtexml.sf.net/">nanand@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist xmlns:bib="http://bibtexml.sf.net/">
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">ez430</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">MSP430</md:keyword>
    <md:keyword xmlns:bib="http://bibtexml.sf.net/">program</md:keyword>
  </md:keywordlist>

  <md:abstract xmlns:bib="http://bibtexml.sf.net/">Explains what a computer program is.</md:abstract>
</metadata>

  <content xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">
<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="program1">A <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">program</term> is a set of instructions that are grouped together to accomplish a task or tasks.  The instructions, called <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">machine code</term> or <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">assembly code</term> consist of things like reading and writing to memory, arithmetic operations, and comparisons.  While these instructions sound simple, it is actually possible to solve a huge group problems with them.  The difficulty in doing so is that you must specify in exact detail precisely how.  Good programming is both an art and a science, and what you will learn today is a beginning of the craft. 
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="program2">As mentioned above,  the individual instructions that the machine actually quite simple or <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">low-level</term> in computer parlance.  Writing complex programs in assembly code took such a long time that eventually better <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">programming languages</term> were invented.  A programming language, like C, is a formal set of grammar and syntax like assembly code; but the instructions in <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">high-level</term> languages encompass hundreds of assembly instructions.  Programs called <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">compilers</term> translate a program written in a higher level language into assembly so that the computer can actually execute the instructions.  Compilers let the programmer write programs so that humans can read them relatively easily while the computer can still execute the instructions. 
</para>

<para xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="program3">Generally programming code is organized into text files with suffixes that indicate the programming language.  In the case of C these files are appended with ".c", and a C program is made up of at least one of these files.  Many C programs also use <term xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/">header</term> files that contain frequently used segments of code so that it does not need to be written multiple times.  A ".h" is appended to the end of these files.  </para> 
  </content>
  
</document>
