954,135 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Assembly is used for?

I've been searching around the site, looking at the different types of coding, and come accross Assembly. This is one of the most complicating code ive seen yet and was just wondering what is it's most common use?

KalebG
Light Poster
28 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 
I've been searching around the site, looking at the different types of coding, and come accross Assembly. This is one of the most complicating code ive seen yet and was just wondering what is it's most common use?

Assembly language is a very low level language.

It is very fast but very complex (therefore generally takes longer to write) and these days tends to be used where massive optimisation is required (a number-crunching algorithm) or in drivers and stuff where it has to interact directly with hardware.

pty
Posting Pro
530 posts since Oct 2005
Reputation Points: 64
Solved Threads: 39
 

Assembly language is a very low level language.

It is very fast but very complex (therefore generally takes longer to write) and these days tends to be used where massive optimisation is required (a number-crunching algorithm) or in drivers and stuff where it has to interact directly with hardware.

Ah, ok thanks.

KalebG
Light Poster
28 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

This is completely wrong! Assembly language is very easy ;) and can be used to develop any kind of application. Have a look at this article and visit the WinAsm Studio site for a lot of free open source tools written in Assembly.

Regards,

Antonis Kyprianou

akyprian
Newbie Poster
16 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

The Space Shuttle's cockpit displays/keypad processors (an IBM SP0) were programmed in assembler as was its Heads Up Display(HUD) symbology processor (Hughs A10INS processor)

All of the kernel (and the vast majority of stock drivers and TSR's) for plain old DOS were written in assembler too.

Purple Avenger
Light Poster
49 posts since Jan 2007
Reputation Points: 31
Solved Threads: 0
 

True, it can be used to develop any kind of application, but what would be the point when a high or middle level language can do the job just as well (and more quickly)?

mathematician
Junior Poster
155 posts since Nov 2006
Reputation Points: 14
Solved Threads: 4
 

Assembly Language can produce small and very fast applications, no bloat, no dependencies (huge dll's), VERY easy to develop and above all, I can do anything I want without facing any HLL limitations.

Microsoft Macro Assembler (MASM), for example, looks VERY similar to C code and is no harder to learn. I would say that it is easier.

Regards,

Antonis

akyprian
Newbie Poster
16 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 
Assembly Language can produce small and very fast applications, no bloat, no dependencies (huge dll's), VERY easy to develop and above all, I can do anything I want without facing any HLL limitations. Microsoft Macro Assembler (MASM), for example, looks VERY similar to C code and is no harder to learn. I would say that it is easier. Regards, Antonis




There is nothing wrong with the speed of today's optimising compilers. Entire operating systems are written in C, including both Windows and Linux - 95% of the source code anyway. What are the HLL limitations nowadays? Operating system API's are written with C in mind, and directly programming the hardware is out of the question in multi-tasking environments such as Windows and Linux.

mathematician
Junior Poster
155 posts since Nov 2006
Reputation Points: 14
Solved Threads: 4
 

Assembly is very fast. common uses are bootloaders, compilers, embedded systems

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,820
Solved Threads: 600
 
There is nothing wrong with the speed of today's optimising compilers.

No compiler can produce faster binaries than what assembly can do (written correctly offcourse)Entire operating systems are written in C, including both Windows and Linux - 95% of the source code anyway.
still remains a 5%. why should I use C and assembly while I can be equally productive using assembly only.What are the HLL limitations nowadays?
Try to write a multithreaded application in VB6 or lower (I don't know about other versions, I never touched any), or a debugger, a large file edit control or ... You 'll fail. Try to use pointers with VB. You 'll be wasting your time (although it is possible).Operating system API's are written with C in mind
You can call equally easily these API's with Assembly (and written correctly, the binary WILL be faster)and directly programming the hardware is out of the question in multi-tasking environments such as Windows and Linux.
Although I don't usually do this kind of stuff, why not?

Regards,

Antonis

akyprian
Newbie Poster
16 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 
This is completely wrong! Assembly language is very easy ;) and can be used to develop any kind of application. Have a look at this article and visit the WinAsm Studio site for a lot of free open source tools written in Assembly. Regards, Antonis Kyprianou

Assembly is very useful in some cases but writing large complex applications in it is crazy. It takes longer and is more difficult to write and is harder to debug than higher level languages and apart from in places that need a lot of optimisation it doesn't offset the extra time spent in development.

pty
Posting Pro
530 posts since Oct 2005
Reputation Points: 64
Solved Threads: 39
 
Although I don't usually do this kind of stuff, why not?



Because between them the operating system and the processor's protection mechanisms will stop you. If you did try, your program would most likely get itself closed down. You cannot have two or more apps fighting for direct control of one and the same printer (for example).

mathematician
Junior Poster
155 posts since Nov 2006
Reputation Points: 14
Solved Threads: 4
 
True, it can be used to develop any kind of application, but what would be the point when a high or middle level language can do the job just as well (and more quickly)?

More quickly? Perhaps.

As well? No. I can beat any compiler on speed or space optimizations. One of the biggest problems with compilers is they must implement the semantics of the language. Those semantics never map optimally to any particular architecture.

ex. on x86 I've never seen a compiler pass a bool flag to a function using the carry flag. They all waste time pushing a stack var, or blow a register.

None of them know how to do extreme space optimizations.

Purple Avenger
Light Poster
49 posts since Jan 2007
Reputation Points: 31
Solved Threads: 0
 

@pty:
Assembly is very useful in some cases but writing large complex applications in it is crazy.
Who told you so? Having the right tools it is easier. Do yourself a favor get the right tools and try 32-bit assembly for a couple of days.It takes longer and is more difficult to write and is harder to debug than higher level languages and apart from in places that need a lot of optimisation it doesn't offset the extra time spent in development.
I insist. Just try it for a while. With assembly, you debug what you write and not what the HLL (such as VB) wants!

@mathematician:Because between them the operating system and the processor's protection mechanisms will stop you. If you did try, your program would most likely get itself closed down. You cannot have two or more apps fighting for direct control of one and the same printer (for example).
There is a misunderstanding here; I would write a driver in Assembly to do this.

Purple Avenger you are right for all but, believe me, having the right tools, you can write assembly code quickly. For example, intellisense of both VB, Visual Studio etc IDE's are well behind intellisense of some Assembly IDE's I know of.

Regards,

Antonis

akyprian
Newbie Poster
16 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

@pty:

Who told you so?

Me. I did it for a couple of modules at uni. It was fun to learn and create simple programs but thats it.

Obviously you will blow the trumpet of it as you are linked to some IDE. I'm not saying its a bad thing. In some cases (as I've mentioned before) its very good and fast, but for every day development it just isn't productive.

pty
Posting Pro
530 posts since Oct 2005
Reputation Points: 64
Solved Threads: 39
 

Yes I 've developed the free IDE because I had believed in Assembly and not the other way round! Please bear in mind that I 've programmed with some HLL's for years before that. And yes, I was not productive with every language I tried.

Regards,

Antonis

akyprian
Newbie Poster
16 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

im learning assembly next year at college so its obviously still a good language

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,820
Solved Threads: 600
 

unfortunately developers don't invest in technology, business does and business is interested in return on investment. Don't be fooled by open source it's no different, open source is an attempt by business to commoditize software, so it can sell more hardware not satisfy selfless moral ethics. Developers tend to be ethical purists, but purism isn't economic. A developer should be productive in any language, if you understand the theory of computation you're good to go that's the skill, syntax and libraries are just semantics. It doesn't matter what you say, if you build up from assembly, or bolt together with the highest level languages the result is a huge upside down pyramid of extrapalation before you get to anything saleable that invariably falls over..a lot! an individual part built low level maybe perfect - such as a driver - but on it's own without a monolithic OS to serve it's economically a dead duck. The whole thing is pretty shaky if you ask me and we rely on it in every facet of daily life...role on the quantum CPU Then we'll be cooking on gas!

hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68
 
More quickly? Perhaps. As well? No. I can beat any compiler on speed or space optimizations. One of the biggest problems with compilers is they must implement the semantics of the language. Those semantics never map optimally to any particular architecture. ex. on x86 I've never seen a compiler pass a bool flag to a function using the carry flag. They all waste time pushing a stack var, or blow a register. None of them know how to do extreme space optimizations.




Anybody who writes a memory resident debugger, which can randomly interrupt the execution of a program at any point, will soon discover that the average app spends about 90% of its time executing operating system code. Therefore it can be as fast as the OS, and no faster.

mathematician
Junior Poster
155 posts since Nov 2006
Reputation Points: 14
Solved Threads: 4
 

have u guys tried menuetn os?

a whole os in assembly. its got a GUI and is under 5 meg

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,820
Solved Threads: 600
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You