Page 2: programming

This second page shows how computer programs transform a number crunching machine into a versatile tool that seems to think.

The earliest computer operators performed a desired calculation by wiring up the circuits appropriately, which was time consuming and inefficient. A Princeton University mathematician, John von Neumann described the concept of a stored program:

Machine instructions

One byte (eight bits) represents an instruction. For example, for IBM-PC compatible compuers:

10110000 00000111
Means move the number 7 into position A (note that binary 00000111 = 7)
00000011 11000011 (a two-byte long instruction)
Add the bits in location A to those in location B, placing the result in A.

Program code

When a computer program is run, machine language instructions are placed in memory with an instruction pointer set to that location. After each byte is executed the instruction pointer is advanced to the next step, and so on.

Consider the things a machine instruction can call for:

Sounds exciting, huh? Well, it is. In particular, look at that last instruction again:

In IBM-PC language this is number 11100011, called JCXZ, or "Jump if CX is zero." The emphasis is on if!

The principle that the flow of instructions can branch conditionally is at the heart of the magic of computing. Now see what concepts can be represented in machine language code:

The point is, a programmer can write code (computer programming) to specify in advance what it should do, including writing to the screen, printing on paper, calculating numbers and saving them in memory. What is more, it can accept input from the user and react according to how it is programmed. That is how a computer ticks.

Back to index page|Back to page 1