Похожие чаты

C and Assembly in this case?

16 ответов

17 просмотров

you can see assembly code as an middle step, between the C code and the machine code. but you don't usually write assembly code yourself, the compiler translate it for you. C code -> [Compile] -> x86 assembly -> [Assemble] -> machine code you can if you want write assembly code yourself, and event mix it with C code

Charlemagne-Holdt Автор вопроса
Jonathan Péclat
you can see assembly code as an middle step, betwe...

Damn, so in order to learn and run C, you also gotta learn Assembly as well?

Charlemagne-Holdt Автор вопроса

What is that [Compile]? Is there a type of compile?

Charlemagne Holdt
What is that [Compile]? Is there a type of compile...

by "Compile" I mean the step in the compiler that translate the C Code into assembly. The details of how a C code is compiled is complex. There are a lot of steps.

Charlemagne-Holdt Автор вопроса
Charlemagne Holdt
So there is only one type of compiler?

I don't understand the question. A compiler is a program that compile or "translate" if you like the code into assembly. There are many compilers on the market that you can use (for free). I think the most used is GCC for instance.

Charlemagne-Holdt Автор вопроса
Jonathan Péclat
I don't understand the question. A compiler is a p...

Ok, if this is how C code translates into machine language, C code -> [Compile] -> x86 assembly -> [Assemble] -> machine code How do you use compiler at the [Compile] part? And where do you download it from? Or once you download C language package(just like Python package), does compiler come with C package as well?

Charlemagne-Holdt Автор вопроса
Charlemagne-Holdt Автор вопроса
Jonathan Péclat
I don't understand the question. A compiler is a p...

The latter statement, I see. So ther are many types of compilers.

Charlemagne-Holdt Автор вопроса
Charlemagne Holdt
Ok, if this is how C code translates into machine ...

to use the compiler part you can either call it directly like this in a terminal gcc -o program.bin main.c This will take the C code in main.c and compile it into an executable "program.bin". in fact unless you ask otherwise the compiler program does the [Assembly] part as well by default. Or if you don't want to invoke the compiler yourself you can use a Makefile. You can also use an IDE like XCode on MacOS to make it easier.

Charlemagne Holdt
Ok, if this is how C code translates into machine ...

you can ask the compiler to stop and don't do the Assembly part like this if you are interrested to see the assembly code. gcc -S main.c

Charlemagne-Holdt Автор вопроса
Jonathan Péclat
to use the compiler part you can either call it di...

It looks like the work of compiler can only be done on Terminal?

Charlemagne Holdt
I’m on MacOS

xcode bundles llvm/clang

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта