LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (https://www.linuxquestions.org/questions/general-10/)
-   -   Assembler (https://www.linuxquestions.org/questions/general-10/assembler-300978/)

samjkd 03-12-2005 11:47 PM

Assembler
 
Hai All



what is an assembler?
is assembley language is more powerfull than c & c++?
Is assembly language portable?
can one create his own operating system in assembly language?







i am doing a project for my final year graduation on assembly and os
need all your help. i will be back with lots of doubt

vharishankar 03-13-2005 12:01 AM

Your question is so broad that several books have been written on this subject. Please do your homework on your own by reading good books on the subject.

Specifically to answer your questions.


what is an assembler?
Assembler is the program that converts the mnemonics (MOV, ADD, SUB etc.) your have written into actual machine code and also binds the logical addresses you have used in your assembly program to absolute machine addresses. This is a very general, non-technical way of putting it, but this is what it is.


is assembley language is more powerfull than c & c++?

Yes and no. C and C++ are high-level languages that concentrates more on writing code in a more abstracted and human understandable way than machine language. While you would write ten or more lines of code in assembly language to do a multiplication or division between two numbers, in C and C++ you just "multiply" and that's it. But one thing is that assembly programs written specifically utilizing a particular architecture's features would be highly optimized and run fast on that platform.

Is assembly language portable?
Assembly language is "machine-specific". That is to say, an assembly program written to target a particular architecture (example Intel x86) will not work with other architectures (example PowerPC).


can one create his own operating system in assembly language?

Though theoritically possible, this would be a huge task and probably not worth it because, as I mentioned, the platform-specific nature of assembly code. Most OSes are written in C because there are many existign C compilers for different platforms and C programs can target multiple platforms if linked with cross-platform libraries. Assembly code is used inside of C programs for very small sections where a high degree of optimization is required.

azraelder 03-13-2005 12:10 AM

Check this link

http://www.menuetos.org

An operating system in assembly language has actually been written.

azraelder

vharishankar 03-13-2005 12:18 AM

Thanks azraelder. That looks interesting.

I did mention that it was possible and I still say that it would probably not be worth writing entire OSes in assembly because you would have to rewrite the whole code for OTHER architectures.

The one advantage is that writing assembly code to target *a* particular platform will make it highly optimized on that platform.

Mara 03-14-2005 05:47 AM

Certain internal kernel code has to be written in assembly - it's not possible to write in in C. But it's not a very big amount.

al_periodical 03-14-2005 10:39 AM

I always suspect that if some of the kernel coding are re-converted back to assembly with minimun acceptable requirement for cross-platform implementations,than linux(with X installed) might be a lot faster and robust than now.

benjithegreat98 03-14-2005 01:07 PM

The very first edition of UNIX written in 1969 (I think) was done purely in machine language at Bell Labs. C was created after that (in Bell Labs) and UNIX was rewritten in C shortly thereafter. C was created for the purpose of rewriting UNIX.

al_periodical 03-14-2005 01:52 PM

In 1968 original unix in PDP-7 assembler
then a few utilities in B
around 1970 recoded to PDP-11 assembly
In 1971 extend B to NB
1973 essentials of modern C completed
rewrite PDP-11 unix in C


All times are GMT -5. The time now is 10:08 AM.