To fix the problems mentioned in the last leasson, we have something called "interrupts." Basically, a given CPU takes code in from RAM or EEPROM (varies per processor) and stops, waits, or generally starts working on another task. This much is entirely under your control as a programmer for many CPUs. Whenever a connected piece of equipment wants the CPU's attention, it will set to "true" one of the pins that the CPU is dedicated to reading. The CPU will then change the "instruction pointer" to a specific address of RAM or EEPROM in response to this. As a programmer, you would write instructions that are meant to handle the interruption (more on this later). The CPU will automatically return to whatever it was doing before the interrupt occured in response to a specific instruction that would tell it to do so, which will probably grab the previous address from RAM or a dedicated register.

Get your own web kitty here!
┬ęCopyright 2010, 2011, 2012, 2013, 2014, 2017, 2018. All rights reserved.