Slashdot Mirror


Learning x86 for Non-x86 Assembler Programmers?

An anonymous reader asks: "I've done assembler for the 6809, 68000, 8085, MIPS and ARM architectures over the years. But - I've never learned assembler for the most common architecture out there. I would like to change that. I can roughly follow my way around x86 disassemblies, but I'm not as good at optimizing/fine tuning bits of assembler because I am not intimately familiar with all of the addressing modes etc. I would like a book that is targetted at people like me. I would like to be able to fine tune, say a blitter in x86 assembler. One thing I do not in a book is something that is trying to teach me assembler programming in general. Most assembler books seem to fall in the latter category. Are there books out there that might prove useful to me?"

4 of 64 comments (clear)

  1. Re:proccessor that runs 2.5GHz in 640MB ram by Electrum · · Score: 4, Interesting

    Check out MenuetOS, "a fully 32 bit assembly written, graphical OS for asm programming, distributed under General Public License". My friend joked that it ran faster under VMware than Windows does natively.

  2. Re:Assembly on a modern proccessor? by Your_Mom · · Score: 3, Interesting
    *points to the 45-byte guy who was here before him*

    That, is why ASM is better then any HLL. I think the best quote I got from one of my Computer Engineering book was (paraphrasing) "Modern compilers with their optimizations are on the road to becoming almost as good as hand writen assembler."

    Now, would I write word processor in ASM? Not bloody likely, HLLs make it much easier to do. But, when you are writing code for some type of embeded system that doesn't have a whopping 2 GHz processor, ASM will beat any HLL hands down. Unfortunately, too many people think ASM is dead, never learn it, write their embedded code in C and when it isn't fast enough, tell their supervisors that it needs a faster processor. Consider this scenario (stolen from one of my profs):

    • Coder writes embedded system in C.
    • Code isn't fast enough makes company buy faster processor
    • Each processor adds $10 to cost of said system.
    • $10 * 1e6 units = $10e6
    As opposed to this
    • Coder writes embedded system in C
    • Code isn't fast enough
    • Company calls in consultant
    • Consultant reads C, looks at the ASM it creates and spends one night tightening the ASM up.
    • Consultant head off to Florida for the rest of the week
    • At the end of the week consultant makes himself looked disheveled and stumbles in saying "It took all week, but here is the code, it will save to $10 per unit"
    • Consultant Charges $2e6, which will the company gladly pays, considering it saves them over $8e6.
    See, knowing ASM and how processor works is a good thing that can make you money (maybe not as much, but still a nice whopping amount for a few days work). ASM is still needed, and anyone who says different, does not understand how computers work.
    --
    Objects in the blog are closer then they ap
  3. best x86 resource by green+pizza · · Score: 3, Interesting

    http://grc.com/smgassembly.htm

    Yep, Gibson writes gui Win32 windows apps in pure x86 assembly. He's nuts, but his apps are tiny and run fast. Lots of good resources there.

  4. Assembly language word processing? by Mr+Z · · Score: 2, Interesting
    Granted, you wouldn't write a word processing suite in assembler,

    Shhhh! Don't tell that to these guys:

    In October 1978 [...] Barnaby began coding WordStar. In four months, Barnaby wrote 137,000 lines of bullet-proof assembly-language code. Rubenstein later checked with some friends from IBM who calculated that Barnaby's output was equal to 42 man years. [link]

    ...or...

    For the past three years, [Jeff Wilson] has been employed by WordPerfect Corporation as a software engineer. While there, he participated in development of WordPerfect for the Apple IIe/IIc computer line. He is currently managing development of WordPerfect for the Atari ST, which should be available shortly after you read this. He programs exclusively in assembly language, and enjoys it! [link]

    Also, from what I understood, the WordPerfect Corporation actually required that all programs be written in assembler. BTW, some more interesing WP history.

    Oh, you mean, you wouldn't use assembler to write a word processing suite nowadays. Ok, I getcha. Yeah, I think you're right. After all, WordPerfect Corp has been out of business for how long? (Well technically, bought out and resold, and resold... They're just a name now.)

    --Joe