implement lexical analysis function for c-minus
This commit is contained in:
38
notes/1.md
38
notes/1.md
@@ -1,9 +1,41 @@
|
||||
컴파일러 1
|
||||
===
|
||||
# ISA & Compiler Basics
|
||||
|
||||
## Basic Computer
|
||||
|
||||
To get a task done by a general-purpose computer, we need:
|
||||
|
||||
* Program: A sequence of instructions
|
||||
* Instruction set: A set of possible instructions
|
||||
|
||||
### Von Neuman Architecture
|
||||
|
||||
Both Instructions and data are stored in the memory.
|
||||
Instructions dictate:
|
||||
|
||||
1. which and how data are manipulated
|
||||
2. which instruction should be next
|
||||
|
||||
The memory is independent of the CPU.
|
||||
|
||||
|
||||
# Interpreter in Modern Processors
|
||||
### How to load a program
|
||||
```
|
||||
*.c -(compiler)-> *.s: Assembly program
|
||||
*.s -(assembler)-> *.o: Object file
|
||||
*.o -(linker)-[with library(*.o)]-> *.exe: Executable
|
||||
*.exe -(loader)-> to in memory
|
||||
```
|
||||
|
||||
### Program
|
||||
|
||||
Computer is essentially a complex state machine.
|
||||
**programmer visible state**:
|
||||
|
||||
* Memory
|
||||
* Registers
|
||||
* Program Counter
|
||||
|
||||
Instructions(Program) specify how to transform the values of programmer visible state.
|
||||
|
||||
# Compiler
|
||||
|
||||
|
||||
Reference in New Issue
Block a user