Shop OBEX P1 Docs P2 Docs Learn Events
assembly and windows - recent revelations — Parallax Forums

assembly and windows - recent revelations

RocketScientistRocketScientist Posts: 4
edited 2007-04-16 04:06 in General Discussion
This is a fairly broad subject. I wanted to make the comment that a year or two ago I programmed SX chips and really learned assembly language. I really loved it. Then need dictated I move to C++ which I have been learning lately. A recent revelation occured today when I was "debugging" an app in Microsoft Visual Studio 2005 and it disassembled the code into what appeared to be SX assembly (not quite but very similar!!). I was amazed and upset as I found assembly more intuitive and powerful than any language I had programmed in thus far and C++ has been difficult for me to learn. In fact, it seems that C++ programmers shy away from assembly like the plague. I ended up today wishing I could learn to program Windows in assembly from my Sx experience. Yet, the whole C++ culture seems to run away from this. Has anyone has a similar experience? Can anyone suggest how to learn "assembly for Windows"?? I realize this forum is assembly for Sx, but I submit to you after todays revelation they are probably alike!

Thanks,

RS

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-04-15 21:33
    So much depends on what you're trying to do and what the underlying processor is capable of handling. For example, neither the Propeller nor the SX are capable of multiplication or division except through a subroutine call. Similarly, most processors short of something like a Pentium or equivalent have no built-in floating point operations. If the instruction set is a good match for the task at hand, assembly language is an excellent tool. If it's a poor match, programming in it is very inefficient in terms of human effort and very error prone. This is a general rule regarding programming languages.
  • DosManDanDosManDan Posts: 179
    edited 2007-04-15 21:49
    I'm a huge fan of assembly language, but the problem you mention brings up the old addage of using the right tool for the right purpose. I have taught assembly at the college level for over 9 years (as well as other languages), so I don't want you to think I am prejudice against using low level languages.

    If you were to try and write a full blown Windows application using assembly, I can pretty much say, without a doubt, you will never finish. The new drag and drop languages (VB, C#, Delphi) make development fast and visual.

    Assembly is best used for targeted problems where high speed and optimal code is essential. One such application requiring this speed was an interface I wrote between the E-911 ANI/ALI computer interface unit and dispatching equipment in an emergency command center. Continual monitoring, the ability to process signals real time and other factors dictated the use of assembly. But, the rest of the application was written in another language.

    One reason you might find assembly easier to use is because of the 1-1 correspondence between the mnemonics and the actions performed. High level languages have one command that is broken down into dozens of lines of assembly. For example, a REPEAT command is broken down into about 6 to 8 lines of assembly.

    My best advise is to continue to learn other languages and build your toolbox of knowledge. Very rarely can I ever solve a complex problem without a mix of languages. Even an easy web page requires HTML, CSS, scripting languages and a high level language.

    Enjoy,
    DosManDan
  • RocketScientistRocketScientist Posts: 4
    edited 2007-04-16 02:42
    Sage advice. If my c++ app has need for speed, consider "accelerating" certain time intensive modules with assembly but save time by keeping it a higher level language for the bulk of the app. And of course, make it a good match between processor capability what you want to do with it I suppose. makes sense. Thanks for the replies it really tied some things together for me.

    RS
  • lostcauzlostcauz Posts: 36
    edited 2007-04-16 04:06
    Hey RocketScientist,

    Like they say it's probably not practical but it can be fun. I'm not really a programmer but I made a program about building a dome, never got around to building one yet. lostcauz.org

    You might consider trying out the MASM32 package for windows assembly programming. Search google for Iczelion's tutorials as well.

    HTH

    --lostcauz

    Post Edited (lostcauz) : 4/16/2007 4:49:59 AM GMT
Sign In or Register to comment.