📜 ⬆️ ⬇️

How to understand the assembler. Part 2. Microcontroller

Well, it's time to dig a little deeper. Understanding of the assembler itself is so unimaginable for me without understanding how the microcontroller works. Let's leave our characters in the room and reuse our imagination.
So now you just need to represent what I am writing about.
***
Imagine you are sitting inside a microcontroller. Let's say inside ATmega 8. Only a microcontroller is such a large, rectangular white room, and you sit in a comfortable chair in its very center. This room - your personal control center - you manage it from outside. So far it does not matter WHAT - it is important HOW .

So let's go over your “lab” and call this room that way.

To your right is the Compact of the Eden Generators Compact Clock Frequency. It just seems like it's such a scary thing with a scary name. In fact, this is a big bell, as the school was on the wall. And he has similar tasks.
From the left of you there is a conveyor - a normal conveyor like at the factory.
So you say you are sitting on a chair, you don’t touch anyone - and then the bell rings ... What does this mean? This means that it’s time for you to check if there is anything on the conveyor. You look - and there is an envelope, the number “0001” is printed on the envelope - you open it - and it says “We need to do such a thing” - you stretch, put the envelope back on the conveyor, get up from the table and go to do this very thing . I did and go back, sit at the table and sit for yourself, smoke CAMEL. Some time goes by - the bell rings again - you watch - and on the conveyor there is another envelope under the number “0002” - you open it, read what you need to do, put it back on the conveyor belt and go doing it. Then you come and sit down to drink tea. Then after some time the bell again - again the envelope - you open it and it’s empty ... Well, it's empty and empty. Put it back and sit yourself on waiting for the next call.
So here it is important to know:
1. The envelopes contain instructions for you.
2. You are able to perform any of these instructions.
3. You always have time to do what is written in the envelope before the next bell rings.
Well, you should also know about the characteristics of your call. The main characteristic of a call is the clock frequency - that is, how many times per second a call can “tinkle”. At ATmega8 there can be a frequency of 8 or 16 megahertz. That is, if our call works on 8 megahertz, then it can “ring” 8 million times in 1 second. That is, it turns out that what is highlighted in bold above and underlined you manage to do it in one eight-millionth part of a second. You are very fast, buddy!

')

Source: https://habr.com/ru/post/201546/


All Articles