Software: the instructions that run the machine
Hardware is the machine; software is the instructions that run it. There are two main kinds. The operating system manages the computer: it keeps the files, shares memory between programs, controls the devices, and starts and stops programs. A desktop computer and a phone each have an operating system of their own kind. Application software does a task for the user, such as writing a text, drawing or playing a game. A device driver is a small program that teaches the operating system how to use one device, such as a printer; a new device may need its driver. A program is stored as a list of instructions. To run it, the processor repeats three steps for each instruction: it fetches the instruction from main memory, decodes it (works out what it asks) and executes it. Then it moves to the next instruction. This cycle repeats billions of times a second in a real processor, but each step is small.
| Software | Kind |
|---|---|
| a drawing program | application software |
| shares memory between programs | operating system |
| makes a new printer work | device driver |
| Step | Instruction | Work cell after | Screen |
|---|---|---|---|
| 1 | LOAD 5 | 5 | |
| 2 | ADD 3 | 8 | |
| 3 | SHOW | 8 | 8 |
Write a three-instruction program for the invented machine that shows 10 (use only LOAD, ADD and SHOW), and trace it in a table like the one above.