Compilation study notes (1)

xiaoxiao2021-03-06  105

The operating system is a hierarchical structure, the lower the computer, the higher the degree of this person, so it is necessary to learn compilation! In this semester, we opened a compilation course. When a language can be described in his language, we can say that true understanding, so I want to write the series of compilation learning notes, learn progress with friends. Less nonsense, let's go! Before learning, it should assume that there is a certain understanding of computer hardware, and there is a clear understanding of the storage in the computer, and the operation between the progress (if not, that is going to make a computers The principle is ^ @ ^). In addition, this assembly is based on Intel 8086 and 80286, and commissioning in real mode. The general format of the instruction is the operation code operand. Computer memory is derived by byte, so the minimum unit of operands is bytes. The instructions in the assembly use a mission method, that is, some English words abbreviations, don't need to remember, you will guess, to MOV, Add, Sub, etc. The key is to address the number of operands, which is often a headache of beginners, with more than ten ways in 8086. But it is also the trick. Let's take a look: First of all, the simplest is immediate, that is, you don't have to find something else. Directly give the operand, this method is the easiest, but some instructions are not Allow this addressing method. Because some instructions require the number of operands to be handled back, they must not be used in this way. If the operand is a register number, it is called the register addressing, and the instruction can be found directly to the register. The rest of the addressing method involves the effective address valid address (EA) = base (by the x-proportional factor) shift amount. In fact, the remaining number of address options are different from those of them or all of the two, and the corresponding names will be different, such as: only displacement, just add direct addressing, and the base address is called relative addressing. If the base address and displacement are called directly address .... As long as you have a regularity, it is easy, so these addressing methods will be familiar with itself, no It is necessary to write it repeatedly. But pay attention to distinguish the effective address and physical address. Physical address = valid address address. This is easily confused. There is also a must to remember the ultimate goal of addressing is to take the number of operands, which is data, this is clear, otherwise it will confuse some of the meaning of some instructions. Anyway, the most basic concept cannot be horses.

转载请注明原文地址:https://www.9cbs.com/read-103971.html

New Post(0)