
How to understand assembler. Part 2. Microcontroller
Well then, it's time to dig a little deeper. Understanding the assembler itself for me is not conceivable without understanding how the microcontroller works. Let's leave our characters in the room and use our imagination again.
So now you just need to imagine what I’ll write about.
***
Imagine that you are sitting inside a microcontroller. Let's say inside the ATmega 8. Only the microcontroller is such a large rectangular white room, and you are sitting in a comfortable chair in the very center of it. This room is your personal control center - from it you control what is outside. While it does not matter THAN - while it is important HOW .
So let's go through your “laboratory”, we will call this room like that.
To your right is theEden Tabernacle CompactClock Frequency. It just seems like it's such a scary thing with a scary name. This is actually a big bell, as the school was on the wall. And his tasks are similar.
To your left is a conveyor - an ordinary conveyor as in a factory.
So you say you sit on the armchair, do not 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 “You 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 it, and you go back, sit down at the table and sit yourself, smoke CAMEL. Some time passes - the bell rings again- you look - and another envelope with the number "0002" already lies on the conveyor - you open it, read what needs to be done, put it back on the conveyor and go do it. Then you come and sit down to drink tea. Then after some time the call again - again the envelope - you open and there it is empty ... Well, empty and empty. Put it back and sit yourself further waiting for the next call.
So this is what 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 complete 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 “jingle”. ATmega8 can have a frequency of 8 or 16 megahertz. That is, if our call works at 8 megahertz - then it can “tinkle” 8 million times in 1 second. That is, it turns out that something that is highlighted in bold and underlined you manage to do in one eight-millionth part of a second. You are very fast, buddy!
So now you just need to imagine what I’ll write about.
***
Imagine that you are sitting inside a microcontroller. Let's say inside the ATmega 8. Only the microcontroller is such a large rectangular white room, and you are sitting in a comfortable chair in the very center of it. This room is your personal control center - from it you control what is outside. While it does not matter THAN - while it is important HOW .
So let's go through your “laboratory”, we will call this room like that.
To your right is the
To your left is a conveyor - an ordinary conveyor as in a factory.
So you say you sit on the armchair, do not 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 “You 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 it, and you go back, sit down at the table and sit yourself, smoke CAMEL. Some time passes - the bell rings again- you look - and another envelope with the number "0002" already lies on the conveyor - you open it, read what needs to be done, put it back on the conveyor and go do it. Then you come and sit down to drink tea. Then after some time the call again - again the envelope - you open and there it is empty ... Well, empty and empty. Put it back and sit yourself further waiting for the next call.
So this is what 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 complete 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 “jingle”. ATmega8 can have a frequency of 8 or 16 megahertz. That is, if our call works at 8 megahertz - then it can “tinkle” 8 million times in 1 second. That is, it turns out that something that is highlighted in bold and underlined you manage to do in one eight-millionth part of a second. You are very fast, buddy!