Lecture 13 Running a Program – CALL¶
CALL
- Compiling
- Assembling
- Linking
- Loading
How do we run a program?
- Translator
- converts a program from the
src
language to an equivalent program in other language - translating / compiling to lower-level languages almost always means higher efficiency, higher performance
- converts a program from the
- Interpreter
- directly execute a program in the
src
language - C and RISC-V can also be interpreted
- directly execute a program in the
Translating / Interpreting Language
你可以在该网站数据库运维部分进行查询,我在那里写了常见的语言分类说明
Bash | |
---|---|
1 2 3 4 5 6 7 8 |
|
PS: if you input gcc foo.c
, it will automatically execute 3 steps sequently mentioned above.
Compiler¶
- Output can include pseudoinstructions
- Often generate directions for assembler
Assembler¶
Directives¶
- Often generated from the compiler (previous stage)
- Give directions to the assembler
Directives do not produce machine instructions! Rather, they inform how to build different parts of the object file
Producing Machine Code¶
Other References cannot be determined yet, hence we need two tables
Object File Format¶
Bonus: check out
objdump foo.o
C | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Linker¶
Linker Patches Together Multiple Object Modules