Control Flow
CPU가 하는 일 = 순서대로 instruction 읽기 (끝)

지금까지 control flow를 바꾼 방법 = jump, branch, call, return
→ Program state를 바꾼다
그렇다면 System State를 바꾸는 것에는 어떻게 반응해야 할까?
ex. 0으로 나누기, ctrl C 누르기, 외부 디스크에서 데이터 가져오기..
→ Exceptional Control Flow
Exeptional Control Flow
- Low-level
- Exceptions
- control flow change, in response to a system event
(system-state change)
- High-level
- Process Context Switch
- Signals
- Nonlocal Jumps
Exceptions
특정한 이벤트(0나누기, 오버플로우 등) 발생시
Control을 OS 커널로 전달해 준다.

- I current 인스트럭션에서 예외 발생 → 커널로 컨트롤 이동
예외 핸들러에서 처리 후
- I current로 다시 복귀: 다시 수행
- I next로 이동: 아무 오류 없었을 것
- abort: 프로세스 중단
Exception Table


Exception Type
async: interrupt(next), signal(나중에 다룸; 커널이 아니라 user에서 제어)
sync: trap(next) fault(current, abort) abort(abort)
- Asynchronous: external to processer
returns to next instruction
- Interrupt
ex. keyboard, network packet, timer interrupt