์ด ์์ด์ ํน์ง ..
1. native code
2. machine language
3. machine dependent
This code is written in machine (and assembly) language for a specific processor; thus it is non-portable or machine dependent. This is the native code for the 6502 processor. Machine language is both difficult to write and to understand. (That's why Woz added all of the comments on the right).
step 1 - text editor : vim ๊ฐ์๊ฑฐ ! ์ฒ์์ ํ ์คํธ ์๋ํฐ๋ก ์ฝ๋ ์์ฑํจ
step 2 - preprocessor : Performs text substitution on your source code / Converts processed source code to object code.
step 3 - compiler : converts processed source code to object code
step 4 - linker : combines object files with library code to produce the executable image,
step 5 - loader : reads the program on disk, loads any required shared libraries and starts the program running.
step 6 - CPU : responsible for executing your code
๊ทธ๋๊น 1. ๋น์ผ๋ก ํ ์คํธ ์จ์ ์ฝ๋ ์ฐ๋ฉด 2. ํ๋ฆฌํ๋ก์ธ์๊ฐ ์ ์ ํ ์คํธ๋ฅผ ์ฝ๋๋ก substituteํ๊ณ 3. ์ปดํ์ผ๋ฌ๊ฐ sourcecode ๋ฅผ object code ๋ก convert ํด 4. ์ปด์ฐจ์ผ์ด ๋๋ฉด ๋ง์ปค๊ฐ ๋ญ๊ฐ ๊ฒฐ๊ณผ๋ฅผ ๋ด๊ธฐ์ํด์ ๋งค์น๋ฅผ ๋งํฌ๋ฅผ ํจ 5. ๋ก๋ฉ์ ํจ 6. ๊ฒฐ๊ณผ๋ฅผ ๋ ???
/**
* @author Jimin
* @date Thu Aug 31
* @file h01.cpp
*/ -> (1) documentation comment
#include <iostream>
#include <string>
#include <iomanip> // -> (2) standard library
using namespace std; // -> (3) namespace directive
double convert(double temp); // -> (4) function prototype
int main()
{
cout << "Enter a temperature in ํ์จ"; // -> (6) prompt
double fahr; // -> (7) variable statement
cin >> fahr;
double celsius = convert(fahr); //-> (9) function call
cout << "Converted: " << fanhr << "F -" << celsius << "C" << endl; // -> (10) output statement
return 0; // -> (11) optional return
double convert(double temp) // -> (14) parameter
{
return (temp -32 ) * 5.0 /9.0; // -> (13) expression
}
// -> (12) function definition
'เซฎโหถแต แต แตหถโแโก > coding' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[C++] STL์ ๋ฐ๋ณต์ (Iterators) (0) | 2024.03.28 |
---|---|
[C++] STL์ด๋? ( STL์ ์ ์์ ๊ตฌ์ฑ์์) (2) | 2024.03.27 |
[C++] ์ด๋ก ๊ณต๋ถ ์ค๋ต๋ ธํธ 1 (0) | 2023.09.22 |
[c++] idioms (0) | 2023.09.22 |
function์ ๊ตฌ์กฐ ์ด์ผ๊ธฐ (0) | 2023.09.17 |