How the CPU works

How the CPU works

Most important for understanding assembler is to understand how the CPU works. The CPU reads instructions (instruction fetch) from the program storage (the flash), translates those into executable steps and executes those. In AVRs, those instructions are written as 16 bit numbers to the flash storage, and are read from there (first step). The number read then translates (second step) e. g. to transporting the content of the two registers R0 and R1 to the ALU (third step), to add those (fourth step) and to write the result into the register R0 (fifth step). Registers are simple 8 bit wide storages that can directly be tied to the ALU to be read from and to be written to.

No comments:

Post a Comment

ShareThis