hi,

first post here. It seems a very nice community.
So, I know a little about 16bit DOS Assembly and also a little about 32bit Linux Assembly.
I started learning Assembly out of curiosity, to understand C better and to learn exactly how the stack worked.
I am currently learning Linux Assembly, as this is the OS I want to concentrate in for the time being.
While reading, a lot of computing concepts and theories made a lot more sense.
While I enjoy assembly much, a question keeps popping up.

Is assembly worth learning it?

I know that everything you learn can only be an advantage, but sometimes I just get the feeling that I'm wasting my time with Assembly.
I've got a huge list of books that I want to read and I just want to be sure that I'm not spending precious time on something that is obselete, unwanted and useless.
The thing is, that I really like low-level stuff.

So my questions are:
1. I hear a lot of people saying that the only people still writing assembly are some crazy old hackers that refuse to use anything else. Is that true?
2. I hear also that anyone wanting/trying to make a real application in assembly (except device drivers) is a masochist. Like make a GUI in Windows or something. Is that true?
3. It has come to my attention, that there is no dedicated forum for Linux Assembly on the whole web! The only resources/discussions I have seen are a couple of blogs and some empty/deserted subforums in larger assembly forums (like those here).
What is the reason of this limited interest in Linux Assembly?
Does this mean that noone uses assembly on Linux?
Or does that mean that doing assembly on Linux is pretty much useless?
4. I know assembly is fast and efficient (if the programmer is good) and is great for developing device drivers, operating systems and is often used in embedded devices. But what are some other applications of it?
5. The most people I see are just *forced* to learn assembly, in order to involve themselves with reverse engineering or cracking.
I think that's because the 95% or more of the assembly material/forums/resources I see is headed towards the Microsoft Windows OS. Because there is a lot of commercial programs that attract reverse engineers and/or crackers. Is that right?
Is there a reason to do Windows Assembly if you're not interested in reverse engineering (I'm not saying that I'm not)? If yes, please list as many as you can.
6. Does learning 16bit DOS Assembly make any sense anymore? Except the concepts/general asm way of thinking taught from it.
Posted on 2006-10-03 17:34:30 by belhifet
belhifet,

    Most of your questions and a lot more will be answered at the link below.  Ratch


http://www.masm32.com/board/index.php?topic=1991.0
Posted on 2006-10-03 18:45:01 by Ratch
#1: partially - as in, there certainly are people that fit that description. Other people write assembly because it's fun for them, because they don't feel like learning another language, or because there's an advantage in doing so.

#2: personally, I'd say that full-asm program development isn't necessary these days, and haven't been so for several years. For most people, it's also slower to develop in assembly than some higher-level language (and if equally skilled in several languages, assembly would probably still take longer since there's more typing). If you compare assembly to a low-level HLL :) such as C, you will find lots of similarities, though.

#3: there's probably a bit more linux-specific activity at the FASM board. The basics are the same though, only the system interfacing is different. Lacking linux/asm interest? linux has a lower user base than windows, and the system is highly C-centric and developers speak a lot about 'portability' (even though their portability is often so-so).

#4: assembly doesn't actually matter much for device drivers, nor for the majority of operating system code... windows and linux are like 95% C code. The main usefulness of assembly, as seen by the software industry, is in beating your compiler at specific tasks (speed for most systems, speed+size for embedded...)

#5: there's probably more people learning assembly because of university courses than because of an interest in RE. Other uses? Knowing how to write efficient code. Even if you're mainly going to deal with higher-level languages, knowing assembly and machine organization is useful to be more efficient.

The reason most material is for windows is that this is, by far, the largest userbase. Same reason that most software is made for windows, and most security flaws are found in windows.

#6: not in my opinion, unless you're going to deal with DOS. You'll be confined by limits that are mostly artificial (even lots of embedded systems are 32bit today).

PS: read the rules thoroughly, don't mention cracking, and do think twice if you're going to mention RE. We like to keep things clean :)
Posted on 2006-10-03 20:41:42 by f0dder
(in addition to f0dder's post)

#1: I also thought/imagined so before I started asm. Yet, here you have brilliant asm coders from ages of 16 (and lower) to 85,  and mostly around 28 yrs old probably.
#2: Not true. An asm-beginner trying to code a larger project is overkill. Anyone doing that without macros or some "shortcuts" is again overkill. But it's another story if the coder is experienced, has a good library of code and macros/tools to use. For me, x86 asm is the definite choice for anything: small to huge projects (and I rarely code small projects). Only the FPU code can be some hurdle. www.asmdev.net www.oby.ro/rts www.ultranos.com, and many more.

#4: beat the competition by not requiring the latest cpu to run in realtime: graphics, sound.
Posted on 2006-10-03 23:29:22 by Ultrano
2. Only true at the first stages when learning Assembly. With time when you develop your own base of reusable code, acquire experience, and learn some tricks you won't notice any significant difference (regarding coding time consumption) between coding in HLL or in Assembly.

3. Linux has a much lower user base than Windows. Assembly language user base is much much lower than of any other popular language. Obviously, those two aspects in combination do not yield a reach linux-assembly user base.
It doesn't mean that no one uses it or that it's useless. It's just the percentage of people using it is very small due to the reasons describe above.

As for forums. Unfortunately you right. There is not much of those.
There was a very nice linux-assembly mailing list maintained by K.Boldyshev some time ago. But it pretty much died a few years ago.
Some folks on this board are familiar with linux assembly, so I am sure they will be glad to answer any questions in the 'deserted' subforum  ;)

4. Any area when you need high execution speeds. You may usually notice functions optimized in Assembly in miscellaneous encryption, compression, encoding products.

5. imo, yes.
* It's a computer programming language and knowing additional one is always a good thing.
* Assembly knowledge comes useful when debugging applications.
* It is closest to hardware you can get. So basically you can be always sure that what you see on your display is what CPU sees as well.
* Efficiency. -> Resulting executable's speed and size. Sometime when you need high code execution speed - assembly is the only way.
* Knowing assembly allows you understand some internal parts in HLL compilers and thus produce better code while coding in HLL.
* Some people simply like Assembly because its language structure seems more logical to them than of HLLs.
* etc.

6. I think learning DOS programming is not a good idea. Unless you a DOS fan and actually have one installed.
16bit is kinda comes retroactively when learning 32bit, so it's not much a problem.

1. I probably should put here some witty analogy comparing asm to cars or whatever... Read the link pointed by Ratch for that  :D
Posted on 2006-10-04 01:04:51 by arafel
first of all, you will NEVER really understand C until you have some base in ASM.
Posted on 2006-10-04 01:29:58 by vid
Depends what your personal goals are.

16bit ASM is a fun hobby for me.
Its like playing with bits of electronic lego, you can build your own original cool little widgets for doing things.

Higher level stuff uses larger pre-built widgets that you bolt together and is more appropriate for the efficient construction of larger projects.

You can do both, then when one gets a bit boring you can switch.
Posted on 2006-10-04 05:29:06 by eek
1. I hear a lot of people saying that the only people still writing assembly are some crazy old hackers that refuse to use anything else. Is that true?
NOPE, lots of people come to assembley for the hacking/cracking but stay for the power asm offers.
Nothing else comes close in terms of what you can do with it, even c. Prolly the reason we are called crust old hackers (im only 26!) is because its hard to leave that power behind to go to a lang that is a. SLOWER and b. PRODUCES LARGER CODE


2. I hear also that anyone wanting/trying to make a real application in assembly (except device drivers) is a masochist. Like make a GUI in Windows or something. Is that true?
Masms high level constructs means (aside from complex math problems which are admittedly harder in asm) its possible to write an asm as easy as a c/delphi app

3. It has come to my attention, that there is no dedicated forum for Linux Assembly on the whole web! The only resources/discussions I have seen are a couple of blogs and some empty/deserted subforums in larger assembly forums (like those here).
What is the reason of this limited interest in Linux Assembly?
Does this mean that noone uses assembly on Linux?
Or does that mean that doing assembly on Linux is pretty much useless?
Windows owns the market! Its that simple. also the opcodes dont change so any thing that isnt windows api related is usually directly applicable to linux. In short there isnt on because it generally isnt needed but plenty of linux users frequent this forum (including me) so getting answers to specifics shouldnt be that hard....


4. I know assembly is fast and efficient (if the programmer is good) and is great for developing device drivers, operating systems and is often used in embedded devices. But what are some other applications of it?
The main advantage for me is WYSIWYG. if i type in the assemble it will look like that in the debug making apps MUCH easier to repair since you dont have to wade through 2 ton of C 'crust'

5. The most people I see are just *forced* to learn assembly, in order to involve themselves with reverse engineering or cracking.
I think that's because the 95% or more of the assembly material/forums/resources I see is headed towards the Microsoft Windows OS. Because there is a lot of commercial programs that attract reverse engineers and/or crackers. Is that right?
Is there a reason to do Windows Assembly if you're not interested in reverse engineering (I'm not saying that I'm not)? If yes, please list as many as you can
You ARE into reverse engineering every time you use your debugger you reverse engineer! Besides ive lost count of the number of program ive removed bugs from minus source code, try doing that if you can only program in C  :lol:

6. Does learning 16bit DOS Assembly make any sense anymore? Except the concepts/general asm way of thinking taught from it.
no, not for me but maybe for others........

Hope my experiences helped some......
Posted on 2006-10-04 08:18:43 by Nice Eddie
everyone is still missing point of understanding WHAT are you running on. unless coding for some bytecode, you should understand what your are producing. in those case, you should learn that bytecode.

and to 16 bit asm - it is needed do understand why some 32 bit things are designed the way they are
Posted on 2006-10-04 08:22:50 by vid
sorry, my english is not great and i was writing it in haste.

i meant - you listed many arguments for learning ASM, but i still miss the (imho) most important one: you should understand what you are creating. In case od C/C++, you are creating x86 machine code - so C/C++ programmers should learn assembly.

.NET programmers should learn MSIL, Java programmers should learn java bytecode...
Posted on 2006-10-04 08:43:58 by vid
Writing Solid Code
Page 36

So We can say that, assembly have been still using GUI applications...

Posted on 2006-10-04 12:26:21 by Dite
Yet, all that fear of bugs smells like inexperience with x86 asm.
I did the same stuff while coding 3D polygon/sprite fillers for ARM, while the cpu was new to me. (though instead of coding disassemblers- that I already had with the ARM-GCC package, I coded useful asm macro preprocessors/assemblers - because GAS is unfit for human usage).

vid, you really don't need to know 16-bit asm - unless you start wondering what those segment-registers are for (which you never touch anyway, except for FS[0]).
Posted on 2006-10-04 14:50:37 by Ultrano
Dite: where is that from, how old is it, and do they still use assembly for the page layout? (I doubt it). And non-table driven disassembly, yuck ^_^
Posted on 2006-10-04 17:08:36 by f0dder
As I mention the first message, this text is a part of a book that is "Writing Solid Code"(Steve Maguire)  on page 36

Here amazon link
http://www.amazon.com/Writing-Solid-Code-Microsofts-Programming/dp/1556155514
Posted on 2006-10-04 17:15:16 by Dite
Ah, I missed the "page 63" part and though "writing solid code" was your own comment. Microsoft press 1993 - pretty old then. CPUs were pretty slow back then, and compilers sucked :)
Posted on 2006-10-04 18:18:09 by f0dder
I very much doubt that anything in Word is hand coded in assembler these days, or even shortly after that article when the Pentium family was introduced and became widespread. Yes, in the days when the 386/486 were king it was probably necessary but today it is usually a much better decision to use C/C++ or some other high level language. With the compilers today you would be hard pressed to outperform the compiler with hand written code anyway.
Posted on 2006-10-04 19:42:28 by donkey
OMG! did i just hear donkey speak out AGAINST asm!
I am both shocked and amazed!  :lol:
Posted on 2006-10-05 02:19:31 by Nice Eddie
vid, you really don't need to know 16-bit asm - unless you start wondering what those segment-registers are for (which you never touch anyway, except for FS[0]).

not true. you need to know if you care about encoding of instructions anyway. thus, you also need to know if you care about size of instructions. And you also need to care about encoding to find, why sometimes you can use relocated constant and why sometimes not.

... do you think these are THAT rare cases?
Posted on 2006-10-05 02:47:20 by vid
vid: I think it's a rare case that you need to care about instruction encoding. It matters if you're doing "tricky stuff" or in extreme optimization cases, but those are rare cases for most people.
Posted on 2006-10-05 03:49:13 by f0dder
for example when you are doing tricky things like this:
db MyLabel and 0Fh
, like when you want to display address of label.

Yes, these are rare, but not rare enough.
Posted on 2006-10-05 06:45:56 by vid