-1

I have been trying to learn assembly language for the past few months, and it seems to me that anything that I try is just impossible to do.

I have found the Intel x86 Instruction Set Reference (all 4000 pages of it), along with three or four other tutorials. I have read over these, used the example code and tried to make sense of it. But I still can't do too much stuff with assembly. Hence my making an account here on Stack Overflow. But I feel as though I'm bugging the forum with my overly simple and bad questions.

My question is, is there any point in someone pursuing assembly language nowadays? It's fun enough, but it's so hard to make even a simple window (CreateWindowEx function takes 12 forsaken arguments!) that it seems pointless.

Thanks

Martin Smith
  • 438,706
  • 87
  • 741
  • 845
Progrmr
  • 1,575
  • 4
  • 26
  • 44
  • doing a full-blowing gui app in assembler is extraordinarily painful, but it's still useful to know if you ever want to tightly code a critical section of a 'busy' program. – Marc B Aug 29 '12 at 04:01
  • http://stackoverflow.com/questions/6623219/is-it-worthwile-to-learn-assembly-language, http://stackoverflow.com/questions/82432/is-learning-assembly-language-worth-the-effort – Mysticial Aug 29 '12 at 04:02
  • 2
    there are plenty of reasons to learn assembly. Doing things like calling `CreateWindowEx` probably wouldn't be in my top 5 though. WHY are you trying to learn? Tuning critical sections of code? Figuring out how to better debug crash dumps? Or just because? – Dan O Aug 29 '12 at 04:02
  • @Mysticial I didn't see the other posts when I was writing it, sorry. – Progrmr Aug 29 '12 at 04:07
  • @Orzechowskid I can't write good enough code to bother tuning it, so I 'm learning for the sake of it. – Progrmr Aug 29 '12 at 04:09
  • x86 is a terrible instruction set, definitely not the first one you want to learn. Having the hardware is not a good reason at all to learn one first, you want to start on a simulator with lots of visibility anyway. Try arm or thumb or msp430 or atmel avr or lattice mico8 or others first they will drive you less crazy. Mips is good but not my first choice either, it is designed for the hardware first and programmer second, so the programmer has to suffer a little to use it, and that it does a few things that most processors dont do that way which you will need to unlearn or re-learn. – old_timer Aug 29 '12 at 05:08
  • The first may be the hardest, the second, third, etc are significantly easier if not trivial. Then go ahead and look at x86 and you will "get it" and be able to disassemble and understand things or write your own x86 code if you feel the need. worked for me, I failed to learn x86, it made no sense, learned another very good instruction set, then went back to x86, wrote many asm programs, and now know many instruction sets and work in the chip/processor industry. – old_timer Aug 29 '12 at 05:11
  • For learning assembly, I'd suggest that you start from very basic and try to understand every instruction you use in detail and learn all the essential concepts (eg. processor modes, registers, segment registers, stack, flags, addressing modes, comparisons, jumps, calls, interrupts) before advancing to any further (or copying an example program from a book). Most bugs can be found by single-stepping the code in a debugger, so you should have a good debugger at hand and learn to use it. However, assembly is a low-level language and writing any non-trivial software in it is an arduous task IMHO. – nrz Aug 29 '12 at 05:55
  • Tried to make the question more general, in the sense of the usefulness of anyone learning ASM nowadays. Whether that's enough to make it more constructive is something I'll leave up to the swarm :-) – paxdiablo Sep 01 '12 at 08:07

1 Answers1

3

The vast majority of coders will never need to program in assembler, just like the vast majority may never need regular expressions, or need to learn the inner intricacies of various data structures.

That doesn't make them any less valuable in your toolkit.

I personally wouldn't be writing full-blown windowing applications in assembler, any more than I'd write an accounting package in it, or an operating system in COBOL, or pretty much anything in Pascal :-)

Choose the correct tool for the job (in all environments) and your life will be much easier.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
  • Hmm, you are dating yourself. You know if you go back and look at Pascal with this amount of time gone by, maybe from a compilers perspective and not a users perspective. There actually is some beauty to it...I didnt and dont write anything in it either. – old_timer Aug 29 '12 at 05:16
  • Plus one assuming you are saying that asm is a necessary tool in your tool box to be used at the appropriate time. Which would be bootstrap/startup code, disassembling to see what the compiler did maybe it is not your bug. And the very rare after disassembling make the compiled code faster in a critical performance section of the program. – old_timer Aug 29 '12 at 05:17