LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
Search this Thread
Old 03-12-2005, 11:47 PM   #1
samjkd
LQ Newbie
 
Registered: Mar 2005
Location: india
Posts: 17

Rep: Reputation: 0
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
 
Old 03-13-2005, 12:01 AM   #2
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Rep: Reputation: 121Reputation: 121
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.

Last edited by vharishankar; 03-13-2005 at 12:04 AM.
 
Old 03-13-2005, 12:10 AM   #3
azraelder
Member
 
Registered: May 2004
Location: Perth, Australia
Distribution: Red Hat 9
Posts: 35

Rep: Reputation: 15
Check this link

http://www.menuetos.org

An operating system in assembly language has actually been written.

azraelder
 
Old 03-13-2005, 12:18 AM   #4
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Rep: Reputation: 121Reputation: 121
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.
 
Old 03-14-2005, 05:47 AM   #5
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,536

Rep: Reputation: 148Reputation: 148
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.
 
Old 03-14-2005, 10:39 AM   #6
al_periodical
LQ Newbie
 
Registered: Mar 2005
Location: singapore
Distribution: redhat9
Posts: 7

Rep: Reputation: 0
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.
 
Old 03-14-2005, 01:07 PM   #7
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
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.
 
Old 03-14-2005, 01:52 PM   #8
al_periodical
LQ Newbie
 
Registered: Mar 2005
Location: singapore
Distribution: redhat9
Posts: 7

Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
m6800 assembler kafnir Linux - Newbie 1 03-05-2005 01:29 AM
Assembler Firari Programming 9 12-10-2004 02:26 PM
assembler usr Programming 2 11-15-2003 05:15 PM
assembler tda Programming 4 08-21-2002 02:54 AM
Need an Assembler ChimpFace9000 Programming 1 07-18-2001 09:36 PM


All times are GMT -5. The time now is 09:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration