A computer program is nothing more than a list of instructions for a microprocessor to carry out. A microprocessor instruction, in turn, is a specific pattern of bits, a digital code. Your computer sends the list of instructions making up a program to your microprocessor one at a time. Upon receiving each instruction, the microprocessor looks up what function the code says to do, then it carries out the appropriate action. Every microprocessor understands its own repertoire of instructions just as a dog might understands a few spoken commands. Where your pooch might sit down and roll over when you ask it to, your processor can add, subtract, move bit patterns around, and change them. Every family of microprocessor has a set of instructions that it can recognize and carry out, the necessary understanding designed into the internal circuitry of each chip. The entire group of commands that a given microprocessor model understands and can react to is called that microprocessor's instruction set or its command set. Different microprocessor families recognize different instruction sets, so the commands meant for one chip family would be gibberish to another. The Intel family of microprocessors understands one command set; the IBM/Motorola PowerPC family of chips recognize an entirely different command set. As a mere pattern of bits, a microprocessor instruction itself is a simple entity, but the number of potential code patterns allows for incredibly rich command sets. For example, the Intel family of microprocessors understands more than eight subtraction instructions, each subtly different from the others. Some microprocessor instructions require a series of steps to be carried out. These multi-step commands are sometimes called complex instructions because of their composite nature. Although the complex instruction looks like a simple command, it may involve much work. A simple instruction would be something like "pound a nail"; a complex instruction may be as far ranging as "frame a house." Simple subtraction or addition of two numbers may actually involve dozens of steps, including the conversion of the numbers from decimal to binary (1's and 0's) notation that the microprocessor understands. Broken down to its constituent parts, a computer program is nothing but a list of symbols that correspond to patterns of bits that signal a microprocessor exactly as letters of the alphabet represent sounds that you might speak. Of course, with the same back to the real basics reasoning, an orange is a collection of quarks squatting together with reasonable stability in the center of your fruit bowl. The metaphor is apt. The primary constituents of an orange-whether you consider them quarks, atoms, or molecules-are essentially interchangeable, even indistinguishable. By itself, every one is meaningless. Only when they are taken together do they make something worthwhile (at least from a human perspective), the orange. The overall pattern, not the individual pieces, is what's important. Letters and words work the same way. A box full of vowels wouldn't mean anything to anyone not engaged in a heated game of Wheel of Fortune. Match the vowels with consonants and arrange them properly, and you might make words of irreplaceable value to humanity: the works of Shakespeare, Einstein's expression of general relativity, or the formula for Coca-Cola. The meaning is not in the pieces but their patterns. Everything that the microprocessor does consists of nothing more than a series of these step-by-step instructions. A computer program is simply a list of microprocessor instructions. The instructions are simple, but long and complex computer programs are built from them just as epics and novels are built from the words of the English language. Although writing in English seems natural, programming feels foreign because it requires that you think in a different way, in a different language. You even have to think of jobs, such as adding numbers, typing a letter, or moving a block of graphics, as a long series of tiny steps. In other words, programming is just a different way of looking at problems and expressing the process of solving them. These bit-patterns used by microprocessors can be represented as binary codes, which can be translated into numbers in any format-hexadecimal and decimal being most common. In this form, the entire range of these commands for a microprocessor is called machine language. Most human beings find words or pseudo-words to be more comprehensible symbols. The list of word-like symbols that control a microprocessor is termed assembly language. You make a computer program by writing a list of commands for a microprocessor to carry out. At this level, programming is like writing reminder notes for a not-too-bright person of an ethnic background you want to denigrate-first socks, then shoes. This step-by-step command system is perfect for control freaks but otherwise is more than most people want to tangle with. Even simple computer operations require dozens of microprocessor operations, so writing complete lists of commands in this form can be more than many programmers want to deal with. Moreover, machine and assembly language commands are microprocessor-specific: they work only with the specific chips that understand them. Worse, because the microprocessor controls all computer functions, assembly language programs usually work only on a specific hardware platform. It needs software, that list of instructions called a program, to make it work. But a program is more than a mere list. It is carefully organized and structured so that the computer can go through the instruction list step by step, executing each command in turn. Each builds on the previous instructions to carry out a complex function. The program is essentially a recipe for a microprocessor. Microprocessors by themselves only react to patterns of electrical signals. Reduced to its purest form, the computer program is information that finds its final representation as the ever-changing pattern of signals applied to the pins of the microprocessor. That electrical pattern is difficult for most people to think about, so the ideas in the program are traditionally represented in a form more meaningful to human beings. That representation of instructions in human-recognizable form is called a programming language. Programming languages create their own paradox. You write programs on a computer to make the computer run and do what you want it to do. But without a program the computer can do nothing. Suddenly you're confronted with a basic philosophic question: Which came first, the computer or the program? The answer really lays an egg. With entirely new systems, the computer and its first programs are conceived and created at the same time. As a team of hardware engineers builds the computer hardware, another team of software engineers develops its basic software. They both work from a set of specifications, the list of commands the computer can carry out. The software engineers use the commands in the specifications, and the hardware engineers design the hardware to carry out those commands. With any luck, when both are finished the hardware and software come together perfectly and work the first time they try. It's sort of like digging a tunnel from two directions and hoping the two crews meet in the middle of the mountain. Moreover, programs don't have to be written on the machine for which they are meant. The machine that a programmer uses to write program code does not need to be able to actually run the code. It only has to edit and store the program so that it can later be loaded and run on the target computer. For example, programs for game machines are often written on more powerful computers called development systems. Using a more powerful machine for writing gives programmers more speed and versatility. Similarly, you can create a program that runs under one operating system using a different operating system. For example, you can write DOS programs under Windows. Moreover, you can write an operating system program while running under another operating system. After all, writing the program is little more than using a text editor to string together commands. The final code is all that matters; how you get there is irrelevant to the final program. The software writer simply chooses the programming environment he's most comfortable in, just as he choose the language he prefers to use.
|
|||||||||||||
Disclaimer
1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us or use the "Report this article" button on this page to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here. |
|||||||||||||