Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Why use Assembly language

ychhuong

New member
Joined
Oct 23, 2005
Messages
167
I don't know Assembly language. I just know that it is Low Level Language.
I wonder why one still uses Assembly language. Now there are many High Level Language that is easy to develop application. Could one tell me the advantage of using Assembly language today?
 

Kasracer

KrisSiegel.com
Joined
Jul 5, 2003
Messages
4,985
Assembly language is very useful for routines that require high speed and highly optimized code. It is also required for Boot Loaders (i.e. LILO, GRUB, etc...) and Operating Systems.
 

ychhuong

New member
Joined
Oct 23, 2005
Messages
167
So it means that we use Assembly Language because of high speed.
Are there any advantages of Assembly Language?
 

CVMichael

PowerPoster
Joined
Feb 8, 2002
Messages
5,794
ychhuong said:
So it means that we use Assembly Language because of high speed.
Are there any advantages of Assembly Language?
So, if I will say: The advantages are high speed and highly optimized code (as kasracer was saying)
Will you still ask what are the advantages ?
 

ychhuong

New member
Joined
Oct 23, 2005
Messages
167
I think that if the advantages are high speed and highly optimized code, it is not the reason that some body still using Assembly because today computer are very high speed.
 

CVMichael

PowerPoster
Joined
Feb 8, 2002
Messages
5,794
ychhuong said:
I think that if the advantages are high speed and highly optimized code, it is not the reason that some body still using Assembly because today computer are very high speed.
Well, if you need to make a super fast program for... say, a few hundred people, what do you choose ?
Tell ALL your customers to pay thousands of extra $ to buy super fast computer ? (on top of the cost of your program)
Or invest extra time and effort (and $) to make a super fast program in ASM, and tell your customers the computers they have now is fine for your program ?
 

wossname

type Woss is new Grumpy;
Joined
Aug 28, 2002
Messages
5,683
Most high level languages are very slow in comparison to ASM as has already been stated but this is mainly due to the multiple levels of abstraction that separates native binary from the HL language in question.

High Level languages have HUGE runtime dependancies, ASM can be optimised to have none whatsoever which is why they are indeed used in bootstrapping and OS installers, it lets you run a program on a completely blank computer.

The other benefits of knowing ASM include gaining a much deeper understanding of how a computer works at the lowest level. Thi definitely affects the way you write code in HLL too.
 

yrwyddfa

New member
Joined
Aug 21, 2001
Messages
1,253
wossname said:
Most high level languages are very slow in comparison to ASM as has already been stated but this is mainly due to the multiple levels of abstraction that separates native binary from the HL language in question.

High Level languages have HUGE runtime dependancies, ASM can be optimised to have none whatsoever which is why they are indeed used in bootstrapping and OS installers, it lets you run a program on a completely blank computer.

The other benefits of knowing ASM include gaining a much deeper understanding of how a computer works at the lowest level. Thi definitely affects the way you write code in HLL too.
Hmmm C# vs ASM . . . .;)

I didn't want to bring up the bloated nature of modern HLL, but hey, Wossy . . . .
 

the182guy

New member
Joined
Nov 13, 2005
Messages
1,473
if you know assembly language, stick with it, it is THE BEST, the compiler does not mess with your code, it does not change any of the ASM code, it simply directly, converts each instruction to machine code, and thats it. It wont check for extensive errros like VB or others, such as 'runtime error file not found' - none of that because the compiler has not messed with your code.

Other advantages...
The programmer has COMPLETE control over how the program works, unlike other high level languages.

Final advantage, filezise - a program which only displays a messagbox then quits (including the windows DLLs)

ASM: 3kb
VB6: 16kb

^thats a huge difference
 

ychhuong

New member
Joined
Oct 23, 2005
Messages
167
Thank all. I have 2 more question.
What is ASM?
What do i need if i want to develop application using Assembly Language?
 

yrwyddfa

New member
Joined
Aug 21, 2001
Messages
1,253
Assembly Language is the closest abstract to machine code. In many cases, you might have a processor directive say 0010101001010101010111111111000111, in assembly - instead of remembering all those 1, an 0's you might have to remember MOV es,ax

(I have no idea, btw, what that binary sequence means!)

You then use an assembler to convert your instructions into machine code - with no interference or optimisation done by the assembler.
 

Knight Chat X

New member
Joined
Mar 19, 2006
Messages
4
Assembler is still a high level programming language and is the next step up in making code easier to understand or human readable, it is still converted to machine language in order for the computer to understand it which is the lowest level.

It's quicker to develop applications using the latest higher level language tools and the differences in performance these days is hard to notice as most machines tote enough power it doesn't make much of a real difference.

But in terms of speed, effeciency, can easily create your own programming language and re-invent the wheel, and portability assembler stands out a bit.

The downside is there's alot missing in terms of all the latest tools and features for using syntax for simplicity and rapid application development.

The programs are small, lightweight, and don't require bulky runtimes which need to be downloaded, plus you develop totally for free.

Size and speed isn't so much an issue as time, money, and ease of development these days, plus, people aren't as deeply educated and focus is only on working with the IDE more so than how the internal code itself works, this develops false positives and leaves many security exploit possibilities open in the higher level languages.

A big comparison would be this, let's say you needed an application with moderate to complicated functionality complete for commercial business application for a client, you aren't well skilled in assembler but could popup something in short amount of time in higher level language, if it takes a few to several years to complete in assembler and you only have a few days to a week your best bet is higher level language to get it done now and get paid.

Either way, it's all about picking the language that you're comfortable working with and can understand, don't be afraid to try something new and keep developing! :wave:
 

ychhuong

New member
Joined
Oct 23, 2005
Messages
167
I don't know assembly language at all. I don't know where to start. I don't have any assembly book and assembler. Which book should i read(for beginer)?
 

Knight Chat X

New member
Joined
Mar 19, 2006
Messages
4
There are many flavors but the easiest form is the Win32/Microsoft Assembler, it's what the majority of the other programming languages are built from except for the newer .NET which uses ILASM.

I'd start here you can get free editor with lots of info.:
http://www.masm32.com

Here is a place for some source code and other tutorials by ICZelion:
http://win32assembly.online.fr

The Win32 API Guide comes in handy when first learning and APIViewer 2004 is nice for quickly finding standard declarations/structures/types/constants.

And if you ever make your own programming language and IDE and/or re-invent OOP programming style let me know and I'll check it out, lmao.

-Goodluck!
 

Raedwulf

New member
Joined
Aug 26, 2005
Messages
197
Just a summarised answer to who uses x86 assembly:

1.) Compiler & Assembler Developers (Duh!)
2.) Operating System Developers (Essential)
3.) Driver Developers (Essential)
4.) Game Developers (Many major-titles have hand-written assembly to optimise the game performance)
5.) Database Developers (Speed is a essential part of major databases)
6.) Programmers with assembly knowledge (there's need for speed)

Many developers use assembly in conjunction with C - as C is easier to maintain than assembly. Usually they have a C version of a piece of code make a second optimised version in assembly.

However, there are programmers that do an entire program in assembly. However, these tend to be extremely experienced assembly programmers who know how to keep their code neat and tidy.
I don't recommend this until you are quite proficient in assembly language. So i suggest you learn some high-level language like C - and then dig into some assembly - and use it inline. This tends to be the more favoured approach.

Cheers.
 

nemaroller

I wonder how many charact
Joined
Mar 1, 2001
Messages
3,705
Eh... you will never use assembly programming on a pc architecture for any job anymore. Assembly is like the black ninja magic of martial arts. It is not hard at all, just time consuming - and time is costly in software development.

For a beginner, I would suggest learning 6502 assembly. It was the processor used in the old Atari's and Commodore and Apple computers, and the original Nintendo NES. The processor has only 3 registers you work with and really only used 20 commmands that you work with, and there's an even a .Net application for simulation! That way you can follow along in the numerous books written for it most all free on the web and see the results:

http://www.atarihq.com/danb/6502.shtml (you want the Sim6502.Net application)

Her'e's a quick 6502 Assembly first steps (not a long read and a good introduction)
http://www.geocities.com/oneelkruns/asm1step.html
 

Raedwulf

New member
Joined
Aug 26, 2005
Messages
197
nemaroller said:
Eh... you will never use assembly programming on a pc architecture for any job anymore. Assembly is like the black ninja magic of martial arts. It is not hard at all, just time consuming - and time is costly in software development.


Eh......??? you mean OS developers don't use assembly?
It certainly not a requirement anymore - but it is useful knowledge. And with that knowledge, you tend to incorporate it in some programs you write.

Cheers.
 

yrwyddfa

New member
Joined
Aug 21, 2001
Messages
1,253
You shouldn't use assembly; you should design the circuits from scratch ;)
 

nemaroller

I wonder how many charact
Joined
Mar 1, 2001
Messages
3,705
Raedwulf said:
Eh......??? you mean OS developers don't use assembly?
It certainly not a requirement anymore - but it is useful knowledge. And with that knowledge, you tend to incorporate it in some programs you write.

Cheers.
You could fill the all the currently employed assembly OS developers in the world onto 1 -maybe 2 - Boeing 757's. The rest use C.
 
Top