CHAPTER 105 OPCODE
An ancient Greek philosopher famously said-
Human knowledge is like a circle, inside the circle is known, and outside the circle is unknown. The more you know, the bigger the circle becomes, and the more you don't know.
Lin Hong saw this sentence in a class magazine.
He was deeply touched by this sentence, so his impression was particularly clear.
He often thinks of this phrase involuntarily, such as at this moment.
In the monitor, a small white ball is constantly hitting and bouncing back and forth on the monitor, surrounded by a white fence.
When the ball collides with the wall, a mirror ejection occurs, and there is a "thump" sound in the speaker at the same time.
Lin Hong sat in front of the Macinto, staring blankly at the monitor, but the focus of his eyes didn't know where it had diverged.
After he came back from school, the question Xu Wenjing asked him kept coming to mind.
What kind of person do you want to be when you grow up?
This is something he never thought about, and before that, his biggest dream was to reunite his family of three and be able to live a normal life like other families.
But he never had any vision for his future.
Like the rest of your classmates, dreaming of becoming a scientist? Painter? Musician?
Or a radio expert like Grandpa Xu who even the country attaches great importance to?
He was also exposed to the professions of factory director, martial arts master, soldier, and teacher......
He doesn't have much feeling about these professions, although some of them are what he likes, but he can't be sure if he can take them as his goal for life.
What he knows is like a very small circle, and the outside world around him is too small to give enough information for him to make the right decision and get a satisfactory answer.
Lin Hong didn't know that his state at the moment, in psychology, was actually a process of high-level "self-awareness" understanding and reflection.
He begins to realize his own shortcomings, his own shortcomings, and then he will consciously take steps to make up for these shortcomings.
Under normal circumstances, if no one deliberately guides or is stimulated by a unique one, this process can only appear in the twenties and thirties, and at that age people have accumulated enough knowledge structure and life experience, and this kind of "self-awareness" understanding and reflection will naturally occur.
Lin Hong thought about it for a long time, but he couldn't get the answer he wanted, so he could only give up temporarily.
"Let it be."
Lin Hong gave himself a comfort, this sentence is a sentence that his master often says to people.
Some things, barely but not beautifully, may have the opposite effect.
Putting this mind to rest, he began to continue reading the Red Book.
In addition to the content of the display firmware, he also saw the firmware code and principles of other common external devices.
Now he wants to look at the core part of the computer - the central microprocessor chip, that is, the CPU.
The chip used in the apple_ii is the 6502 chip produced by MOS Technology, which is an eight-bit microprocessor, and at the time of its introduction, it was the most powerful CPU at that time. Of course, when the Apple machine came out, it was no longer the strongest, in fact, when the prototype was first made, the chip used by the designer Wozniak was not 6502, and the reason why it was later changed to this model was mainly to consider cost savings.
The 6502 is one-sixth or less priced, but it is about the same in terms of performance, even faster than other companies' eight-bit microprocessors. It is precisely because of this point that cannot be ignored that many computer or game console manufacturers finally choose it as a CPU.
apple_ii Mac is one of the great products that use this chip, and another more famous product is Nintendo's home game console, commonly known as the red and white machine.
The central processing unit is called the "brain" and "heart" of the computer, and this is not called casually. Because all the execution and computation in the computer must be done through the CPU.
The so-called programmability of the computer mainly refers to the programming of the CPU, but the usual operation of it is encapsulated and isolated layer by layer, and programmers who use high-level languages do not even need to know the existence of the CPU and its specific operating principle, as long as they write a calculation equation like "1+1", and then perform the compilation, the result will appear. In fact, in that imperceptible moment, there was a very complicated process.
First, the compiler compiles the program into a machine language that the computer can understand, and then begins to hand over the program to the CPU to control, through extraction, decoding, execution, and writing back...... and so on, and finally calculate the result, which is then displayed in the display.
Although this process is complicated, but the speed is very fast, when the computer was just born, the speed may be similar to using the abacus to calculate, but now, it is only a matter of a moment.
There are a lot of things in a small chip.
In the past, CPUs were implemented using basic switching components such as relays, which were bulky, unreliable, and easily broken. The advent of vacuum tubes gradually replaced relays, and it was not until later that the advent of transistors was the first leap in CPU technology.
Integrated circuits concentrate a large number of transistors on a small chip, which greatly reduces the size of the CPU, and is not easy to damage, and the stability has also been greatly improved. During this period, computers really had the possibility of going to thousands of households, and microcomputers came into being.
In the Redbook, the 6502 is described in great detail, from the functions and functions of each pin of the CPU chip, to the detailed structure of the accumulator, instruction decoder, and various registers.
The illustrations, all hand-drawn, were originally written by Wozniak, a genius computer engineer at Apple.
Even the hand-drawn drawings with some curved lines appear in computer manuals, which would seem very unprofessional today, but at the time of the publication of the Red Book, it was these hand-drawn illustrations that fascinated all computer enthusiasts and researchers around the world.
Suffice it to say that the apple_ii was designed entirely for computer enthusiasts, including the Redbook, and was also written for these professionals, since its designer was Woodsniak, a purely technical person.
However, Steve Jobs, the CEO of Apple, has a big opinion on this, he is not a technical person, and he does not want the users of Apple computers to be limited to professionals and computer enthusiasts.
This was not what Jobs wanted, so Apple went on to release many versions of other types of computers, but they were never able to surpass apple_ii, and because they were too conservative, they eventually put the company on the verge of collapse, and it didn't re-emerge until much later.
Lin Hong looked at this part of the content very carefully, and compared the circuit schematic diagram of each component in the CPU, he simulated the entire CPU calculation process in his mind. Originally, he thought that it would be difficult for him to understand, but later he found that he understood the whole CPU operation smoothly.
Arithmetic logic units, accumulators, counters, clock generators, register groups, ......
On the one hand, Lin Hong was amazed that so many complex components were integrated on this small chip, and on the other hand, he was addicted to these exquisitely designed circuits and couldn't extricate himself.
The components and circuits and principles of the radio station can be seen and touched, but these things in the CPU are packaged in such a small chip and can only be operated through external pins, which has to make Lin Hong feel very shocked.
This is a black box, all input and output signals, all rely on those pins to realize, by applying a variety of different levels of voltage on the pins, the data processing and calculation are realized, this ingenious design, has to make people admire!
Through ingenious circuit processing, computer scientists have invented a machine language called "opcode" to control the CPU with instructions to make calculations.
Machine language refers to binary code language, which is the lowest and most primitive language, and it is also a language that can be directly understood by computer microprocessors. For example, "0000" means to let the CPU load the program, while "0001" tells it to store something.
Four digits, each of which has two possibilities, then it means 2x2x2x2 for a total of 16 different operations.
The 16 operations could meet the needs at the beginning, but in the future, the CPU of the computer became more and more complex, and there were more and more operation instructions, which could no longer meet the needs, so it began to be expanded and marked with 8-bit or 12-bit binary.
Writing programs directly in binary is really painful, and the screen is densely packed with 0s and 1s, and the eyes can be seen as cross-eyed.
Later, some fierce people came up with a way to convert binary to hexadecimal for processing, and every four-digit binary corresponds to a hexadecimal corresponding, which greatly simplifies the requirements for memory and input.
Later, everyone found it difficult to memorize hexadecimal code, so they began to use abbreviations of alphabetic words to correspond to computer operation instructions, and machine code mnemonics and assembly language were born.
For example, the "mov" command is the abbreviation of "move", which means to move, and the function is to move a piece of data from one place to another.
This command is very useful, for example, if you want to display the letter "a" on the monitor, you just need to put the machine language "mov" corresponding to a to the corresponding memory position, and the "a" will be displayed on the monitor.
In this chapter, the Redbook details the opcode machine code of 6502, and the circuit on the motherboard is an implementation of these machine codes.
Lin Hong didn't really understand until this moment why the world of computers is a world composed of 0 and 1.
====
Recommend a friend to a modern Xiuzhen work
[bookid=2330003,bookname=The Strongest Immortal King]
Seek demons