flat assembler
Message board for the users of flat assembler.

Index > Heap > advantage over high level languages?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
jacko221



Joined: 12 Nov 2005
Posts: 22
jacko221
Hi im just curious as to know what are the benifits of programming in assembly? This was just something brought up with a teacher at school and he seems to back C# and other .net lanauges, he seems to think that one can save time programming applications and making your GUI in .NET... also he says what ever you can do in asm (most likely refering to the win32 api) you can do quicker and more efficiently in .net.

so does this mean that assembly is obsolete and no longer needed?

thanks, Jack
Post 21 Nov 2005, 10:14
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Obiously she hasn't discovered FASM for windows, maybe you could enlighten her about it? To answer your second question, assembly is going to be needed for raw speed, and if you learn optimization tricks well enough, nothing you do in the .net languages can come close to it. Also, learning assembly will give you an edge in many programming fields as well. and Thanks to FASMW, it won't be obsolete for quite a while yet, if ever.
Post 21 Nov 2005, 10:27
View user's profile Send private message Reply with quote
gunblade



Joined: 19 Feb 2004
Posts: 209
gunblade
That's going to make some people very unhappy. Very Happy

Main differences is that with a high level language, less code has to be written to do a specific task. Assembly is a one-to-one language, meaning that one line is equal to one instruction. Whereas in high level languages, one line can equal many more instruction as the compiler will convert it for you. This does mean that most program will take less time to make in a high level language, but it also means that it wont be as optimized, or efficient. What your teacher meant by efficient was probably weighing off time to code and speed of the program. Nowadays computers are so fast that even if the compiler doesnt create perfect code, it will still run at a decent speed.
Assembly though, allows you to control more what your program is doing, and if you are good, reduce the size and increase the speed of that program. Compilers will never be as good as the human mind (not yet anyway), but they do a decent enough job for most programs.

So advantages of assembly would be:-

Speed
More control over what your program is actually doing
Low level hardware access (if the OS allows it)
Smaller executables

Disadvantages:-

More lines of code

Assembly is still used by companies for low level code, such as graphics card drivers, and such things which need speed. Although more and more, they are just using high level languages, allowing them to release the program quicker.

I hope that made sense,
gunblade

(Oh, and assembly is far from dead, all high level languages still need to be compiled into assembly before they are made into binaries Twisted Evil)
Post 21 Nov 2005, 10:34
View user's profile Send private message Reply with quote
jacko221



Joined: 12 Nov 2005
Posts: 22
jacko221
so there are still jobs which require ASM programmers?
Post 21 Nov 2005, 10:40
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
I'd say that in any programming job the knowledge of assembly can give you a great advantage. Even when writing in high level languages, if you've got the knowledge about the underlying machine, and what the code you write finally becomes to be executed by the processor, you can write much better one. I recommend reading this nice article: http://www.softpanorama.org/Lang/assembler.shtml
Post 21 Nov 2005, 12:21
View user's profile Send private message Visit poster's website Reply with quote
BXM



Joined: 03 Nov 2005
Posts: 26
Location: mars
BXM
Well... Visual Fred produces managed code, whereas C and Assembly produce native code.
Fact is, C/C++/Assembly programs can run without having to download and install the DOTFRED FX RUNTIME PP12 SP28 on the targetted machine.

The purpose of such a platform is to provide a set of libraries, for example the handy WebRequest Object in .NET: true, no need to reinvent the wheel. On the other hand some programmers do trust only some binaries, those without spies or remotely controlled stuff, go figure...

Also i would like to point out that this platform is supposed to get the same code running on several OSes, diversity coming from a brutal marketing strategy (i still think all Windows are pretty much the same thing).

There was a debate about the C/C++ language (which is itself pretty far from .NET) and it appeared thazt assembly is essential to understand how everything is put all together. PHP for example, is not written with managed code. ;) Try to build an OS with DOTNOTNET ...

This is why they can't be compared as Assembly, C, and C# represent the tree levels of programming, C# being the highest level. And when it comes to protability, Java could be a better choice.

Excuse my rant but, like several hundreds of microsoft MCPs, i don't see any similarity between VB6 and VB.NET (Not to mention VB.NET is not as fast as VB6...) nor the sense to have a VB.NET and a C# as they're very similar.

Furthermore, assembly will never die, here is why: the specificity of platforms like Java and NOTNET is the use of a JIT compiler: programs are compiled and executed "Just in Time". What kind of compiler could do this? You get it: assembly. The fatest. The strongest. The smallest. The best.

A quote from AOA:
Quote:

4.3 WHEN TO USE ASSEMBLY LANGUAGE

I personally think that except as a learning exercise it is a waste of
time writing something in ASM that can be written acceptably fast in a
high-level language.

Assembly language fits for the following:

* Low level control. When you need to change the flags, or the
control registers of the processor, as when entering protected
mode.

* Speed. Programs written in machine language execute fast! It can
execute 10-100 times the speed of BASIC, and about twice as fast as
a program written in C or Pascal.

* Time Critical Code. Critical sections of programs written in
higher level languages can be written in assembly to speed up
sections.

* Small program size. When you write a TSR for example this is very
useful. Writing interrupt handlers is where assembly language
shines.

Assembly language is very flexible and powerful; anything that the
hardware of the computer is capable of doing can be done in assembly.
(Randall Hyde - Art of Assembly)
Post 21 Nov 2005, 14:35
View user's profile Send private message Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
I agree with all these people and madmatt said something really true, because my teacher at school thinks assembly still works only with old TASM and cannot build windows high-tech app's or even Linux app's.
I program since I was 12 and I'm now 18. Thanks to FASM I know more programming than most people at my school. I think we should present FASM to schools and show how educational and powerful it is.

And yes, assembly will never die!
And FASM will keep it alive and even more powerful and cool! Very Happy
Post 21 Nov 2005, 20:06
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
yes, most techers are very bounded by their main subject. Only real disadvantage of assembly (i mean when using FASM with all it's macrocapabilities) i know of is that it isn't cross platform, eg. it won't work on other families of processor. But in this time of x86 and endless backward compatibility i don't see this as problem. 16it protected mode rulez.
Post 21 Nov 2005, 20:23
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Portability is one of the most important argument against programming in assembly. But when writting some app in C, how often do you think about porting it to another platform?
Post 21 Nov 2005, 20:29
View user's profile Send private message Visit poster's website Reply with quote
kidscracker



Joined: 29 Oct 2004
Posts: 46
Location: Peru
kidscracker
I agree,AMS wil never die,I also since i was a child(10 to be exactly) and when I started with ASM it was amazing,al the possibilities that it give you and the freedom that you gain using it. Many teacheras and profesors thnk that the ASM is too hard to learn,that's beacause the didn't want to. Yes present FASM to schools will be perfect,at my university I'm doing it and many persons are impresed with the things that you can do with ASM,how small are the applications,and how ast they run.

So ASM rulez!!!
Post 22 Nov 2005, 15:10
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
I don't like the fact that I need a billion megs to install a HLL compiler. I like the fact that assembly needs one .EXE plus maybe a linker. I can put it all on a floppy if need be. I mean, this is the main selling point of things like MenuetOS: less filling, tastes great! Smile
Post 23 Nov 2005, 10:00
View user's profile Send private message Visit poster's website Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
Right, especially downloading huge compilers is terrible. I was recently downloading some compilers:

Borland C++ Builder 6 - 100mb
Open Watcom - 80mb (Fortran compiler takes 15megs!!!)
DevC++ with MinGW toolset: 13mb
MASM32 from Hutch - 3mb.
Good old Turbo Pascal Wink - 2mb.
FASM for Windows - 746kb, for DOS - 175kb....

I didn't downloaded any free C++ crap from M$, but Visual C++ Express installer is ~2mb, proably it will download a lot more.
Post 23 Nov 2005, 10:32
View user's profile Send private message Visit poster's website Reply with quote
JMGK



Joined: 26 Aug 2005
Posts: 27
JMGK
decard,

visual c++ express is like 450mb... and isnt worth the download Sad

what about borland c++ freeware compiler? its like 8mb, and its a very nice compiler

jmgk
Post 23 Nov 2005, 12:36
View user's profile Send private message Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
Yeah! I've tested lots of C/C++ compilers:
* MS Visual C++ 6
* MS Visual C++ free command line tools
* Borland free command line tools
* Dev-C++ (with Mingw)
* Mingw Developer Studio (with Mingw)
* Lcc-win32
* Pelles C

And I think most of them are very huge packages.
I sometimes use Dev-C++ because of the update feature that makes it easy to download and install libraries like SDL, Allegro, DirectX, etc...
I love Mingw Dev Studio because the look 'n feel is like MSVC++, but without the bloatware stuff like MFC, and with free C/C++ compiler mingw. And it has the best code completion I've ever seen.
Pelles C is also very good IDE, compiler and linker that can give me 1kb EXE's Very Happy
Lcc-win32 is quite useable, the IDE has some bugs, but yesterday I found some good extensions it has in its compiler.

Decard: I was thinking about download the Open Watcom. Can you tell me if it is good IDE/compiler? Thanks!

So, conclusion:
ASM ownz! Very Happy
With FASM even better!
Small tools needed to build app, small app EXE, fast app running!
And C is good for playing around and having rapid solutions for something that doesn't need to be fast and small.
Post 23 Nov 2005, 16:29
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
It looks strange (all Open Watcom applications), like it was made for Windows 3.11. I downloaded to try its resource editor (it sucks too), I didn't even try to compile anything. I wouldn't suggest installing it, however some people may like it. But generally DevC++ is better.
Post 23 Nov 2005, 17:00
View user's profile Send private message Visit poster's website Reply with quote
calpol2004



Joined: 16 Dec 2004
Posts: 110
calpol2004
i myself was gutted when i found out that asm beat c in virtually everyway, id been told in all my reference books that C was the fastest most reliable and efficient language out there. eventually i learnt error of ways and im now porting all my c code into asm and im rly seeing a difference especially in executable size. your teacher is not a very good teacher if he/she thinks .net is more efficient (lol! u tell her that).
Post 04 Jan 2006, 20:53
View user's profile Send private message MSN Messenger Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
decard wrote:
FASM for Windows - 746kb, for DOS - 175kb....


and there is nearly 400kb PDF-file included Wink

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 04 Jan 2006, 21:16
View user's profile Send private message MSN Messenger Reply with quote
rob.rice



Joined: 20 Dec 2003
Posts: 54
rob.rice
OzzY wrote:
I agree with all these people and madmatt said something really true, because my teacher at school thinks assembly still works only with old TASM and cannot build windows high-tech app's or even Linux app's.
I program since I was 12 and I'm now 18. Thanks to FASM I know more programming than most people at my school. I think we should present FASM to schools and show how educational and powerful it is.

And yes, assembly will never die!
And FASM will keep it alive and even more powerful and cool! Very Happy

here is some thing to show your teacher these were writen to assembl with nasm but it shows that assembly can be used for linux when a kernel and boot sector are added to these utils this can be used as a rescue O/S
http://asm.sourceforge.net/asmutils.html
something to note about these utils all of them assemble to
less than 1/2 a meg as a fact of the matter with the right kernel a boot disk can be made from a 740k floppy
here is an editor that can be assembled for linux or DOS/windows from the same source code
http://www.sax.de/~adlibit/
this is a veary useful editor that can be assembled to around 10k
you could talk all day and still not prove your point as
well as some examples can
bazik has writen some gdk GUI examples that are included in the linux package of the FASM assembler


Last edited by rob.rice on 17 Feb 2006, 17:36; edited 1 time in total
Post 17 Feb 2006, 17:28
View user's profile Send private message Reply with quote
calpol2004



Joined: 16 Dec 2004
Posts: 110
calpol2004
well a "Hello, World!" C# .net application or C++ application sizes of the executables are well into hundreds of KB. while an ASM "Hello, World!" App can be as small as 260bytes. same goes for any other application in just about all cases. same goes for speed also. there is hardly any point in using higher level languages unless of course you've got a tight deadline or your just lazy.
Post 17 Feb 2006, 17:35
View user's profile Send private message MSN Messenger Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
Surely you don't all write everything in assembly, do you? I mean, if a batch file (or Bash script, etc.) will do the job, why whip up the same thing in .ASM? It takes a bit longer to do (some) things in assembly mainly because you don't already have some basic routines written (i.e., printf). It all comes down to what tools and libraries you have plus how much time, dedication, experience, etc. you have.

P.S. The e3 editor mentioned above (2.7.0) is nice, but its DOS version (e3-16) is much weaker, Wordstar commands only, limited to max. 32k filesize, so it's not that hot. There are better tiny DOS editors out there. BUT, I did just recently get the Win9x version (renamed to e3vi, which I prefer) to work under DOS with HXRT. Smile
Post 18 Feb 2006, 17:29
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.