Well, I have a doubt about nasm and assembly. Surely it will be a stupid thing, and I fell embarrassed to post it. But i need to know.
If I am programming in assembly, why do I need a compiler like nasm?? In theory, a compiler translates a source code in a high level language (like C), into assembly instructions, doesn't it? So why do I need a compiler to programming assembly?
Many thanks to all. And sorry for the stupid question!!
4 replies to this topic
#1
Posted 07 November 2010 - 03:27 AM
|
|
|
#2
Posted 07 November 2010 - 07:56 AM
Actually, it is called an assembler. When you use a C compiler, it translates C into assembly, then an assembler translates the assembly into machine code. So you are not using a compiler for assembly.
Latinamne loqueris?
#3
Posted 07 November 2010 - 08:59 AM
Many thanks mebob, I have understood you. But one other issue. I'have just begin to program in assembly in Linux, with nasm. But you said "When you use a C compiler, it translates C into assembly, then an assembler translates the assembly into machine code". So, before install nasm, I had an assembler, when I programmed in C. Why do I have to download an assembler, like nasm, when I've just installed another assembler?
#4
Posted 07 November 2010 - 06:55 PM
IlikeProgramming said:
Many thanks mebob, I have understood you. But one other issue. I'have just begin to program in assembly in Linux, with nasm. But you said "When you use a C compiler, it translates C into assembly, then an assembler translates the assembly into machine code". So, before install nasm, I had an assembler, when I programmed in C. Why do I have to download an assembler, like nasm, when I've just installed another assembler?
The compiler you have is most likely GCC ,which stands for GNU Compiler Collections. GNU includes a assembler named "as", which you should be able to use, but it is in a much different format than NASM. So you may want to just stick with NASM instead of learning a less documented syntax.
Edited by Alexander, 07 November 2010 - 08:36 PM.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#5
Posted 09 November 2010 - 07:59 AM
Ok, Many thanks to all, and sorry for my stupids questions. I want to learn!!! see you!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









