1 / 6

컴파일 4 단계

컴파일 4 단계. 석주원. 전체 개요. ① 전처리단계 (pre-processing). 전처리 단계는 #( 전처리기 지시자 ) 로 시작되는 문장 ( 예 . #include … , #define …) 을 먼저 처리하는 단계로 windows command 창에서 “ cl /P ( 파일이름 )” 을 입력하면 확장자가 i 인 파일을 만들어 내는 것을 볼 수 있다. ② 컴파일 단계 ( compling ). 전처리 단계를 거친 *. i 파일을 어셈블리어로 번역하는 단계이다 .

Download Presentation

컴파일 4 단계

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 컴파일 4단계 석주원

  2. 전체 개요

  3. ① 전처리단계(pre-processing) 전처리 단계는 #(전처리기 지시자)로 시작되는 문장(예. #include … , #define …)을 먼저 처리하는 단계로 windows command 창에서 “cl /P (파일이름)”을 입력하면 확장자가 i인 파일을 만들어 내는 것을 볼 수 있다.

  4. ② 컴파일 단계(compling) 전처리 단계를 거친 *.i파일을 어셈블리어로 번역하는 단계이다. 이 과정을 거치면 확장자가 asm인 파일이 생성되는 것을 확인 할 수 있다. Linux 운영체제의 경우에는 확장자가 a인 파일이 생성된다. command 창에서 “cl /Fa (파일이름)”을 입력하면 확장자가 asm, obj, exe인 파일이 생성되는 것을 확인할 수 있다.

  5. ③ 어셈블 단계(assembling) 어셈블리어로 번역된 .asm파일을 어셈블러가 기계어로 번역하여 확장자가 obj인 파일을 생성하는 과정이다. 리눅스에선 확장자가 .o인 파일이 생성된다. command 창에서 “cl /c (파일이름)”을입력하면 obj파일만 생성되는 것을 확인 할 수 있다.

  6. ④ 링크 단계(linking) 이 단계는 linker라는 프로그램이 .obj파일을 printf()와 같은 라이브러리 함수가 저장되어 있는 함수 라이브러리(stdio.h, stdlib.h등)에서 가져온 개체 코드와 결합시켜 최종 프로그램 실행파일인 .exe 파일을 만들어 내는 단계이다. 리눅스에선 확장자가 없는 파일이 생성된다. command창에서 “cl (파일이름)”만입력하면 확장자가 .exe인 실행파일이 생성된 것을 확인할 수 있다.

More Related