Why Assembly Language? | Unix Linux Forums | Programming

  Go Back    


Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Why Assembly Language?

Programming


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-07-2011
gabam gabam is offline
Registered User
 
Join Date: Aug 2011
Last Activity: 15 August 2013, 3:47 PM EDT
Posts: 117
Thanks: 31
Thanked 2 Times in 2 Posts
Why Assembly Language?

Hi guys,
Assembly language is a low level language designed in 1950's, both system and application programs were written in assembly at that time. There is no question of assembly being very effecient compared to the other high level languages. But it is very cumbersome to write programs in assembly. My question is that where does Assembly language stand today against the high level languages, I mean what can assembly do, that the other langues can't????

I hope you will explain your good points.
Thanks alot!
Sponsored Links
    #2  
Old 12-07-2011
frappa frappa is offline
Registered User
 
Join Date: Mar 2008
Last Activity: 12 August 2013, 6:26 AM EDT
Location: Italy - EU
Posts: 174
Thanks: 5
Thanked 35 Times in 35 Posts
Hi,

have a look at
Assembly language - Wikipedia, the free encyclopedia - Current Usage

see ya
fra
The Following User Says Thank You to frappa For This Useful Post:
gabam (12-08-2011)
Sponsored Links
    #3  
Old 12-07-2011
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 19 December 2014, 11:28 AM EST
Location: Saskatchewan
Posts: 20,025
Thanks: 855
Thanked 3,452 Times in 3,225 Posts
Quote:
Originally Posted by gabam View Post
My question is that where does Assembly language stand today against the high level languages, I mean what can assembly do, that the other langues can't????

I hope you will explain your good points.
Thanks alot!
The most vital thing about assembly is that it's freestanding. It makes extremely few assumptions about the environment you're writing code for, and can create code which needs no operating system at all. That's what makes it almost impossible to get rid of.

When you're programming in assembly, all it amounts to in the end is "put these exact bytes in this exact location in memory" except you can give it instructions as well as bytes, and it does the conversion for you. That's precisely the kind of thing you need when writing a BIOS for example, when the computer does in fact start up blindly looking for its very first instruction at a very specific place.

You also need it to write a bootloader, which gets loaded from a hardcoded location on disk then blindly executed from, again, a specific spot inside that location.

You also need at least some of it to write an operating system. That gets loaded by the bootloader and, again, blindly executed starting from a very specific spot.

You don't get a nice, programmer-friendly environment where you can load whatever language you like to do whatever you please until after all these things have already happened. Even after that, assembly language is still useful.

The other thing about being freestanding is that, since machine code is executed by the host processor, there's no interpretation step. That's why you can write a better C compiler in C. C code isn't a program, it's a design which a C compiler uses to build a program out of raw assembly. You certainly couldn't write a better Perl inside Perl.

You can also write other languages in C. Name any language -- Perl, PHP, Java, C#, awk, Python, sh -- and chances are, it was written in C.

Last edited by Corona688; 12-07-2011 at 05:24 PM..
The Following User Says Thank You to Corona688 For This Useful Post:
gabam (12-08-2011)
    #4  
Old 12-08-2011
LMHmedchem LMHmedchem is offline
Registered User
 
Join Date: Mar 2010
Last Activity: 23 October 2014, 6:54 PM EDT
Location: Boston
Posts: 264
Thanks: 111
Thanked 5 Times in 5 Posts
Quote:
Originally Posted by Corona688 View Post
You can also write other languages in C. Name any language -- Perl, PHP, Java, C#, awk, Python, sh -- and chances are, it was written in C.
Am I making a correct assertion that the runtime components of these languages (java, c#, python, etc) contain allot of assembler? What allows for allot of the interpretation in interpreted languages is the fact that there is already allot of code that has been compiled into assembler and is all ready to call on when needed.

LMHmedchem
The Following User Says Thank You to LMHmedchem For This Useful Post:
gabam (12-08-2011)
Sponsored Links
    #5  
Old 12-08-2011
Emily Henderson Emily Henderson is offline
Registered User
 
Join Date: Dec 2011
Last Activity: 8 December 2011, 12:01 AM EST
Location: Florida
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Gabam ,that is a very good question you have come up with.Many people think assembly language is no more used today.But their is lot more to it.It is used primarily for direct hardware manipulation, It iworks wonders for speed optimization because it is more close to processor.
The Following User Says Thank You to Emily Henderson For This Useful Post:
gabam (12-08-2011)
Sponsored Links
    #6  
Old 12-08-2011
gabam gabam is offline
Registered User
 
Join Date: Aug 2011
Last Activity: 15 August 2013, 3:47 PM EDT
Posts: 117
Thanks: 31
Thanked 2 Times in 2 Posts
Thanks for your complement. One more thing, I have to prove that assembly is faster than c and java. For c, I compiled the hello world program, which has an exetuable of size 50 kb. The same hello world program in assembly that I have assembled has a size of only 15kb, it shows that assembly is faster than c. How can I do the same in case of java, java doesn't give you binary exeutables????

Thanks!

---------- Post updated at 12:58 AM ---------- Previous update was at 12:57 AM ----------

One more thing, I have to prove that assembly is faster than c and java. For c, I compiled the hello world program, which has an exetuable of size 50 kb. The same hello world program in assembly that I have assembled has a size of only 15kb, it shows that assembly is faster than c. How can I do the same in case of java, java doesn't give you binary exeutables????
Sponsored Links
    #7  
Old 12-08-2011
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 19 December 2014, 10:13 AM EST
Location: Asia pacific region
Posts: 13,038
Thanks: 547
Thanked 914 Times in 412 Posts
Quote:
Originally Posted by gabam View Post
.... I have to prove that assembly is faster than c and java....
Because this is homework/classroom work, right?
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Fibonacci (assembly) Learnerabc Programming 2 12-11-2010 03:23 PM
Help with assembly code Learnerabc Programming 2 09-24-2010 11:41 AM
Assembly Language ( compile ) Learnerabc Programming 3 09-24-2010 12:17 AM
Unix assembly help ac09 Shell Programming and Scripting 1 05-09-2009 08:05 PM
Assembly vs C programming duoshock UNIX for Dummies Questions & Answers 0 09-12-2006 11:25 PM



All times are GMT -4. The time now is 01:27 PM.