References: in-depth understanding of computer systems (Chapter 1)
1. (3.2.1) two important types of computer machine-level programming Abstraction:
An important abstraction is to abstract format and behavior of a machine-level program into an instruction set architecture, that is, ISA (instruction set architecture)
For ISA, there must be a basic idea: ISA for IA32 and ISA for x86-64, and most other ISA, which abstracts commands in order during abstraction. However, the hardware of the processor can execute many commands concurrently, and some safeguards are used to ensure that the results after parallel execution are the same as the results of a sequential execution.
The second important abstraction is to abstract the entire computer's memory system with virtual addresses, making the memory system like a "continuous" Byte block. The basic concept is that the actual computer basis corresponding to this abstraction is some separated hardware memories, and operating system software (?)
2. (3.2.1)
The operating system manages virtual address spaces and translates virtual addresses into physical addresses in the actual processor memory.
3. (3.2.2)
When a source file generates a destination binary file of '. o', it cannot be viewed directly.
However, there is still a way to view the content of the target code file, that is, to use the anti-assembler (disassembler) for the '. o' target file ). Its output is still a binary file. However, the anti-assembler segments These binary files according to instructions. Let us know which segment is an instruction (the format is the same as that of the compilation file generated by the assembler, which is a branch)
For ISA commands (taking IA32 as an example), we must have the following basic concepts:
First, each instruction in ISA occupies a different number of bytes. The number of bytes required for commonly used commands is small, and the number of bytes for infrequently used commands is large. In this case, compared to ISA, which occupies the same length of bytes as each command, ISA, which occupies a different number of bytes, generates less space for the program.
Second, commands in ISA are designed to achieve an effect. For a binary instruction string, the decoding result is unique from a certain byte, this meets the requirement of "unique translation" in coding theory. (How can we design codes for instructions to achieve "unique translability? You can see Dr. Jiang Dan's information theory.
(I think. Probably, the anti-assembler uses the unique translability to separate a string of instruction bytes .)