0x00. C - Hello, World

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Dennis MacAlistair Ritchie (September 9, 1941 - c. October 12, 2011)

American computer scientist. He created the C programming language and, with long-time colleague Ken Thompson, the Unix operating system. He was the "R" in K&R C, and commonly known by his username dmr.

compilation process types of stops: -c

Compile or assemble the source files, but do not link. The linking stage simply is not done. The ultimate output is in the form of an object file for each source file. By default, the object file name for a source file is made by replacing the suffix .c, .i, .s, etc., with .o. Unrecognized input files, not requiring compilation or assembly, are ignored.

-masm=dialect

Output assembly instructions using selected dialect. Supported choices are intel or att (the default). Darwin does not support intel.

-o

Place output in file file. This applies to whatever sort of output is being produced, whether it be an executable file, an object file, an assembler file or preprocessed C code. If -o is not specified, the default is to put an executable file in a.out, the object file for source.suffix in source.o, its assembler file in source.s, a precompiled header file in source.suffix.gch, and all preprocessed C source on standard output.

-v

Print (on standard error output) the commands executed to run the stages of compilation. Also print the version number of the compiler driver program and of the preprocessor and the compiler proper.

-E

Stop after the preprocessing stage; do not run the compiler proper. The output is in the form of preprocessed source code, which is sent to the standard output. Input files that don't require preprocessing are ignored.

-S

Stop after the stage of compilation proper; do not assemble. The output is in the form of an assembler code file for each non-assembler input file specified. By default, the assembler file name for a source file is made by replacing the suffix .c, .i, etc., with .s. Input files that don't require compilation are ignored.

Write a script that runs a C file through the preprocessor and save the result into another file. -The C file name will be saved in the variable $CFILE -The output should be saved in the file c

gcc -E $CFILE -o c

1. Compiler mandatory Write a script that generates the assembly code of a C code and save it in an output file. The C file name will be saved in the variable $CFILE The output file should be named the same as the C file, but with the extension .s instead of .c.

gcc -S $CFILE


Kaugnay na mga set ng pag-aaral

Biology - The Chemical Basis of Life

View Set

Angles of Elevation and Depression Math

View Set

Quiz Bowl Cert - Countries once known by a different name

View Set

California Life & Health Insurance 12 - Insurance Regulation

View Set