What is a Programmer's Model?

I would describe it as follows...

In a computer system, the programmers model shows what the CPU has available to a programmer for the execution of computer programs. It covers the CPU resources for execution of the CPU's instruction set.

This programmers model would not detail hardware, such as how the CPU's electronic circuitry works, how buses transport data or the I/O peripherals available. In other words, the programmers model would not cover functions that cannot be observed by CPU instructions. The latter excludes programs trying to detect hardware operations, such as cache behaviour, read/write variances because of varying bus delays etc.

I imagine this could be debated but its remained a continual definition for me across the CPU systems I've seen over the years.


Basically, the "programmer's model" shows all elements of the computer (state variables, AKA registers) that can affect — or be affected by — the execution of instructions.

That model is what the instruction descriptions refer to when explaining exactly what each instruction does.

The underlying details of how all of that is actually accomplished are hidden from the programmer.

For example, looking at the programmer's model for the M68K architecture, you'd never be able to tell whether the underlying physical implementation used 8, 16, or 32-bit data paths and registers. There have been examples of all three, but they're programmed identically. This is important for the reusability of software, including software development tools.