15.04.2018 Views

programming-for-dummies

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The History of Computer Programming 13<br />

Registers<br />

Book I<br />

Chapter 1<br />

Figure 1-1:<br />

A processor<br />

uses its<br />

registers to<br />

temporarily<br />

store data.<br />

Processor<br />

Bus<br />

RAM<br />

Hard<br />

Disk<br />

Getting Started<br />

Programming a<br />

Computer<br />

This command tells the processor to move (mov) the hexadecimal number<br />

061h into the specific register named al. Other assembly language commands<br />

might tell the processor to add (add) or subtract (sub) a value from<br />

the number stored in a specific register.<br />

When you use assembly language, you have to tell the processor what data<br />

to store in which registers, how to manipulate the data in its registers, and<br />

when to remove data out of its registers.<br />

Sound tedious? It is. Although assembly language is far easier to understand<br />

and write than machine language, it’s still too complicated to use <strong>for</strong> creating<br />

really big computer programs, like word processors or video games.<br />

In the old days, most programs were written in assembly language, but as<br />

programs grew larger and more complicated, assembly language proved too<br />

cumbersome to write, edit, and modify.<br />

The biggest problem with assembly language is that you need to manipulate<br />

the processor’s registers just to do the simplest tasks. If you wanted to add<br />

two numbers together, you’d have to tell the processor to store a number<br />

into a register, add a second number to the number in the register, and then<br />

yank the result out of the register.<br />

Forcing people to know how to manipulate the processor’s registers be<strong>for</strong>e they<br />

can program a computer is like <strong>for</strong>cing people to know how their carburetor<br />

works be<strong>for</strong>e they can drive a car. Ideally, you don’t want to tell the processor<br />

how to manipulate data in its registers; you just want the processor to add two<br />

numbers without worrying about specific registers. So to make computer <strong>programming</strong><br />

even easier, computer scientists have hidden the technical details<br />

of manipulating registers by creating high-level languages.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!