Results 1 to 7 of 7

Thread: x86 Assembly Language

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    219

    x86 Assembly Language

    Does anybody know of a good place to learn x86 assembly and understand it fully? I know a bit of it but I don't really understand it

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: x86 Assembly Language

    that's hard to say, everyone is different. What works for one, doesn't work for others. I picked up ASM close to 20 years ago by reading the friggin manual that came with my copy of Turbo ASM -- and I mean the REFERENCE Manual.... not the user manual.... picked up Pascal the same way.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: x86 Assembly Language

    If I was to start into assembler today, I would consider a book as a place to start, coupled with an appreciation that you will have to WORK to really understand it.

    TG speaks of days gone by when life was simple and memory was segmented. I, too, learned ASM in those halcyon days where a bit of ASM, artfully dropped into your program, could give you recognizeable performance boosts. The manuals in those days (I still have one) gave you actual instruction timing in cycles. For instance, you could look up the exact number of cycles taken by MOV ax,bx for all the x86 processors. A good book from those days, which would still be quite relevant now, would be Jeff Duntemann's Assembly Language Step by Step, put out by Wiley Press. However, you would have to keep in mind that times have changed.

    If you look up the Intel x86 instruction set manuals nowadays, which I did a couple years back online, you won't find the cycle count for any instructions. Instead, you will find a discussion of the factors that go into the timing of each instruction. The introduction of multiple pipes (not cores, just pipes, introduced with the Pentium chip), pre-fetch, caches, etc., means that a simple instruction such as MOV ax,bx can take a variety of real execution times beginning with a fraction of a cycle.

    The result of this is that hand-tuning code for optimal performance is FAR more difficult than it used to be. You can't add the cycles for each instruction, because the actual cycles taken depends on the code around the instruction itself. Therefore, optimization is something of a major specialization. Several years ago, not long after the advent of the Pentium, I read a book on using ASM for optimization that opined that the compilers for the 486 were so good that an individual was unlikely to improve on the ASM put out by a C compiler. The author went on to say that the dual pipes in the Pentium opened the door to new and better optimizations that were greater than what the compilers of the time could accomplish. These days, it is quite likely that the door to casual optimization has slammed shut for good. I would expect that modern compilers are so much more effective at generating code than all but a handful of ASM wizards that there is nothing to be gained by hand optimizing ASM. The rules that go into the timing of each instruction are so interrelated that you can't keep them all in mind well enough to optimize much of anything.
    My usual boring signature: Nothing

  4. #4
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: x86 Assembly Language

    That's so depressing.. thank goodness for Intel's new multi-threading classes.

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: x86 Assembly Language

    Moved to the Assembly forum

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    219

    Re: x86 Assembly Language

    Well what works for one, must work for at least one other when you think about it.

    Has anybody here seen a good web tutorial or book on x86 assembly with NASM?

    I want to know how things work on the lowest levels, you see.

  7. #7
    Addicted Member pcuser's Avatar
    Join Date
    Jun 2008
    Posts
    219

    Re: x86 Assembly Language

    Has anybody here seen a good web tutorial or book on x86 assembly with NASM?
    http://www.drpaulcarter.com/pcasm/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width