A computer program is “compiled” into machine code, which is a complex series of simple instructions. “Read that memory location”, “add that value to another value”, “if that result is bigger than 5, skip ahead 5 instructions”. The computer processor knows how to follow those instructions.
There’s more hardware than just the processor, so the processor needs to provide a way to interact with that hardware. There’s a couple ways that’s typically done. One way is by having specific instructions built into the processor. “Turn on the blinky light”. That was very common many decades ago, but most computers don’t work that way anymore. Another way is to make the hardware appear as if it were memory. “Write the value 1 to the memory location corresponding to the blinky light”.
Latest Answers