Slashdot Mirror


Assembly Language for Intel-Based Computers, 4th edition

Alexander Moskalyuk writes "Most of the people I know have a love-hate relationship with Kip Irvine's Assembly Language for Intel-based Computers. Ask any student who used this textbook and you will either get a cheerful 'I've used it, it's great, I learned Assembly, and it has lots of useful examples' or resentful 'The book is horrible, hard to follow and full of code that is irrelevant to the contents of a specific chapter.'" Alexander's review of the book (below) concentrates on its role as an instructional aid, and on the differences between the third and fourth editions. Assembly Language for Intel-Based Computers, 4th edition author Kip R. Irvine pages 676 publisher Prentice Hall rating 8/10 reviewer Alexander Moskalyuk ISBN 0130910139 summary Authoritative source on Intel assembly programming and Assembly language fundamentals

Popularity Contest of One A quick search on Amazon, however, reveals that for the keyword 'Assembly' Irvine's book is still the bestseller. The fourth edition of the text tops the list and the same was the case with the third edition. The university where I teach uses Irvine's textbook for its introductory Assembly courses. We've used third edition throughout last year, and decided to stick to the third edition (with fourth recommended) during this academic year as well, just to avoid having students cash out for a newer version of the same text. Since this is a Prentice Hall textbook targeted mostly towards Computer Science and Engineering programs, welcome to the world of academic pricing -- the list price of fourth edition is $76.

Third vs. Fourth

The first natural thing to do is to see whether the fourth edition of the text is superior to 1999's third edition. Just looking at the table of contents, you can see that a lot of new material has been added, even in the introductory chapters. Furthermore, fourth edition has a new version of the first Assembly program introduced to the reader. Instead of the notorious 'Hello, World' example, it's now adding three numbers. Hello, World would usually be the thing to introduce first in classes with C++ or Perl being primary languages. However, in Intel Assembly the example just confused students more, since printing the phrase "Hello, World" to the screen involved dealing with interrupts, and that topic would not be covered until later in the course.

Irvine also got rid of his "Using the Assembler" chapter, which might be a nuisance for some of the readers and relief for others. The book comes with Microsoft ASM and thus all examples assume using MASM for their compilation needs. In my class, however, NASM has always been the compiler of choice, partly because it's easier to introduce to novice programmers who have not been exposed to Assembly before, and partly because of the tradition -- NASM was the compiler that previous instructors used, and thus was available on university servers and familiar to tutors in the labs. Vaguely named "Advanced Topics" chapters are almost gone and now changed into much more informative "16-bit MS-DOS programming," "Expert MS-DOS programming," "BIOS level programming," "32-bit Windows programming" and "High-level language interface." The last chapter of the book is now the only one bearing the name "Advanced Topics" and discusses things like "Hardware control with I/O ports," "Intel instruction encoding" and "Floating-Point arithmetic."

Some appendices are gone as well. The third edition included such topics as "Binary and Hexadecimal tutorial" (now moved to be a part of the introductory chapters), "Using debug" (tutorial on using debug.exe on Microsoft platforms to trace the Assembly code -- it's a shame the appendix is pulled out of the book, since now either students have to learn the commands for debug.exe themselves or additional class time needs to be spent on that), "Microsoft CodeView" and "Borland TurboDebugger" (both gone for good) as well as "Guide to the sample programs" (in this new edition, that successfully migrated into "Installing and using the assembler").

Except for the shocking absence of debug.exe tutorial appendices, the fourth edition looks much more straightforward and useful. Speaking of appendices, there are four of them now - "Installing and using the assembler," which few people ever bother to read when in class, "Intel instruction set," which is the mother of all useful appendices (in fact, I've seen good students get by on nothing else but this appendix), "BIOS and MS-DOS interrupts" and "MASM reference." The CD by the way, includes MASM, source code and macros for the book, as well as evaluation version of TextPad.

Academic value

Kip Irvine is usually accused of bringing up examples that confuse novice readers and trying to show off with his knowledge of IA-32 Assembly. Read the Amazon reviews to find out more. Personally I have never had problems with his style of writing. There were, though, some mistakes in the third edition of the book that would make an instructor pull his hair to pieces. Typos, grammatical errors and words that did not get picked up by the spellchecker were acceptable, but when the sequence of operations during code execution was described incorrectly, you can hardly be accused of being too picky, since you get students relying on the book for knowledge and being mad at you for flagging their code wrong on the test.

If you have the third edition handy, pages 234 and 235 describe the RCL and RCR operations, providing the incorrect order of operations and thus forcing students who use this textbook to learn these instructions to arrive at incorrect results when given a snippet of code to trace. Page 232 in the fourth edition now has the correct sequence of operations.

I would lie to you if I told you that I've read the whole book. Very few people would actually need to go through seven hundred pages, and some of the things discussed might never be useful even if you spent the rest of your life programming Intel Assembly 40 hours a week. But from the information that I got after reading the chapters that interested me (mostly introductory material and all chapters that cover instruction set and interrupts), the text seemed to present material in a clear and straightforward manner, with abundant examples.

A nice addition to Chapter 1 was an explanation of how virtual machines work, since the university uses Java as its core programming language. The second chapter goes on smoothly with careful introduction into the architecture principles and then switches into overdrive, presenting students with information on "Multi-stage pipelining" followed by reasonably simple material on "How programs run."

The book jumps into IA-32 architecture, although I wish that for introductory class the text would stick to 8086 architecture, and then have the 32-bit registers introduced. But generally it's a thorough and informative text for anyone deciding to learn programming Assembly language on Intel platforms, or just beginning Computer Science majors deciding to find out how the stuff really works as opposed to playing with high-level APIs.

The table of contents can be found at publisher's Web site. There's also a Web page for the book, where the author has posted some chapters in PDF format. The chapters published for free include Chapter 1 - Basic Concepts, Chapter 2 - IA-32 Processor Architecture, Chapter 6 - Conditional Processing, Chapter 11 - 32-bit Windows Programming, Chapter 15 - BIOS-level programming as well as Preface and Table of contents.

You can purchase Assembly Language for Intel-Based Computers, 4th edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

245 comments

  1. Assembler is hard to follow? by EvilBudMan · · Score: 2, Funny

    Maybe that's why the book is hard to follow too. I quit at 6502. I gave up after that.

    1. Re:Assembler is hard to follow? by Amazing+Quantum+Man · · Score: 4, Insightful

      Nah, it's just x86 assembly (and probably most RISCs, too...). X86 assembly is baroque.

      Try looking at the 68K instruction set, or the Z8000 (or Z80000) instruction set. Nice orthogonal instruction sets, no special purpose registers (except for the stack pointer - A7 and R15/RR14 respectively). Much more readable than x86 instructions.

      Disclaimer: I learned x86 long before I learned 68K or Z8K.

      --
      Fascism starts when the efficiency of the government becomes more important than the rights of the people.
    2. Re:Assembler is hard to follow? by AppyPappy · · Score: 1
      I'd rather be skinned alive than use Assembler. It reminds me of the dark days of Jurassic programming in the 70's when punch cards and rubber couplings roamed the just-cooled Earth. I'd MV away and PUSH a shopping cart while I POP a few cold beers before I JMP back to those days. The work just doesn't CMP to today.


      God I had a hard time remembering those. That's good.

      --

      If you aren't part of the solution, there is good money to be made prolonging the problem

    3. Re:Assembler is hard to follow? by Anonymous Coward · · Score: 0

      Yeah, but maybe if people still wrote well written assembly then bloated shite like Word etc would be faster with each new release, not slower...you wouldnt need a faster processor just to maintain the same speed.

    4. Re:Assembler is hard to follow? by hey! · · Score: 1

      Not to mention the old Vax asssembly language, which is about as easty to learn as C, and not difficult at all to make reasonably maintainable code with.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    5. Re:Assembler is hard to follow? by EvilBudMan · · Score: 1

      Yes, but doesn't Microsoft pay by bytes per day or something? Gotta have bloat to make a buck. Then you get paid to fix it when it breaks too.

    6. Re:Assembler is hard to follow? by Anonymous Coward · · Score: 0

      Agreed! After a required course in MIPS assembly, I had no desire to tackle x86 and it's large instruction set.

    7. Re:Assembler is hard to follow? by wfmcwalter · · Score: 2, Insightful
      > and probably most RISCs, too

      Well, I can mostly only speak for MIPS assembly, but that's very far from the hideous gothic nastiness of x86 - it's just like an 8-bit micro (esp Z80) just with bigger registers and more of 'em.

      Some details (it's been a while) that I can remember are:

      • No "special" registers - they're all stored as offboard registers on one of a number of "coprocessors". This is true even for FP registers.
      • Highly symetrical instruction set.
      • Doesn't enforce register conventions - stack-pointer, short-pointer, parameter-pointers and return addr are all just an optional convention, not baked into the chip.

      Once you've gotten used to some of MIPS' ideosyncracies (mandatory data alignment, branch-delay slots, having to reinterpret excepted branches in software) then it's just like the good old 6502 days.

      I have less experience of PPC, SPARC, and ARM, but all are similar - clean feeling, but each with a few wacky RISC wrinkles.

      Death to x86

      --
      ## W.Finlay McWalter ## http://www.mcwalter.org ##
    8. Re:Assembler is hard to follow? by Anonymous Coward · · Score: 0
      Lance Leventhal kicks Kip's Ass! Although all his classic books are out of print these days.

      All these assembler languages are pretty much the same once you understand the basic concepts. You just get more registers, addressing modes, mul/div instructions and more memory as things progress. Starting today it's probably overwhelming, but back in the day when you only had a few K, assembler was much more important. These days with high level languages and multiple megas of code, assembler is out of place. There are occasions when it makes sense (critical loops of encryption or video decoding), and its good to see WTF the complier thought it was doing while debuging code.

      Started with 6502, Z80, 68K, X86.

    9. Re:Assembler is hard to follow? by volsung · · Score: 1

      You'd just have non-functional, impossible to debug (or maintain) shite instead.

    10. Re:Assembler is hard to follow? by Mr+Z · · Score: 1

      Tell that to the now-defunct WordPerfect Corporation that couldn't make the jump to Windows cleanly because of the mandatory "everything in assembly language for speed and size" coding rules there.

      And I say this as a former die-hard WordPerfect 5.1 user.

      High-level language has its place, and when coded well, can perform as well as you need it to.

      --Joe
    11. Re:Assembler is hard to follow? by qurob · · Score: 1

      Office is like 50 million lines of C/C++/VB

      That's like 3 katrillion lines of ASM

    12. Re:Assembler is hard to follow? by Tackhead · · Score: 3, Funny
      > Nah, it's just x86 assembly (and probably most RISCs, too...). X86 assembly is baroque.

      Calling X86 assembly "baroque" is like calling the Grand Canyon a "ditch".

      > Disclaimer: I learned x86 long before I learned 68K or Z8K.

      Disclaimer: I'm an old 6502 and 6809 dog.

    13. Re:Assembler is hard to follow? by Anonymous Coward · · Score: 0

      You have no fucking idea what you're talking about.

      Please shut the fuck up.

    14. Re:Assembler is hard to follow? by sv0f · · Score: 2

      Calling X86 assembly "baroque" is like calling the Grand Canyon a "ditch".

      Okay, how about "rococo"?

    15. Re:Assembler is hard to follow? by DarkSeedEmperor · · Score: 1

      I've been working with a R3000A now, and I have to say that the total 32-bit architecture is very easy to use and understand. When I took my assembly course that used this book, I wished we were using that language, because it seems so much more logical to use, at least to me anyway :P

      Intel's 16/24/32 bit compilation architecture (or whatever you want to call it) just seems so jumbled. Granted always using 32 bit registers does have its downsides, but it makes programming so much easier. Now for the R4000 series.... :)

    16. Re:Assembler is hard to follow? by scrytch · · Score: 2

      Okay, how about "rococo"?

      My votes are for "elephantine", "bletcherous", "monstrosity", and best of all, "bogus".

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    17. Re:Assembler is hard to follow? by zapfie · · Score: 1

      WordPerfect is still around, and great as ever. Check it here. Dunno if the link works, its kinda funky.

      --
      slashdot!=valid HTML
    18. Re:Assembler is hard to follow? by Anonymous Coward · · Score: 0


      "Microsoftesque"?

      Sorry if I offended anyone for using such foul language.

  2. Ahh...memories by NPE · · Score: 4, Insightful

    I used this book (3rd ed I think) two years ago in my Organization and Architecture class, and I liked it. The book was an easy, quick read, which is a major deciding factor when you have 3 reading assignments a day. The author uses examples that actually show in code the concepts he's writing about, and the examples are short, to the point, and easy to understand. Assembly language is a rough language when you first pick it up, but I think this book helped me along rather nicely.

    --
    ~NullPointerException
    1. Re:Ahh...memories by Anonymous Coward · · Score: 0

      I did, too. I think 3rd edition, might have been second. I actually still use the instruction listing in the back every once in a while when I need a refresher on once of the instructions!

  3. PPC Assembly by beswicks · · Score: 1

    Can anyone recommend a good book for learning 32bit PPC assember?

    1. Re:PPC Assembly by mekkab · · Score: 2

      compiling with the -a (or -s) option to produce assy code. Especially wicked in combination with the -o optimization option!

      our compiler has an affinity for the RLINM (rotate left AND mask) where it rotates for ZERO and masks with xFFFFFFFF. I guess simply storing a number into gpr23 wasn't fancy enough.

      Also, IBM has some assy manuals for AIX. I use a 32 bit POWER architecture (as one could glean from the hex number above), but I think they have the PPC ones online (came in handy with my powermac at home)
      also a quickie link: right here

      --
      In the future, I would want to not be isolated from my friends in the Space Station.
    2. Re:PPC Assembly by Tomy · · Score: 2, Informative

      Not a book, but a good intro at Developerworks: PowerPC assembly

    3. Re:PPC Assembly by Da+VinMan · · Score: 2

      That would seem to leave something to be desired in the way of a tutorial. ;+) Unless of course, the assembler is capable of adding intelligent commentary. Hmmph...

      --
      Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
    4. Re:PPC Assembly by mekkab · · Score: 2

      The closest thing you get to intelligent commentary is "line numbers" where these 20 lines of assy are related to this one line of C or ADA or whatever.

      Comnbine that with the manual that says what the hack an rlinm is, and you have enough to shed a LEEETLE bit of light. Not enough to make it easy, but enough to help the dogged developer/problem determinator.

      --
      In the future, I would want to not be isolated from my friends in the Space Station.
    5. Re:PPC Assembly by YeahIThoughtSo · · Score: 2, Informative

      Try the user manuals found here:

      http://www-3.ibm.com/chips/techlib/techlib.nsf/p ro ducts/PowerPC_750CX_and_750CXe_Microprocessor

    6. Re:PPC Assembly by Anonymous Coward · · Score: 0

      I noticed from your link to the IBM pages, that they always write hexadecimal numbers like this:

      $0x80

      Isn't the dollar sign a substitute for 0x ? Why use both?

    7. Re:PPC Assembly by mekkab · · Score: 2

      without having actually checked the page myself (in TRUE slashdot style) I assume they use the dollar sign to signify that this is a literal, and the 0x to signify that this is a hex literal- not a char, not base 10.

      Shit, we're using hex numbers on slashdot. Where's that annoying guy who always complains about people not using hex on slashdot? This would make him proud!

      --
      In the future, I would want to not be isolated from my friends in the Space Station.
  4. Sounds like the whole PC/Win world in a nutshell by Anonymous Coward · · Score: 0

    There were, though, some mistakes in the third edition of the book that would make an instructor pull his hair to pieces. Typos, grammatical errors and words that did not get picked up by the spellchecker were acceptable, but when the sequence of operations during code execution was described incorrectly, you can hardly be accused of being too picky, since you get students relying on the book for knowledge and being mad at you for flagging their code wrong on the test.

    Yup, sounds like the utter crap that is the usual fare in the microcomputer world. Piss poor processors, operating systems, applications and manuals. And to think this junk replaced mainframes.

  5. ebay half.com has it for lots less $ by Dang1ingPtr · · Score: 2, Informative

    http://half.ebay.com/search/search.jsp?nthTime=2&p roduct=books&query=Assembly+Language

  6. Yet another assembly book outdated at release by ehiris · · Score: 4, Informative

    I don't see any mention of IA-64 or Unix/Linux ...

    If you are looking for a assembly book that is fun to read and goes into Linux details try: "Assembly Language Step by Step"

    1. Re:Yet another assembly book outdated at release by Anonymous Coward · · Score: 0

      It's a text book, what do you expect? Any college still teaching x86 assembly is probably expecting you to get to some kind of DOS command prompt anyway. Nobody uses assembly language anyway when there's perl!!! :-)

    2. Re:Yet another assembly book outdated at release by Rasta+Prefect · · Score: 2
      I don't see any mention of IA-64 or Unix/Linux ...

      Introductory assembly is often taught in DOS because the examples tend to be quite simple. As for IA-64, it really doesn't belong in this book - the book is for teaching x86 assembly. If you're going to include IA-64, you may as well include Sparc or Alpha as well. Besides which there is really no reason to program an IA-64 in assembly. The compiler is going to beat you every time.

      --
      Why?
    3. Re:Yet another assembly book outdated at release by baby_head_rush · · Score: 1

      The word Linux does appeare in the book. On page 6 there's a discussion on why learn assembly language.
      One of Irvine's bullet points is about creating device drivers.
      Here's a snippet... Printer manufacturers, for example, create a different MS-Windows device driver for each model they sell. The same is true for Mac OS, Linux, and other operating systems.
      At Cleveland State this year we had to buy this book and another (can't remeber the name it's used the second half of the semester) for the Lanugage Processor class.
      If you want IA-64 info go to Intel's site for the white papers. :)

      --
      Oliver's army is here to stay Oliver's army are on their way And I would rather be anywhere else But here today
    4. Re:Yet another assembly book outdated at release by ehiris · · Score: 0, Troll

      Who is so retarded to give me a -1 Troll for this?

      You know what? GO BUY THE BOOK. I tried to read the old edition of the one mentioned here and it was so hard to follow that I am delighted to picture you read it.

      Fuck yourself while you're at it!

    5. Re:Yet another assembly book outdated at release by Anonymous Coward · · Score: 0

      I'm afraid that the IA-64 compilers are a long way
      from beating people are producing the tightest code.
      This is particularly true for integer apps, where the compiler is particularly weak. In fairness to the Intel/HP
      compiler teams, the compilers use the most recent
      advances in compiler technology and still suck.
      For a variety of reasons, I think its fairly unlikely that
      the compilers will drastically improve for integer apps.
      (Basically due to the inability of the compiler to extract
      ILP from most code, due to necessary conservative treatment of the code and the inherent lack of ILP in
      some apps. Feedback directed optimization is your friend if you really care. Preferably whole-program static compilation!)

    6. Re:Yet another assembly book outdated at release by WndrBr3d · · Score: 3, Informative

      I've read this book as well as the 'Assembly Language for Intel Based Computers', and honestly, the book "Assembly Language Step by Step" has to be one of the worst written books on programming in GENERAL I've ever seen.

      The initial topics jump all around from memory managment to how the BIOS works. It's insane. They'll seriously spend three chapters on actual memory addressing, but only use one to explain interupts.

      I think it's a book Linux users just want to have, so they feel that they wern't left out. Again, "Assembly Language Step by Step" is an awful book and should be avoided at ALL costs (unless you enjoy an enigma).

    7. Re:Yet another assembly book outdated at release by eviltypeguy · · Score: 1

      I completely and emphatically disagree with you. For me, Assembly Language step by step was an absolute godsend. It was clear, concise, and didn't leave me confused as to what was actually going on. If you read the book chronologically, you'll see that it doesn't "jump around" as you describe it.

      Duntemann's book was the first assembly language book ever that wasn't so dry and painful to read that I simply just gave up trying. I'm sorry you didn't care for it, but instead of being overly negative why not come up with some cunstructive criticism and tell Mr. Duntemann about it so that your concerns can be addressed in a later edition.

      The first half of the book covers DOS based systems anyway, the last half or so covers some Linux assembly programming as well.

    8. Re:Yet another assembly book outdated at release by Enry · · Score: 2
    9. Re:Yet another assembly book outdated at release by Jeff+Duntemann · · Score: 2, Interesting

      Sorry it didn't float your boat. People seem to either love my book or hate it, but it's been in print for 13 years and my mail pile seems to think it succeeds for way more people than it fails.

      A lot of people forget that this book has a gimmick: It's assembly for people who have never programmed before and know *nothing* about programming with *any* language. My experience tells me that people who learn the underlying machine before they get too caught up in data structures do better when they have to battle two hundred diverse APIs in the same project, which is the way things have gone in Windows and are headed in Linux.

      People who know something about programming and about the fundamental nature of computing should skip the first couple of chapters.

      The next time I rewrite it (and that's going to be awhile still, maybe another year) I'm dropping DOS entirely, and will rewrite it for Linux from one end to the other. I will also teach people how to make kernel calls and not apologize for it. If all you do with assembly is call clib, you might as well use gcc. Assembly really is its own language, with its own culture and assumptions and ways of going about things. It is *not* C, and thank God for that much.

      I may also drop the foobies thing in the next edition. The mail's been mixed on that--though I'm still trying to think of a good way to teach hex to those for whom number bases other than 10 are a serious mental roadblock.

      Thanks, by the way, for the mention here on Slashdot. The book's been around for quite a few years and doesn't get much press anymore, even though it continues to sell well.

      --73--

      --Jeff Duntemann
      Scottsdale, Arizona
      (jeff at duntemann dot com)

    10. Re:Yet another assembly book outdated at release by rjh · · Score: 2

      Jeff--

      Hate to be the bearer of bad news, but the book didn't work for me, either. But that's okay; you still get props in my book for writing the text that helped wrap my head around Pascal way back when. There, I'm done being a fanboy; the rest of this is all for Slashdotters without a clue.

      Clue: when all is said and done, it doesn't matter if one particular book helped you or didn't help you. It doesn't matter if one particular kernel patch lets you use your FooBarBaz card, or if it just sets your mobo on fire.

      What matters is what you do about it. If you read a great book on Assembly and then sit on your ass and don't do anything with that knowledge, then you might as well have not read the book in the first place. If you read a lousy book on Assembly and decide "dammit, there needs to be a better book," and then write that better book, then congratulations: you matter.

      It's easy to say that the fellow who's actually doing the job could, should, be doing it better. (Hell, that sounds pretty much like John C. Dvorak's job description.) But it's a much harder thing, and better thing, to actually do the thing.

      Like the old saw goes: shut up and code.

    11. Re:Yet another assembly book outdated at release by TheFlamingoKing · · Score: 1
      Um, thanks for that uninformed comment. I know, at least at my college (UNT) Assembly is a mandatory class for all Computer Science majors. As is ELET 2720, Digital Logic. IMHO, learning this stuff is important, at least important enough for them to have me take the class. I'm taking both of those classes right now. We're using the 4th edition of Irvine's book. It's like saying computer scientists shouldn't need to learn discrete math.

      Oh, and we use DOS prompts too! Amazing!

  7. advanced topics? by oliverthered · · Score: 2, Interesting

    Unless you doing task switching MMX etc... then there's nothing that advanced in FP specificly.

    Things like real-mode and protected mode programming would have been far nicer to see,
    Advanced topics should be Ring(0-4), Virtual Memory and paging, PCI address space mapping and APIC.

    --
    thank God the internet isn't a human right.
  8. I learned ASM from... by qurob · · Score: 1


    The old texts and demo tutes.

    And 'tute' isn't something you do with your horn.

  9. Description of the FAT by FreshMeat-BWG · · Score: 2, Interesting

    I used this book in college for learning assembly. Still have it on the shelf. I was doing some work on FAT and partition tables recently and was able to quickly get the information I needed from this book. It wasn't in depth, but I didn't read more than two pages before I was on my way. Wish it was that easy back in the college days!

  10. Umm... by Anonymous Coward · · Score: 0

    What you describe is not "a love-hate relationship." It is a set consisting of love relationships and hate relationships. "Love-hate relationship" means you despise the thing in general but it has some killer feature that you can't live without, or you like the general idea but there is some fundamental flaw. Or that you love to hate it or hate to love it. The only thing worse than using cliches is mis-using them.

  11. Re:Windows by stratjakt · · Score: 1

    Pathetic linux troll.

    the x86 command set doesn't magically change just because you installed linux. There's no such thing as 'OS specific' assembler.

    It's just that DOS/Windows makes good use of assembly, and being an x86 platform, is of much more use.

    Linux isn't solely an x86 platform, so assembly is of much less use (if any at all) when you want your code to compile on a mac/ARM/MIPS etc;

    Bah, why bother

    --
    I don't need no instructions to know how to rock!!!!
  12. Art of Assembly Language Programming by Anonymous Coward · · Score: 0

    Here's an excellent free reference - worldly reputation as one of the best from what I hear.

  13. I still have the Z80... by Anonymous Coward · · Score: 0

    I checked out The Z80 Cookbook by Barden back in 1978.

    It will be 24 years overdue in October.

    Think they have missed it by now?

    I like assembly, it's fast!

  14. IA-64 by Anonymous Coward · · Score: 0

    IA-64 isn't supposed to be a language useable by mortal men.
    It would have been nice to see some x86-64 in there though.

  15. I didn't read it either by jsonmez · · Score: 1

    I would lie to you if I told you that I've read the whole book.


    Hmm...

  16. Re:Windows by sqlrob · · Score: 2, Offtopic

    the x86 command set doesn't magically change just because you installed linux. There's no such thing as 'OS specific' assembler.

    So, int 21 does what on linux? What about int 2e on DOS or Linux?

  17. hmmm by alexander+m · · Score: 1

    from my own, brief, experience with assembly language, i was under the impression that its role as an instructional aid largely consisted of the following:
    "don't do that again , or i'll hit you with this book a second time...!"
  18. If only it could all be like 6502 assembly by fishlet · · Score: 1

    Ah... I loved programming my Commodore 128. Assembly was the only way to go. I don't see the point though learning on a x86, at least for application programmers.

    -History shows again and again... how nature points out the folly of man- GODZILLA!

    1. Re:If only it could all be like 6502 assembly by Anonymous Coward · · Score: 0
      That was a joke, right?


      6502 has so many limits compared to even the oldest x86 chip, the limited number of registers, and the limit of only doing indirect addressing to ONE 256byte page of memory which made self modifying code required for many somple tasks. You even had to do mult in software! We all hate the old real mode segmented memory, but doing asm on the x86 is way easier than on the old 6502!

    2. Re:If only it could all be like 6502 assembly by larry+bagina · · Score: 1
      I agree. the 8086 binstruction set is poorly designed, but it's miles head of the 6502. 6502 is 8 bit with 1 accumulator and 2 index registers, and 256 byte stack. 8086 has 4 "general purpose" (sort of) 16 bit registers tha can be treated as 8 8-bit registers, plus a few more limited purpose registers (bp, etc). Every 6502 instruction has an equivalent, more powerful 8086 instruction. And then some!

      6502 beats 8086 for simplicity though. And teh fact that it took 4 cycles for the 8086 to fetch memory and 1 cycle for the 6502 made the 6502 effectively faster in a mhz/mhz comparison.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

  19. Re:Windows by oliverthered · · Score: 1

    I whould disagree, your trolling.

    Sticking with DOS and then using DPMI for protect mode-32bit programming would have been a good idea, DOS is nice and raw and so doesn't distract from what you are doing.
    Using Windows (or Linux) just distracts from the goal of the book, teaching assembler.

    I susspect the books is only a best seller bercause it's on the required-reading list for some CS courses.

    --
    thank God the internet isn't a human right.
  20. A lost art, alas by Reality+Master+101 · · Score: 5, Insightful

    Z80 assembly language was the second language I learned (after BASIC, of course). I'm convinced that learning assembly language was key to making me the (humbly) great programmer I am today.

    I've ranted about this before, but I have to say it again: Programming is taught ass-backwards in college. Assembly language should be the FIRST thing taught, and then gradually building up to higher and higher levels of abstraction. All algorithm theory should be taught in assembly. When you've implemented algorithms in assembly, then there's no question that you know them far better than when they're surrounded by 7 layers of syntactical fluff.

    Look at the way EE's are taught: You start with the basics of transisters, resisters, capicitors, etc and work your way up. If EEs were taught the same way as programmers, they would start with plugging cards into PCs with component theory being taught as an afterthought!

    In my experience, I've often found that EEs converted into programmers are better programmers than people with CS degrees, and I think this is the reason. EEs are taught how to think early on at the component level.

    I should also say that it's a total myth that assembly language is "hard". It's not. It's simply "more". More detail, more instructions, more attention to what you're doing. Assembly itself is extremely simple. Get an instruction; execute it; move to next.

    Bottom line: TWO years of assembly before a student even sniffs high-level languages.

    I keep ranting about this, but I doubt that CS programs are going to change. I can always dream, though.

    --
    Sometimes it's best to just let stupid people be stupid.
    1. Re:A lost art, alas by Your_Mom · · Score: 3, Interesting

      Amen! I am glad (and relieved) that someone other then myself feels that way. I learned x86 assembly about a year ago during my junior year, its fantastic, I really got a grasp on what goes inside the processor, which, sadly, a lot of CS/CE students don't have. I think that it allows me to write faster code in my C programs by keeping in mind how it translated down to ASM.

      Its aslo handy to know for embedded systems.

      Also, I used Kip's book and I fall into the 'cool book' catagory

      --
      Objects in the blog are closer then they ap
    2. Re:A lost art, alas by Winterblink · · Score: 1
      I hear what you're saying, and part of my agrees wholeheartedly. I learned assembler first in school before moving up to higher level languages. However, in this day and age is there really a need for people to learn it? I mean it gives them a far better understanding of what their computer's actually doing, but people don't want to bother learning the low level stuff that they'll never directly work with. It's easier and cheaper to jump to learn to the high level languages like C, VB, Java, and whatnot.

      Another perspective on that is if I were just starting schooling now, do I want to waste a year learning archaic languages? In this industry a year is a LONG time to be sitting around not learning what will get you jobs.

      Just my 2c. :P

      --
      "I'm a leaf on the wind. Watch how I soar."
      -Hoban Washburn
    3. Re:A lost art, alas by Hard_Code · · Score: 3, Insightful

      "All algorithm theory should be taught in assembly."

      I'd argue that if your goal is to understand the concepts of an algorithm, using the dirtiest, lowest-level approach is the wrong way. You don't see the forest for the trees. Once you learn the concepts, you can apply them anywhere. That's not to say assembly isn't valuable. In fact, I think it is necessary for really understanding computers and programming well. But I think it is a hindrance when trying to learn higher level concepts. Assembly goes nicely with a CPU or compiler design course, but otherwise I think it is the wrong place to start to teach higher concepts. After all, high school physics doesn't start with the lowest level details of quantum mechanics and quarks and exotic matter. No, it starts with the "naive" and simple classic Newtonian mechanics.

      --

      It's 10 PM. Do you know if you're un-American?
    4. Re:A lost art, alas by jpt.d · · Score: 2

      The college I went to (note: college is supposted to be practical, whereas university is supposted to be higher level theory - at least in Canada, they aren't the same here) has a 'CPA' program designed so that people could be taken off the street. Some of those students had trouble picking up Java and VB. Most of them got it after a while.

      I would not want to see what would happen if you taught them assembly first. I have seen one college in Ontario, Canada that teaches assembly in their CMP program in the last semester.

      --
      What we see depends on mainly what we look for. -- John Lubbock Now search for that bug slave!
    5. Re:A lost art, alas by vsync64 · · Score: 1
      However, in this day and age is there really a need for people to learn it?

      If they want to be anything above mediocre, I believe so.

      I mean it gives them a far better understanding of what their computer's actually doing, but people don't want to bother learning the low level stuff that they'll never directly work with. It's easier and cheaper to jump to learn to the high level languages like C, VB, Java, and whatnot.

      Of course, but just because it's easier and cheaper doesn't obviate the need for a deep and fundamental understanding of the way computers actually work. Like it or not, every programming language is a fancy assembly language with some more abstraction layered on top, and regardless of how much "background information" is given in the class, it's going to make much more sense if the student actually works in some assembly language for a little while. It doesn't matter which, and the student doesn't have to become an expert, but how else to explain, for example, that certain operations will be more costly than others, without knowing what an opcode is?

      I'd like to take issue with several of your comments, by the way. I don't think it's "easier" by any means to skip learning some assembly. My current programming experience is continually enriched by what I learned from my real-mode x86 days, and I'm sure if I took the time to learn modern protected-mode techniques I'd be able to understand some of the Linux error messages and such a little better. The more you know as background information, the less time it should take to figure out a particular solution, and if time is money, it's certainly not "cheaper" to skip it either.

      C isn't "high level", either. It's a portable assembly language.

      --
      TO BUY A NEW CAR WOULD MAKE YOU SEXUALLY ATTRACTIVE.
    6. Re:A lost art, alas by Anonymous Coward · · Score: 1

      EEs become better programmers than those who start out as programmers because of that second 'E' in "EE": Engineer. It's a whole way of thinking that can't be self-taught with a VIC-20 and a BASIC manual.

      Unfortunately your reasoning about assembly is wrong. Voltage, current, resistance, inductance etc. are principles that apply to everything an EE is going to do and they must be known before doing the high level stuff. Algorithms are the corresponding general principles of computer science and are best represented in high level languages. Having to think about whether a register is 4 or 8 or 16 or 20 or 32 bits is just a waste of time in that case and basing implementations on that knowledge is asking for trouble. That's why C is often called portable... (unless you're a nutcase named Scott Nudds, but I digress).

      Anonymous, because I'm sure there are moderators out there that resent not being real engineers.

    7. Re:A lost art, alas by Mr+Z · · Score: 1
      Another perspective on that is if I were just starting schooling now, do I want to waste a year learning archaic languages? In this industry a year is a LONG time to be sitting around not learning what will get you jobs.

      Are you at a college or a vo-tech school? If you learn the principles of programming, then the language doesn't matter so much after awhile. You need to learn different programming paradigms, but once you do, then the specifics of syntax aren't as big a deal.

      At a vo-tech type of school, you're there to pick up specific skills to allow you to target a narrow range of jobs. At a college, you're there to pick up general skill sets and ways of thinking about problems that can be adapted to many jobs.

      I consider understanding assembly language to be one of the basic fundamental concepts that helps unify all the abstractions we heap on top of it. If programming languages always just seem like magic to you, you'll never truly understand what you're doing. Good luck generalizing what you learn if you don't know what your code looks like on a couple different levels of abstraction.

      --Joe
    8. Re:A lost art, alas by sydb · · Score: 3, Interesting

      hmmm, I don't know.

      I agree that good programmers and engineers should understand assembly, if only because that means really understanding how a computer works.

      However, I don't think it has to be the first thing they learn

      Look at the way EE's are taught: You start with the basics of transisters, resisters, capicitors, etc and work your way up. If EEs were taught the same way as programmers, they would start with plugging cards into PCs with component theory being taught as an afterthought!

      But no! Plugging cards into PCs isn't electronics, it's technician work. I think you know this anyway, but your analogy is wrong. If EEs were taught the same way as programmers, they would learn about amplifiers, oscillators, tuned circuits, logic gates, flip flops, etc.

      Teaching assembly to programmers is more like teaching physics to electronic engineers. Most of them won't need to know it.

      In fact the thing that destroyed my career in digital electronics was being forced to attend classes on the mathematics of three phase circuits. There are some things people should not have to experience.

      But I agree, someone who claims to understand computers without at least being aware of the types of processes which go on at microprocessor level is a liar, and any self-respecting programmer or engineer should make it their business to have some knowledge.

      --
      Yours Sincerely, Michael.
    9. Re:A lost art, alas by Anonymous Coward · · Score: 1
      Couldn't agree more.

      I'm an EE who spend most of my time coding in C (used to do 6502, Z80, 68K and X86). I did really well at CS at secondary school (11-16), but concluded that that taking it any further was a waste of time. There were a lot of people taking CS at higher levels that really shouldn't have been there. I took Electrical/Electronic Engineering because it was more challenging, though I think my life would have been easier if taken CS instead.

      At the end of the day you have to have an aptitude to work in this field, some people just don't have it.

    10. Re:A lost art, alas by Anonymous+Canard · · Score: 3, Interesting
      I've ranted about this before, but I have to say it again: Programming is taught ass-backwards in college. Assembly language should be the FIRST thing taught, and then gradually building up to higher and higher levels of abstraction. All algorithm theory should be taught in assembly. When you've implemented algorithms in assembly, then there's no question that you know them far better than when they're surrounded by 7 layers of syntactical fluff.

      I remember my first job out of college I wrote a little preemptive multitasking kernel in 286 assembly for MSDOS that I used to write a multithreaded spacecraft simulator with one thread dedicated each to I/O, electrical subsystem, state vector propagator, and telemetry. While assembly was a rite of passage for those of us who studied computers in the 70's and 80's, you no more need to learn assembly now than you have to learn set theory and understand the axioms underlying mathematics in order to understand how addition works.

      People learn quickly if the things that they are learning are useful to them, and at the level of abstraction that people need to use a computer these days I would rather point them toward Java, Visual Basic, or even HTML as a first programming language (of course since HTML is declarative you would want to use a corresponding DHTML language such as PHP, JSP, or ASP to round out the imperative elements of the course.) But starting with assembly would just bore students to tears; they would drop out simply because they weren't learning anything of any relevance to their actual use of computers.

      Assembly, like compiler construction and operating systems design, should be reserved for those who get some utility from the knowlege, or are planning on extending the field.

      --

      --
      BitTorrent in C -- LibBT
      http://www.sf.net/projects/libbt
    11. Re:A lost art, alas by jandrese · · Score: 5, Interesting
      Opinon on this is going to vary wildly, but I've seen two major schools of thought on this topic:
      • Computer Scientist standpoint: This says that you should never need to know about the hardware. You should be programming in sufficently high level languages like Lisp that keep you from knowing anything about the underlying architecture. Knowing about the architecture leads you to programming FOR that architecture, which is the first step towards unportable code. Also, most pure computer scientists are more interested in proving that their solution is correct that actaully solving the problem. These people often give lip service to the importance of knowing the architecture while simultaniously designing languages that no computer will ever be able to run and that nobody would ever ever want to program in (anybody have a spare Turing machine handy? Mine ran out of infinate paper tape.)
      • C Programmers point of view: This places the high level language as more of a glue between the programmer and the machine. You try to do things in ways that are optimal for the machine so your programs run fast, while still trying to be at least somewhat portable. (and hey, if you get it wrong, there's always #IFDEF right?). Most professional programmers seem to fall in this category, as it involves getting much more work done with fewer inductive proofs.
      I know I'm going to be flamed about the Lisp crack, but you have to admit, Lisp programs are portable.
      --

      I read the internet for the articles.
    12. Re:A lost art, alas by Winterblink · · Score: 1
      I'd like to take issue with several of your comments, by the way. I don't think it's "easier" by any means to skip learning some assembly. My current programming experience is continually enriched by what I learned from my real-mode x86 days, and I'm sure if I took the time to learn modern protected-mode techniques I'd be able to understand some of the Linux error messages and such a little better. The more you know as background information, the less time it should take to figure out a particular solution, and if time is money, it's certainly not "cheaper" to skip it either.

      Take issues with my comments all you like, after all that's why I posted them. :) Jesus, don't play the devil's advocate on this site, people jump on you!

      At any rate, I myself learned assembly first and went on to learn other languages. And I definitely agree with you in that "assembly thinking" helps me all the time in my job as a programmer. What I was referring to when I said "cheaper" was the actual learning of the language, not the application (or lack) of it at a later date.

      C isn't "high level", either. It's a portable assembly language

      I was speaking comparatively.

      --
      "I'm a leaf on the wind. Watch how I soar."
      -Hoban Washburn
    13. Re:A lost art, alas by Winterblink · · Score: 1
      Are you at a college or a vo-tech school?

      Does this have any bearing on what I was commenting on? No. I was simply listing perspectives.

      --
      "I'm a leaf on the wind. Watch how I soar."
      -Hoban Washburn
    14. Re:A lost art, alas by hardburn · · Score: 1

      I would not want to see what would happen if you taught them assembly first. I have seen one college in Ontario, Canada that teaches assembly in their CMP program in the last semester.

      I'd love to see that. Call it "thinning the hurd".

      --
      Not a typewriter
    15. Re:A lost art, alas by BluedemonX · · Score: 2

      I'm in TOTAL agreement.

      The only reason I've ever held my head above water in the programming sphere is because my first languages were BASIC and Assembly.

      Actually, it's interesting, but the BASIC language is similar to assembly, in a way, inasmuch as it is a list of instructions to be executed in order. If you want to arse around from one section of the program to the other, you yourself have to goto and figure out how to get the hell back (well, you have gosub, but you get the idea). From that background, assembly was a dead cinch.

      I actually wish I'd learned more and more and more about the absolute fundamentals of computer science - lamenting the fact that my first exposures to computers wasn't to something with punch cards or front panel switches and lights.

      --

      --- Jump!! Fire!! Bullet time!! - Lego version of the Matrix
    16. Re:A lost art, alas by Ian+Bicking · · Score: 2
      Assembly language should be the FIRST thing taught, and then gradually building up to higher and higher levels of abstraction.
      Assembly isn't necessarily the most fundamental level. Sure, it is for one particular computer (in a way -- pure machine code is slightly more fundamental). But you can go lower, if you see it as a mathematical, not electrical, excercise. Maybe the first two years should be taught using Turing Machines, or with the lambda calculus?

      Other people might feel that Forth was a better language -- having just enough abstraction to allow some modularity, but only barely. Nearly all virtual machines look like Forth machines... I suppose that implies that computer scientists disagree with electrical engineers as to how a machine should act.

    17. Re:A lost art, alas by Mr+Z · · Score: 1

      I was clarifying where I think the perspectives themselves originate. One's perspective at a college should be towards getting broad, adaptable skill sets. One's perspective at a vo-tech school should be towards getting an immediate means to an immediate end.

      Students who go into college just looking for "vo-tech on steriods" often don't like where they end up, since what they really get is at most "really expensive vo-tech school."

      (And when I say "vo-tech" I include places like DeVry and ITT Tech and most junior colleges.)

      --Joe
    18. Re:A lost art, alas by kaisyain · · Score: 2

      Did you spend two years learning lambda calculus before you were allowed to program?

      All algorithm theory should be taught in assembly.

      Out of curiosity...what kind of crap school did you go to? We didn't program at all during my algorithm theory class. We did math. That's what algorithms are. Assembly is just a layer of cruft on top of the math.

    19. Re:A lost art, alas by grahammm · · Score: 1

      Yet the classic (but yet unfinished) series on Algorithms (Knuth's The Art of Computer Programming) uses an assembly language to explain the algorithms.

    20. Re:A lost art, alas by jhines0042 · · Score: 2

      Computer Science at my college required both Assemblers and Introduction to Computer Engineering. We had to build a 4 bit computer out of chips and wires on a breadboard and then demonstrate it working to do math operations. Then we had to program it to do operations that were not wired into it.

      Other classes that I took that I would highly recommend to anyone else studying Computer Science. Operating Systems, Compilers, Comparative Languages, Artificial Intelligence.

      Sure, Assembly is tough. It is unforgiving and you know what? It is a good thing to learn the proper way to do things. High level languages make it easy for people to program a computer. They also make it easy to program a computer badly.

      Program a computer badly in assembly and you generally don't get the desired results.

      --
      42 - So long and thanks for all the fish.
    21. Re:A lost art, alas by llzackll · · Score: 1

      If they want to be anything above mediocre, I believe so.

      You need to read Knuth if you want to be anything above mediocre.

    22. Re:A lost art, alas by TummyX · · Score: 1

      All algorithm theory should be taught in assembly.


      That's the silliest thing I've heard today. When learning algorithms, you shouldn't even be worried about what language you're implementing them it (that's of little consequence). You should be more concerned about understanding HOW and WHY the algorithm works. This can be done with good old pen and paper.

      And if any language was better for learning algorithms in it would be something high level and non procedural like HASKELL (NOT something stupidly low level).
      qsort [] = []
      qsort (x:xs) = (qsort left) ++ [x] ++ (qsort right)
      where
      left = filter (<x) x
      right = filter (>x) xs
      See how clearly that defines quicksort?

      It's easier to understand than quicksort written in C, Java and definitely asssembly.

      It basically just says the sorted list (x:xs) is the sorted list consisting of the [sorted list left] ++ x ++ [sorted list right] where left is everything less than x and right is everything greater than x. x is obviously the pivot (and yes i know using the first element as the pivot can be bad - we're talking about understanding here).

      Gee hard.
    23. Re:A lost art, alas by grahammm · · Score: 1

      I think there is a need to know assembly language. Even if you never actually write in assembler, it can be very useful when debugging. To quote one example which happened to a younger colleague of mine.

      He was not getting the results he expected, and on tracing (in the high level language) in the debugger could not understand the program flow. A function was returning 0 (the debugger showed the return variable as being 0) but the path the calling function took was that where the function returned non-zero. When he asked for my assistance, I 'clicked' on the "display assembly" button, displayed the registers and immediately saw the problem. The called function was setting the return code in 8 bits of the register, but (because he had made the prototype visible to the calling module) the calling function was testing the full 32its of the register (and thus finding a non-zero value). Had he known assembly code, he would have stood more chance of finding the problem himself.

    24. Re:A lost art, alas by Anonymous Coward · · Score: 0

      Yes but Knuth uses a model that doesn't really get in the way of his explanations. And you could argue that Knuth isn't entirely about algorithms, whereas "Introduction to Algoithms" (Cormen, Leiserson & Rivest) uses pseudocode and does a fine job with it.
      Personally I think Knuth made the book less acessible by inventing MIX... I can see why it appealed to him but I think he let his sense of fun get in the way of a great idea.

    25. Re:A lost art, alas by Alan · · Score: 2

      I don't know if I can vouch for everything being taught in ASM for the first while, but I can definately attest to the fact that learning assembler was a huge boost for me.

      When I entered my university I took an advanced pascal class (still a 100 level course, first year) which introduced us to dynamic memory allocation, strings, dereferenceing, etc. I was lost. I spent half the time throwing the dereference character (^ IIRC) in front of variables just to see if it worked... I think I came out of there with a C or C+ (maybe a C-).

      The next semester we took assembly programming, and wow, everything suddenly made sense! Understanding exactly *what* a pointer is, and how it and dereferencing really works was a huge boost to my understanding of programming, and computers in general. It could be that the advanced pascal teacher didn't do a good job, or that I was just a slacker that year, but ASM gives a huge boost to the understanding of how computers work.

    26. Re:A lost art, alas by Your_Mom · · Score: 1

      I hate PASCAL, I took a course in HS and the teacher was horrific: Teaching us functions but never teaching them correctly (passing variables? whatzat?), a very scrict comment policy (each line had to descibe what each variable did, every time it was used.), among other things. Then I took a simple C course and everything made sense.

      I never liked PASCAL and I never will. *shudder*

      --
      Objects in the blog are closer then they ap
    27. Re:A lost art, alas by Dogtanian · · Score: 1

      You need to read Knuth if you want to be anything above mediocre.

      I read the first volume of Knuth, understood a good proportion of it, did most of the exercises, and I'm still so mediocre it hurts.
      Of course, you never actually said reading Knuth would make you above mediocre, only that you couldn't get there without reading it. :-)

      Actually, good book IMHO, but it wasn't what I should have been reading at the time.

      --
      "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
    28. Re:A lost art, alas by cicatrix1 · · Score: 1

      That's funny, since it was designed as a teaching language.

      --

      I know more than you drink.
    29. Re:A lost art, alas by Anonymous Coward · · Score: 0

      One of the best things Knuth ever did was to proclaim Linux as his "operating system of choice". Most hard core followers of Knuth have converted to Linux and never looked back. Kudos to the Donald! He has the guts. He has the vision.

    30. Re:A lost art, alas by Alan · · Score: 2

      Sounds like it was the teacher that killed it, not the language. Commenting every line/variable is just plain stupid. You comment why you did something, not what you did... anyone who can code can see what you did, the question they'll ask is "why did he do this here?"

    31. Re:A lost art, alas by Winterblink · · Score: 1
      Students who go into college just looking for "vo-tech on steriods" often don't like where they end up, since what they really get is at most "really expensive vo-tech school."

      (And when I say "vo-tech" I include places like DeVry and ITT Tech and most junior colleges.)

      Oddly, many employers prefer these kinds of students to ones trained in universities, at least in my area. From talking to some, it stems from experience of these people having not enough practical coding experience or knowledge, or those things in areas that don't fit a common need.

      --
      "I'm a leaf on the wind. Watch how I soar."
      -Hoban Washburn
    32. Re:A lost art, alas by The+Rev · · Score: 2
      I completely agree.

      My history of languages learnt are (roughly):

      1. Spectrum BASIC
      2. Z80 Assembler
      3. 68000 Assembler (on my Sinclair QL)
      4. POP-11
      5. Prolog
      6. Standard ML
      7. Modula-2
      8. C
      9. C++

      Not including shell scripting languages etc.

      I'm now a Senior Software Engineer working almost exclusively in C++ and I feel my varied history of languages learnt has greatly contributed to making me the seasoned professional I now am.

      The finer point I'm trying to make is that I've engineered C/C++ on boxes ranging in size from clusters of 4GB RAM, 8 x 1GHz POWER4 CPU RS6000 AIX machines all the way down to mobile phones and I feel learning a couple of assembly languages was an appropriate and valuable part of my personal development as a Software Engineer.

    33. Re:A lost art, alas by Mr+Z · · Score: 1

      I find that such students tend to reach a plateau in terms of accomplishments fairly quickly. Of course, it all depends on the nature of your job as to whether that really matters.

      <cynic> At the very least, vo-tech kids are cheaper, and will probably want to leave for a different job in a few years, so the labor cost is lower. </cynic>

      --Joe
    34. Re:A lost art, alas by cpeterso · · Score: 1


      let me guess. You're an EE, right?

    35. Re:A lost art, alas by Anonymous Coward · · Score: 0

      EEs become better programmers than those who start out as programmers because of that second 'E' in "EE": Engineer. It's a whole way of thinking that can't be self-taught with a VIC-20 and a BASIC manual.

      Please spare us the elitist "Engineers have the secret to the universe" pap.
      I've heard it far too often. Yes, engineering is a tough discipline, and it does teach good principles. But I've worked with more than one engineer who, despite having all his/her certifications, years of experience, etc. etc. still cranked out the most ugly, unstructured, brittle code I've ever seen. (It's a bit of a sore point with me; I've had to maintain some pretty bad code in the past -- and thise code was for big metal presses and other industrial machinery; not the best place to have crappy code).

      However, I agree with what you imply -- pseudo-code, high-level descriptions of algorithms are what people really should be taught. Then, teaching them to translate that into assembly language would be a great learning experience.

      It isn't what university program you've been in, it's whether you apply and understand the principles of structured (or OO, or whatever school you think builds good code) programming correctly.

      I have also met some engineers who code beautiful stuff, and CS grads who can't code to save their lives. So please don't take offense, all you engineer-coders.

    36. Re:A lost art, alas by ralphbecket · · Score: 1

      You've got this so wrong it's hard to know where to start.

      Perhaps with an analogy: we should teach physics by starting with quantum mechanics and then climb the abstraction tree until people can understand Newtownian mechanics. Hmm, maybe not.

      Assembly language should be taught to communicate a genuine understanding of how a processor works and how the very lowest levels of an OS interact with the hardware. Beyond that, there's not much use for it on a CS course.

      Why on Earth you think algorithms are best understood by implementing them in the least abstract, hardest-to-debug language possible is utterly beyond me. About the only thing you might glean from such an undertaking would be an understanding of the huge amount of bookkeeping that goes on behind the scenes. You wouldn't even learn anything particularly useful about the cache performance of your code that you couldn't learn from a suitably (i.e. automatically) instrumented binary generated from an higher level language.

      The point of algorithms is that they *are* independent of the underlying language (you did study big-O notation, I take it?), so they should be taught using languages that require the minimum amount of algorithm-irrelevant cruft in order to express the idea. Good grief, would you seriously expect anyone to implement 234-trees or binomial heaps in raw assembler?

      Bottom line: if you don't understand *abstraction* then you're going to be a lousy programmer.

      I keep ranting about this, but I doubt CS programs are going to change.

    37. Re:A lost art, alas by scrytch · · Score: 2

      All algorithm theory should be taught in assembly.

      I'm sooooo tempted to believe I've just been trolled, but what the hey. First off, algorithmic theory is typically taught in terms of turing machines -- if that's not low-level enough for you, I don't know what is. Beyond that though, you're absolutely wrong. It's like teaching the physics concepts of torque by making students work on cars.

      Look at the way EE's are taught

      Not relevant. This is not EE. You might have had a point with respect to software engineering (and I'm not even sure then). Dijkstra 's rolling in his grave, though he was certainly fretting about this awful conflation of CSC with engineering long before then.

      In my experience, I've often found that EEs converted into programmers are better programmers than people with CS degrees, and I think this is the reason. EEs are taught how to think early on at the component level.

      One reason is that most EE degree programs are hard. People who finish an EE degree are often just plain more determined and better problem solvers as a result, because the CS curriculum is just not made challenging enough -- partly because it's still such a new field.

      Look, you want a better office suite or HRIS system or oil exploration mapper, you hire a programmer. You want a new font optimization, dataflow model, or signal analysis method, you hire a CS person (the last being something an EE person would probably shine at too). God forbid you should get a CS person who can only think in terms of a particular machine design.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    38. Re:A lost art, alas by scrytch · · Score: 2

      Sure, Assembly is tough.

      asm is hardly tough. Show me subtraction in lambda calculus. Now that's tough.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
    39. Re:A lost art, alas by Winterblink · · Score: 1

      Oh, reach a plateau they do. That's usually the point whe you can tell if they'll always be just a programmer or if they can move up from there into management.

      --
      "I'm a leaf on the wind. Watch how I soar."
      -Hoban Washburn
    40. Re:A lost art, alas by larry+bagina · · Score: 1, Flamebait

      and he has an army of fags like you, just waiting for the chance to suck him off.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    41. Re:A lost art, alas by larry+bagina · · Score: 1

      HTML is a good programming language, but I think a better introductory programming language is Microsoft Word.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    42. Re:A lost art, alas by Anonymous Coward · · Score: 0

      But no! Plugging cards into PCs isn't electronics, it's technician work. I think you know this anyway, but your analogy is wrong. If EEs were taught the same way as programmers, they would learn about amplifiers, oscillators, tuned circuits, logic gates, flip flops, etc.


      hehe, I started on TV repair, and we did all those things listed. And they really do help with the understanding of whats going on below when doing code (I didn't persue the tv repair once I finished that course)
    43. Re:A lost art, alas by ewen · · Score: 1
      I've ranted about this before, but I have to say it again: Programming is taught ass-backwards in college. Assembly language should be the FIRST thing taught, and then gradually building up to higher and higher levels of abstraction.

      I go back and forth on my thinking as to which order things should be taught in: sometimes I feel that assembly language is an absolute must as a starting point (preferable, after some hardware design), and sometimes I think a birds eye view of a computer as an abstract high level machine is an essential place to start. (It generally depends on which set of mistakes I've seen someone making most recently, I think!)

      But irrespective of that, IMHO the most productive, talented, progammers (and system administrators, and....) have a good insight into the machine at multiple levels, ideally spanning all the way from some idea about the hardware through CPU internals, through assembly language, through portable assembly language (languages like C that are close to the hardware), through high level languages. People completely missing one or more of those levels seem to overlook something, particularly when debugging.

      And often if they don't have those multiple layers of experience, they act like their reality is broken when something goes wrong. Abstractions (like high level languages) are nice when they work, but sometimes the lower levels still shine through and catch you out. If you're aware (even vaguely) of the lower levels being there and roughly how they work, then the lower levels shining through is just another debugging hint, instead of a shock to your reality.

      Ewen

    44. Re:A lost art, alas by Neon+Spiral+Injector · · Score: 2

      PHP, JSP, and ASP are not DHTML languages. DHTML is HTML + a scripting language to manipulate the DOM, like JavaScipt (EcmaScript) or VBScript.

    45. Re:A lost art, alas by Anonymous+Canard · · Score: 1
      PHP, JSP, and ASP are not DHTML languages. DHTML is HTML + a scripting language to manipulate the DOM, like JavaScipt (EcmaScript) or VBScript.

      I'll have to defer to the web programmers here. When I first heard of DHTML I thought it was still before JavaScript and other client side scripting were available, but this is all well out of my area of expertise. Thanks for the correction anyway.

      --

      --
      BitTorrent in C -- LibBT
      http://www.sf.net/projects/libbt
    46. Re:A lost art, alas by Anonymous+Canard · · Score: 1
      CS101 Introduction to Programming: MS Word

      In this course you will learn how to the ever useful macro-virus, an important basic tool for the...

      I dread Microsoft turning every program in the world into a distorted version of MS Basic. It is like the old GNU joke that no program is complete unless it includes the ability to check for new mail (see GNU Hello for details.)

      --

      --
      BitTorrent in C -- LibBT
      http://www.sf.net/projects/libbt
    47. Re:A lost art, alas by Troed · · Score: 1
      You are _so_ correct.

      /me - 7 years of 68000 asm before moving on to becoming a Software Engineer (and now, humbly, a great programmer)

    48. Re:A lost art, alas by Anonymous Coward · · Score: 0

      You want a flame:

      Get a clue! The amount of active FUD and disinformation about Lisp would be comical if it wasn't so serious that programmers still think they have to write in slow-as-hell Java or unsafe-as-hell C.

      Common Lisp programs written to be portable are portable - most lisp implementations go well beyond that "lowest-common-denominator" (itself very rich, but devoid of hardware-specifics)

      Most actual Lisps are not much more than that:
      Lisp Machine Lisp Assembly Language however, was Lisp s-expressions. I.E. Writing in Assembler for the CPU _WAS_ writing in Lisp.

      And, for example, CMUCL contains essentiallt the x86 Assembly language transformed into lisp - it's not some toy lisp interpreter written in C, it's a (high performance) Common Lisp Native Compiler written in Lisp.

      Please note that lots of CompScis think Scheme is the only Lisp dialect - Scheme is, indeed, very abstract. Common Lisp is a much more varied language.

  21. Love/Hate relationship by Plutor · · Score: 1, Offtopic

    "Most of the people I know have a love-hate relationship with Kip Irvine's Assembly Language for Intel-based Computers. Ask any student who used this textbook and you will either get a cheerful 'I've used it, it's great, I learned Assembly, and it has lots of useful examples' or resentful 'The book is horrible, hard to follow and full of code that is irrelevant to the contents of a specific chapter.'"

    That's not a love/hate relationship. A love/hate relationship would be "I used it, it was hard to follow, but I learned Assembly once I finished wading through it. I'm glad I read it, but if I have to do it again, I'm going to commit Hari-Kari"

    1. Re:Love/Hate relationship by scotch · · Score: 3, Funny

      Furthermore, if most of the people the poster knows have such a relationship with this book, he has an extremely limited range of acquaintenances. The poster would be served well to meet and socialize with people outside the computer field.

      --
      XML causes global warming.
  22. Re:Windows by OrangeSpyderMan · · Score: 1

    Err.. who mentioned Linux? I appreciate that x86 assembler is the same all over, but that is what I am looking for, a *general* introduction. Perhaps my question was badly phrased, but is this book a general introduction to x86 assembly or an introduction to x86 assembly on an MS platform? I don't know anything in any detail about the DOS / Win32 platform, and I don't want that hampering my reading of the book, that's all. Would this be the case?

    --
    Try NetBSD... safe,straightforward,useful.
  23. What do you want by Anonymous Coward · · Score: 0

    in [very] general ASM is easy and fairly portable accross systems (even though the menomics might change).Now system programming is a different srort it's harder and not portable, unless you plan on kernel hacking your never going to need to know and system specific ASM and you'll need to learn how to use the libraies provided by the OS you are using.

  24. Re:Windows by Dr+Caleb · · Score: 2
    Nothing, AFAIK.

    Those were software interrupts used to access the umbrella interrupts of DOS/BIOS. AFAIK, Linux does not use the BIOS interrupts.

    --
    "History doesn't repeat itself, but it does rhyme." Mark Twain
  25. Re:Windows by stratjakt · · Score: 1

    Interrupts do whatever their defined it to do. It has nothing to do with x86 assembly, its a subroutine. An assembly text would teach how to trigger/call an interrupt, not what it does, which is OS/BIOS specific. To reiterate; the interrupt mechanism is hardware specific, what the interrupts do is platform specific.

    x86 assembly has no more to do with linux/dos than M68k or Z80 assembly has to do with the Sega Genesis.

    By the same token, a good C++ text wouldn't get into the ridiculous details of ioctl.h or windows.h

    Not everything need be a pulpit for linux (anti-ms) zealots.

    --
    I don't need no instructions to know how to rock!!!!
  26. you were lucky by oliverthered · · Score: 1

    Well now you've given up assembler you will NOT be able to STA with me. We'd have had a ROR that makes you ROL around AND devide by 2 OR more.

    --
    thank God the internet isn't a human right.
    1. Re:you were lucky by ComaVN · · Score: 1

      I'm ashamed to ask, but too lasy to look it up, but what does "STA" do? Is that one of those BCD operations?

      --
      Be wary of any facts that confirm your opinion.
    2. Re:you were lucky by Anonymous Coward · · Score: 0

      STA is a 6502 STore Accumulator command, analogous to mov memory,al/ah/ax/eax

    3. Re:you were lucky by oliverthered · · Score: 1

      STore Accumulator, an insrtuction of old 8 bit processors! where you had 1 Accumulator(GP register) and no MUL/DIV functions evrything had to be done using shifts and JC,JNC.

      --
      thank God the internet isn't a human right.
    4. Re:you were lucky by Ziviyr · · Score: 1

      Reading all oe this makes me want to HACF.

      --

      Someone set us up the bomb, so shine we are!
    5. Re:you were lucky by Anonymous Coward · · Score: 0

      but i have 1 little 2 little 3 little endians to your one big endian

  27. What would you rather have... by HotNeedleOfInquiry · · Score: 0, Troll

    Another Jon Katz article?

    --
    "Eve of Destruction", it's not just for old hippies anymore...
  28. Re:Windows by OrangeSpyderMan · · Score: 1

    Not everything need be a pulpit for linux (anti-ms) zealots. Indeed, as not every reference to MS is bashing. I simply know very little about the MS platform, and don't want my lack of knowledge to get in the way of my understanding of the book. Now everyone seems to say this won't be the case, so that's just fine...

    --
    Try NetBSD... safe,straightforward,useful.
  29. Slashdot Army by Anonymous Coward · · Score: 0
    We get more IP's banned by 9AM than most people do all day.

    I'll pay $7 for UID 1000000. Let's go make some accounts!

  30. Re:Commemorate September 11th by Anonymous Coward · · Score: 0

    You seem to be well informed on these issues...
    Is it true that if I kill a Muslim, I go to heaven?

  31. Re:Windows by Anonymous Coward · · Score: 0

    Writing a small program in assembly language you could concieveably write your own OS. But I believe the book gives you an assembler that runs in DOS. The version I had created executable .com files. We were given this book as a reference but the instructor didn't teach from it. The book does not really get into operating system specifics, just the instruction set for the CPU. Assembly language is very low level and in my opinion, that and algorithms were the most frustrating classes I took in computer science. We started with MIPS on a simulator called XSPIM which ran on linux too, and then moved to x86 using the before mentioned assembler. I had a very difficult time with it but I managed to get a through it.

  32. Re:Windows by ceswiedler · · Score: 2

    Not BIOS interrupts, but (i believe) int 80h is used to switch to kernel-mode for processing syscalls. Also, I'd say that was...important. The startup code (boot.S, setup.S) uses BIOS calls to read the kernel from the boot drive, since there's nothing else available at that point.

    It's interesting that for all practical purposes, the IBM operating system prior to Windows 95 was the BIOS. DOS was nothing more than a shell; the BIOS did everything. Somehow, though, the BIOS was reverse-engineered (almost immediately) and became a commodity, while DOS never had a serious competitor. DOS launched Microsoft; IBM backed out of the PC market (for a while).

  33. better? HA!! by Anonymous Coward · · Score: 0, Insightful
    In my experience, I've often found that EEs converted into programmers are better programmers than people with CS degrees,

    Funny, I've found that EEs who learn to program turn out the most obfuscated and counter-intuitive crap imaginable. They're so busy thinking about the low-level efficiency tricks that they forget to make a clean high-level structure, and end up with a total mess. Then they wonder why it's so hard to debug.

    Assembly language should be the FIRST thing taught, and then gradually building up to higher and higher levels of abstraction. All algorithm theory should be taught in assembly. When you've implemented algorithms in assembly, then there's no question that you know them far better than when they're surrounded by 7 layers of syntactical fluff.

    There's no question? Bullshit. You don't learn algorithms by delving into inconsequential trivialities. You learn algorithms by looking at them abstractly. Ditto for data structures.

    Assembly language should not be the first language taught. The first language should be a middle-level language such as Pascal. (It was designed as a teaching language, and at that it is very good.) After the students learn to think properly, analyze, and abstract, then the curriculum should branch and start moving simultaneously to higher-level languages like Java and lower-level languages like assembly. To start them out at the bottom will unnecessarily complicate their view of computers and programming and leave them unprepared to deal with the truly complex high-level problems like distributed concurrent systems.

  34. Re:Parent troll? by Anonymous Coward · · Score: 0

    alright, alright, whats all this then...we'll have no trolling here. this is a linux site, for linux people - we dont want any strangers here.

  35. Focus, Title by fm6 · · Score: 2
    According to the preface (warning, PDF file) this is strictly an IA-32 book. Which doesn't make it obsolete. Quite the contrary -- it'll be a long time before more assembly-language programming is done for Itaniums than for Pentiums and their clones. If ever.

    Omitting Linux makes a book a little more narrow than some of us would like, but that doesn't make it obsolete it either. Last time I looked, there were one or two Windows programmers gainfully employed.

    So the title is misleading. Probably chosen by the publisher, after they decided that an accurate title ("IA-32 programming for Windows and DOS"?) wouldn't sell. And it doesn't cover topics some (but not most) of us are interested in. Sounds like 90% of the computer books in print.

    I've been looking at Chapter 1 of Duntemann's book Fourteen pages of lame jokes, complicated metaphors, and totally redundant explanations of basic programming concepts. (Everybody who doesn't know what a loop is, raise your hand!) The first serious technical information is in chapter 2, where he explains non-decimal math by presenting a table labeled "Counting in Martian, base fooby." (Xip means 0, foo means 1 .. foobity-barby-foo means 25) OK, maybe you think this is very witty, but it all goes by most of us. And separating the technical detail from the hyperactive comedy requires more energy than a serious student can spare.

    1. Re:Focus, Title by stevey · · Score: 2, Informative
      Omitting Linux makes a book a little more narrow than some of us would like,

      But those people could jmp along to :

  36. WTF? by Anonymous Coward · · Score: 0
    1. INT calls are by defintion BIOS / OS specific. No assembly book that claims to be OS agnostic would use them.
    2. What fucking crackhead came up with the idea of using hardware interrupts to implement BIOS calls?!!! (Oh, that's right, those fucking x86 crackheads!)
    x86 is why I gave up bothering with assembly. It's just such a fucking nasty monstrosity. It's not fit work for humans, leave it to the compilers. (And a few twisted programmers that can relate to that byzantine cruft.)
    1. Re:WTF? by sqlrob · · Score: 2

      Can an assembly book be (completely) OS agnostic?

      Think about it (and it was mentioned in the review as well)

      int main(int argc,char **argv)
      {
      printf("hello world");
      }

      is largely OS agnostic.

      Now, do the same in OS agnostic assembly.

      OK, so console I/O was unfair. How about:
      {
      int *x = new int[20];
      delete [] x;
      }

    2. Re:WTF? by sir99 · · Score: 1

      Well, you could always link against libc and use standard C functions. Dynamic libraries are weird in Linux asm, but you could simply link statically, and it would be mostly (completely?) the same as static linking to libc in dos/windows.

      --
      The ocean parts and the meteors come down
      Laid out in amber, baby.
    3. Re:WTF? by ComaVN · · Score: 1

      What fucking crackhead came up with the idea of using hardware interrupts to implement BIOS calls?!!! (Oh, that's right, those fucking x86 crackheads!)

      How do other architectures handle these? I'm only familiar with x86 assembly myself.

      Anyway, who thought 8 hardware interrupts were enough? The cascaded PIC is not the best design possible either. Yet, most modern computers still have this basic design, so it can't be all bad, can it?

      --
      Be wary of any facts that confirm your opinion.
  37. The 6502 Lives! by fm6 · · Score: 2, Interesting
    Hey, I have a friend who teaches a 6502 assember class at a local community college. Quite well-attended. I doubt if any of his students use this skill in real life, but it is a good way to pick up basic computer architecture.

    When he started the class, he used Apple IIs. School wouldn't keep these around just for one class, so now he uses an Apple II emulator running on PCs.

    1. Re:The 6502 Lives! by EvilBudMan · · Score: 1

      I think I used Atari Assembler Editor to write a scalable screen dump once, and that was about it. I looked at some x86 code once with the segmented memory and all and gave up. In Introduction to Microcomputers (Adam Osborne), I think it had the instrution sets to many processors of the time. I never thought that the Intel stuff would catch on but what did I know. Oh well the 6502 could do 64K, I think. Intel could do ??? in 64K segments, Motorola ??? Oh well, back to being just a dumb user.

    2. Re:The 6502 Lives! by Chemical+Serenity · · Score: 1

      Heh... wayyyy back in the day I made a terminal program for the atari 8 bit and the MPP-1000e modem. 80x24 screen (using a 4-pixel wide font... quite a feat, lemme tell you)... made pretty heavy use of De Re Atari, the holy bible of all things atari 8-bittish. It was actually kind of fun, if you consider that sort of thing 'fun'. ;)

      That was about the last time I did anything serious with asm. I tried to get into 8086 stuff and got some dos-based things hammered out, but compared to the 6502 it was a faustian nightmare.

      --
      "People will pay big bucks for the luxury of ignorance."
  38. Dear God, no. by Thud457 · · Score: 0

    I remember trying to implement Quicksort in assembly before I really understood what the algorithm was doing. When I finished, I knew less about how it worked than when I started. What a waste of time.

    Different algorithms map better to different tools. Some things match well with high level languages. Some things match well with assembly. Some things match well with DNA computing. And I'm sure sume algoritms will seem trivial when implemented using quantum computing.

    I do agree with the original poster's point that starting out by learing assembly, and using it to implement appropriate algorithms seems like a good educational approach. Once a student understands the building blocks, they can start studing more abstract tools for solving more complex problems.

    --

    the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff

    1. Re:Dear God, no. by slashhot · · Score: 0
      And I'm sure sume algoritms will seem trivial when implemented using quantum computing.

      The bogo-sort is such an algorithm.

  39. I am programming it today! by pommiekiwifruit · · Score: 1

    Well 65816, but near enough :-)

  40. Re:My opinion by Anonymous Coward · · Score: 0

    But would you give a blue fuck? What are the relative values of red and blue fucks? What about other colors, is there a mapping from all RGB triples to the values of fucks of that color?

    Indeed!

  41. Small rant on ``Assembly rules'' dudes by PissingInTheWind · · Score: 1
    Some people seems to think that programming is only about algorithms, and fast execution of those. But programs are ``algorithms + data''. Programming in assembly lose you all your flexibility when dealing with data.

    I'd really love to see a complex distributed network application written in pure Assembly. Then I'd change the spec just a little, just to show the total lack of robustness and flexibility that app would have.

    Hardware people tend to think that the fact that you execute your program on hardware matters. I think not. Software lives on its own, you need to be able to abstract the fact that you are running on hardware if you want to be able to manage the complexity.

    --

    A message from the system administrator: 'I've upped my priority. Now up yours.'
    1. Re:Small rant on ``Assembly rules'' dudes by starling · · Score: 1

      Programming in assembly lose you all your flexibility when dealing with data.

      You might. A competent assembler programmer won't. Low level programming isn't right for everything, but sometimes you need the level of control it provides. True, it's *harder* to use assembler well, but it's nowhere near impossible.

    2. Re:Small rant on ``Assembly rules'' dudes by Anonymous Coward · · Score: 0

      Far from it. Data is a high level concept that you implement within a programming language's syntax. Understanding this, along with the semantics of your programming language of choice, is all that is required to focus on "algorithms + data" or objects.

      Just because you require concepts to be implemented in a single line doesn't mean everyone else does.

      Object orientation is a design philosophy that can be assisted by programming language syntax--it is not a requirement.

  42. ARM by yerricde · · Score: 3, Interesting

    Try looking at the 68K instruction set, or the Z8000 (or Z80000) instruction set. Nice orthogonal instruction sets, no special purpose registers (except for the stack pointer - A7 and R15/RR14 respectively).

    Even better, look at the ARM instruction set. Every instruction can be conditionally executed based on the same flags that other archs (6502, 68000, ppc, x86, etc) use for branches. Heck, even the program counter is a general purpose register. If you want to learn on a simple ARM machine, start here.

    --
    Will I retire or break 10K?
    1. Re:ARM by jejones · · Score: 3, Informative

      Well, yeah, but...the conditional execution bits eat four bits out of every 32-bit instruction, which makes the constraints on immediate operands and offsets for base + offset addressing even more galling than usual on fixed-width instruction sets, for a payoff of uncertain value unless all you do is run the clever GCD code people always give as an example of how great ARM conditional execution is. Among the most perverse aspects are offsets whose ranges vary with the type of data you're loading or storing, the set of permissible immediate values (an eight-bit value shifted by an even number of bits), and an obnoxious constraint on operands of multiply instructions.

      Of course, writing code for the ARM is heaven in comparison with writing x86 code, but I would not say it is all that spiffy in comparison with 68xxx or PowerPC.

  43. No. by Anonymous Coward · · Score: 0

    Your reward will be here on Earth. The knowledge that your small contribution has helped shape the world into a better place.

    Islamics are an invasion force. First they come as friends, then they corrupt the country from within. Like a cancer, we must cut this filth out.

    The struggle shall be long and hard, but we will prevail once we realise that yes, we ARE at war. The war of civilisations.

    Are you prepared to kill to defend your way of life from the invader?

  44. strings by oliverthered · · Score: 1

    If you know 'what' the computer is doing your going to write faster less bloated code be able to track down bugs easier and have a more logical approach.

    Why strings, well high level strings are usually the slowest most bloated things you could care to mention.

    as a sudo example of bad string use

    string mysting = 'larlarlarlar'
    while(mystring.length>0)
    begin

    string astringthatwontchange = mystring.leftchars(4)
    mysting =mysting.rightchars(mysting.length-4)

    dosomethingbasedon(astringthatwontchange)

    end

    if you don't know whats going on you won't realise that you can use a head-tail index instead and avoid copying and alloacating all that memory &co.

    --
    thank God the internet isn't a human right.
    1. Re:strings by larry+bagina · · Score: 1
      pseudo, not sudo.

      you're right though, you should have an understanding of hat goes on beneath the surface if you want to produce good code. That doesn't mean being anal about it -- optimizing compilers get better, machines get faster -- but you should be aware of what you're really asking for.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

  45. Used this book by cpex · · Score: 1

    I used the 3rd edition for my assembly class a year or so ago. Didn't reference the book that much. The instructor provided decent notes online and I mainly used them. Used the book to find similar examples to homework problems. I have since tried reading the book but have gotten bored each time and forgotten about it. I wish the book didnt focus so much on the microsoft world but what can you expect. I wish it focused more on direct hardware access which is what i see assembly being more usefull for.

  46. To those who think assembly is irrelevant by Mr+Z · · Score: 5, Informative

    One thing I've noticed in the comments attached to this article is the repeated question: "Is assembly still relevant?" As someone who codes assembly on a regular basis, I must shout an unequivocal YES.

    It's relevant on many levels. First, as another posted has pointed out, learning assembly is very similar to an EE learning circuit theory: To really understand the aggregate effects, you sometimes need to understand the details. Now, one could counter "But Physics isn't taught that way!" You're right, but then Physics 1 (kinematics) and to a large extent, Physics 2 (electricity and magnetism) is much more concrete than anything you'll ever learn programming-wise. Also, the "approximations" provided by Newtonian mechanics fairly accurately describe nearly all of what most of us will ever interact with. The rest of us take one or more Modern Physics courses that cover quantum mechanics and all the other nitty-gritty.

    On another level, it truly does allow you to get away from the noise of the language and concentrate on what the machine really does. I've seen so many people that are so out-of-touch with their code, it's unreal. Even in C, it's easy to write code with way-too-much hidden complexity. If you understand assembler, though, you're more likely to think about the true cost of each action. At the very least, you're much more likely to be able to compile to assembly output and actually understand what you're looking at.

    I work in embedded systems, and in that space, assembly language hasn't died. I program DSPs for a living. While high-level languages are continuing to absorb ever larger chunks of code in this space, it seems as though assembly will still always rule the tight loop. If nothing else, it's an invaluable measuring stick for knowing just how close or how far from ideal you really are.

    So in summary, assembly language is still relevant. It's the only way to truly be demystified about how your code actually gets executed. And it's a great way to get programmers thinking about all the levels of abstraction when the time comes.

    --Joe
    1. Re:To those who think assembly is irrelevant by jmerelo · · Score: 1

      But isn't true that modern compilers generate code that is much more efficient than anything you can do by hand? And that taking into account pipelines, the two integer units, the FPU unit, low-level code rearranged by a compiler will very often be better? It's even more true for VLIW processors, such as IA-64.

      It's probably true for microcontrollers, or for DSPs, for which good tools (especially optimizing C compilers) do not exist, or in general, for some niche applications, but I still think that ASM is relevant in the same sense that COBOL is: some people have no other way out than using it, but the general public is better of by sticking to high-level languages.

    2. Re:To those who think assembly is irrelevant by Mr+Z · · Score: 1

      Funny you should mention VLIWs, since the DSPs I program (the TMS320C6000 family) are VLIW. They're actually much closer to traditional VLIW than Intel's IA-64.

      Compilers can produce much more "pretty good" code than any human could (without going insane, at least), in a much, much shorter period of time. But I've never yet had the compiler beat me on size and speed simultaneously on any individual calculation-intensive function I've coded by hand. (It'll beat me very occasionally by a couple cycles at a large cost in size.) This is not because the compiler's bad at what it does. TI actually has one of the better optimizing C compilers out there, at least in the embedded space. (Disclaimer: I work for TI.)

      The real difference, I think, comes from the assumptions the compiler can't make but that the programmer can. The semantics of the C language get in the way of performance sometimes. Pointer rules cause dependences where you don't expect them, alignment issues frustrate SIMD optimization, etc. When you code in assembly language, What You See Is What You Get, exactly.

      --Joe
    3. Re:To those who think assembly is irrelevant by gregbaker · · Score: 2
      Is assembly still relevant?

      My answer: Only if you want to write a compiler, or an operating system or do CPU design. Or, if you want to actually understand any of those things. In a group of computer science majors, that usually shuts them up.

    4. Re:To those who think assembly is irrelevant by Anonymous Coward · · Score: 0

      And John HENRY, told his CAPTAIN
      He said a MAN ain't nothing but a MAN
      But before I let that compiler beat me down
      I'll die with this keyboard in my hand Lord, Lord
      I'll die with this keyboard in my hand.

    5. Re:To those who think assembly is irrelevant by zwoelfk · · Score: 1

      > But isn't true that modern compilers generate code that is much more efficient than anything you can do by hand?

      This is a complete lie that is spread by people who have either never programmed in assembly or never want to again. Compilers are getting better, that's true, but no compiler I use is even close to what can be done by hand. I don't even think in theory it -could- be (at least in the case of C) -- the compiler simply doesn't have near the amount of information about the process or data that I do.

      Assembly is relevant to me. I use it all the time. GCC for the PS2 is oh-so-lame and don't get me started on CodeWarrior. And of course let's not forget the VU microcode. There are some tools out now to help people get moving there (e.g. VectorC) but no one will say they can beat a coder.

      Compilers are a cost issue. We use them to save time so long as they don't get interfere with the end result. When they do (the need-for-speed loops) just toss them and do it yourself. Simple!

      I don't write assembly on my PC (except just for fun stuff) because it doesn't come up -- I use high level tools for what they are appropriate for -- high level problems. I think most of the applications people are familiar with are high-level apps and are therefore more appropriately written in C#/Java/Lisp/Rebol or whatever is suitable for the stuff.

      Geez, I can't believe we still have this argument. Yes, there are less and less programmers who need assembly, but they'll always be there because -someone- has to talk to the machine.

    6. Re:To those who think assembly is irrelevant by jmerelo · · Score: 1

      And how do you manage, and this is a question, to keep the pipelines of the integer and FPU units filled all the time, so that the CPU is able to crank out the max amount of instructions-per-cycle?

      Besides, it would be good to know in which situations is assembler better than high-level language. It's obvious that it's much better than C in some niches, but I would like to know which ones. OK, when "you need to talk to the machine", but, for instance, Linux kernel talks to the machine and it's mainly (only?) written in C.

      And what is VU microcode? I can google it, but I would like some explanation in this context...

    7. Re:To those who think assembly is irrelevant by Anonymous Coward · · Score: 0

      Keeping the pipelines full is a matter of careful coding; you have to keep track of how full each pipeline is, and what you can do to keep it full.

      Assembler used properly (not just because you can) results in a longer coding time, but faster code than any compiler can produce. The reason is that the programmer knows that the objective is to (for example) produce PCM audio for a DAC from an Ogg stream, whereas the compiler only knows that it is being asked to manipulate data in certain ways. There are assumptions that I can make when programming, which I cannot express in terms that the compiler can understand; if they allow me to improve the machine code, then my assembler version will be faster, at the expense of lots of my time.

      Basically, assembler is only worth using when the extra speed from writing code tightly optimized to the chip in use outweighs the extra programming time it takes to write such code.

    8. Re:To those who think assembly is irrelevant by Anonymous Coward · · Score: 0
      And how do you manage, and this is a question, to keep the pipelines of the integer and FPU units filled all the time, so that the CPU is able to crank out the max amount of instructions-per-cycle?

      This is a somewhat pointless question. If you understand the resources that the CPU has, you code accordingly. You can write code in a linear fashion and once it works you can start shuffling instructions around to reduce dependencies. The compilers do this, and to some extent the CPUs out-of-order execution help it along. Sure writing code this way is tedious, but Intel has tools like VTune that highlights caching and instruction ording and grouping (execution unit usage) conditions. With the IA64 I seem to recall that they had a post-processing of object code from the assembler to rule check the human generated code, and fold instructions where parallelism is possible. As for compliers, again Intel's C compiler can generate some very fine code, I've seen some output that approaches dangerously close to hand coded assembler.

      You seem to be under the false impression that ALL the units have to be saturated ALL the time, or even can be in the current architectures. Frankly I don't think this is true, and further I don't think the compiler gets anywhere close to the 100% utilization you are suggesting by "units filled all the time". How can you conclude that the FPU/MMX/SSE/3DNow units are going to be doing anything other than twiddling their toes during any integer algorithm? or much of the Linux or Windows kernels for that matter. I think CPU is going to be constrained first by the number of (K7,PPro) micro-ops it can execute simultaneously and dependencies on in-flight micro-ops.

      In the vast amount of code that I have ever looked at, and I've poked around inside Windows OS and apps quite a lot, there really isn't the kind of paralellisum in the code streams that would saturate all the available execution units be it INT/FP/MMX/SSE-KNI/SSE2-WNI. The only way I can see that you can get the utilization up, is to have multiple diverse code streams (aka hyper-threading). Intel has only scratched the surface here, bolt on more execution units and 4-8 diverse code streams. Perhaps then they can selectively sleep excution units to let them cool down, as they have been talking about recently.

    9. Re:To those who think assembly is irrelevant by Anonymous Coward · · Score: 0

      I'll be sure not to ask that question then :P Too bad you aren't teaching CMPT 150 in 2002-03 when I plan to take it though.

      -- An anonymous CS Major (approved, that should narrow it down to about 40 people) at SFU in your MACM 101 class

  47. Tossing my hat into the lot... by Cutriss · · Score: 3, Interesting

    I think Irvine's text was a good middle-of-the-road read. Duntemann's "Assembly Step By Step" was very informative and helped me learn some more varied aspects of assembly which Irvine's text was a bit short-sighted with...but otherwise, for a college textbook, it's head and shoulders above many others I've read. Uffenbeck, anyone?

    The first time I took Microprocessors, my instructor actually recommended that we use Uffenbeck's text to learn x86 ASM. Thankfully, when I retook the course, we had Irvine's text to accompany it. Don't get me wrong...Uffenbeck's book is good for comparative architecture analysis and the hardware side of things, but it's useless for learning ASM programming.

    --
    "Mod, mod, mod...and another troll bites the dust."
  48. Excellent freeware book is also available online by Anonymous Coward · · Score: 0

    http://www.drpaulcarter.com/pcasm/

    Check it out. It's got some GREAT information for people experienced with C and C++ who want to learn x86 ASM and how to interface ASM with a higher level language. It's VERY clear and as comprehensive as many are likely to need. Download the PDF and have fun!

  49. Short, but sweet... by Kedanoth · · Score: 1
    During my introductory Assembly class, we used the Third edition of Kip Irvine's book. It was actually the only required textbook in said class. (the course, named Introduction to Computer Engineering, encompassed both Intel-based Assembly (on the first half of the semester) and introductory C (on the remainder of the term).)

    The book was well done with lots of examples, but I didn't quite catch on. Not by fault of the teaching materials, but for the topic. I personally found Intel Assembly pretty confusing.

    I corroborated this by taking another class next term, which was based on Motorola 68HC11A8 Assembly, and it was a lot easier to understand.

    Just a quick peek into X college student's mind...

  50. Re:Windows by ComaVN · · Score: 2

    DOS was nothing more than a shell

    Really? So what BIOS call allocates memory for me? Or writes files to disk? Or lets my program go TSR? Or lets me write "$" terminated strings to screen? (ok forget that one. Whoever came up with THAT idea in the first place?)

    The BIOS only provides easy access to some default hardware like the screen and the harddisk, but it has no knowledge at all about the filesystem or things like that. That's what io.sys does.

    --
    Be wary of any facts that confirm your opinion.
  51. delphi by Anonymous Coward · · Score: 0

    As an example,
    A matrix inversion routine in delphi took 40mins to do a 1000x1000 matrix inversion, after converting the code to assembler it took 40 seconds(PII 450) which could have been reduced further by rotating some of the data structures to avoid a hell of a lot of cache misses and page faults.

    1. Re:delphi by larry+bagina · · Score: 1
      big deal. I once optimized this code:

      for (register long l = 0; l < 0xffffffff; l++)
      {
      }

      and got:

      nop

      For a giant speed increase!

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

  52. Simple by Anonymous Coward · · Score: 0

    Just define some blackbox functions that you use throughout your text.

    Possibly have appendices that describe how one would implement you utility functions for different OSes. If you do, and only provide one example, then you're a lame-o.

  53. not only is the compiler going to beat you by Trepidity · · Score: 2

    It's the only real choice for any app of significant size. Your assembly code will be unlikely to work at all on any significantly-sized app, because of the incredibly complexities of IA-64's pipelining (to improve speed, they took out all the "make sure stuff gets executed in the right order when we parallelize" hardware, so it's up to the software to take care of that now).

  54. Salaries? by Anonymous Coward · · Score: 0


    Not a flame: What do the salaries look like for programming in low-level languages & situations [assembler, machine code, firmware, hardware drivers, etc.] -vs- intermediate code [C, C++] -vs- high level code [java, SQL]? My impression is that there are so few programmers that write, for instance, good WIN32 drivers, that they can charge top dollar for their services.

    1. Re:Salaries? by Anonymous Coward · · Score: 0

      Where I work, about 50K to 80K a year, typically, depending on how good you are. Last year, because I was involved in a lot of other projects and programs, I actually cleared 160K. This year will be closer to 80K to 90K.

    2. Re:Salaries? by Anonymous Coward · · Score: 0
      Last few it's cleared 100K, I work on HW Drivers, and app software that uses the HW. I'm an EE and can do HW design too, but I haven't done much of that in a couple of years.

      The reason that Win32 drivers are a problem is because there is a lot of kruft out there. The DDK examples are usually not that good. Microsoft's examples have bugs which people just cut'n'paste, and even the ones that work have lost all clarity because they have been bodged together over several generations of cut'n'pasting so things get initialized in multiple places and often unnecessarily because the people doing it have lost track of what has to be done, and they ship it because it's working and they don't want to make it correct. Microsoft has real problems, because they assumed people would code their own drivers using theirs as a roadmap, not editing theirs. The result is that instead of errors being limited to a driver or two where the developer screwed up, they have tens of thousands of drivers broken all the same way. Talk about legacy issues!

      Also a lot of people (especially in management) seem to think you can buy some instant code-in-a-box add some water and boil for a few hours and get drivers. Pointing an clicking to a driver doesn't mean you know the whys and hows that make the machine tick.

  55. CPA program by sirinek · · Score: 2

    Well I wouldnt expect my accountant to bust out even a little simple perl code, so why are they worried about them handling Java and VB?

    siri

    1. Re:CPA program by nels_tomlinson · · Score: 2
      I am still waiting to hear one good reason to run Netscape 7 instead of Mozilla! :-)

      Netscape 7 is ADVERTISING ENRICHED! With new, IMPROVED popup windows!

  56. Academic Pricing sham by mstrcat · · Score: 5, Interesting

    Using one of my favorite shopping bots to price this book,

    http://www.bestbookdeal.com/cgi-bin/prices.cgi?i sb n=0130910139

    I noticed once again that the UK price is about 2/3 the US cost. So it's cheaper to buy the book in the UK, and have it air-mailed across the pond than it is to buy the new book here in the states. This is not an isolated incident, but a systematic one. As a Masters student, I regularly find that UK textbooks are frequently about 1/2 the US price.

    This smacks of price fixing by the publishing industry, akin to what we see the movie industry doing with movies.
    Can anyone comment on how prices for US books are set and how much business they lose to people using the Internet to shop internationally?

    1. Re:Academic Pricing sham by jgalun · · Score: 1

      This circumstance has nothing to do with price fixing, it has to do with simple supply and demand. The fact is, once the book is written, it doesn't cost much to publish and print in the UK or in the US. But the publishers have determined that they can charge Americans higher prices and thereby make more profits, because that's how they maximize profits. This works because most Americans don't think of ordering in Britain and having it shipped over the Atlantic, or because for many books that is cost prohibitive.

      Price fixing is when firms get together and illegally determine the price of a good. That is not happening here. It's not like the publisher of this book got together with other publishers to determine that this book should be sold for more in the US. They all arrived at this decision independently, because it's a pretty easy one to make. This is a very transparent process.

    2. Re:Academic Pricing sham by CodeMunch · · Score: 1

      Yeah, by book pricing standards, we in Canada are each U.S. currency multi-millionaires.

    3. Re:Academic Pricing sham by nels_tomlinson · · Score: 2
      It isn't price fixing, it's price discrimination. Obviously the folks in the UK have more elastic demand than we do over here, so the enterprising monopolist (that's what copyright's all about, you know) sets a different price in the two markets to maximize his revenue.

      British publishers make their textbooks available in India at 1/5th to 1/10th the price they charge in Britain, I'm told. It isn't charity, it's profit maximizimg behavior. If you are comfortable with chinese, you can get the chinese edition of many books for $2 to $5 US.

    4. Re:Academic Pricing sham by Anonymous Coward · · Score: 0

      I wrote a great book exposing many conspiracies in the book publishing world.

      But I can't get a publisher...

    5. Re:Academic Pricing sham by NetFu · · Score: 1

      These price differences are pretty damn small -- yeah, if I order it I can save a few dollars (after shipping costs), but who cares?

      Oh and speaking of price "discrimination", you can buy a REAL Coca-Cola in Vietnam for $0.02 -- but over there you're lucky to make over $100/month (if you have a job at all). It's not discrimination, it's MARKETING.

      Another Vietnam story -- some American-born Vietnamese guys went back to Vietnam with their families and decided that the quality of the coffee there was horrible compared to what we have in America (yeah, the 2ND largest producer of coffee in the world has horrible coffee). So, they decided to do the Vietnamese people a great service and bring Starbucks-style coffee to Vietnam in a relatively big business venture.

      The problem that these ignorant Americans didn't think of (yes, they were Vietnamese, but they were born here in America and have the same problem a lot of Americans have of being ignorant of foreign cultures) was that their Starbucks-style coffee ended up costing Starbucks-style prices -- $3-5/drink. In Vietnam, their standard Cafe Sua Da (iced coffee with sugar-milk) costs $0.01-$0.02/DRINK! So, these guys' primary customers ended up being American tourists -- needless to say, business is not booming for them.

      This was a big joke when I told people here about this, and an even bigger joke when I talked to our family in Vietnam about it on our last trip there. Not that they don't love Americans, but the idea that they would pay even $3 for a cup of coffee (equivalent to an American who makes $2500/month paying $75 for a cup of coffee) was ludicrous.

      The bottom line of all this is that simple economics is the primary driving factor of product pricing -- and for good reason.

    6. Re:Academic Pricing sham by Anonymous Coward · · Score: 0
      The bottom line of all this is that simple economics is the primary driving factor of product pricing -- and for good reason.

      Yep, that's what I said. ``Price discrimination'' is a technical term for ``charging different prices in different markets to maximize revenue''.

  57. Compiler? by Garen · · Score: 1

    • The book comes with Microsoft ASM and thus all examples assume using MASM for their compilation needs. In my class, however, NASM has always been the compiler of choice, ...

      I would lie to you if I told you that I've read the whole book.

    It would also seem you would be lying if you said you made it to Chapter 1 -- Basic Concepts, deep into the text on page 3 where it says:

    " What is an assembler? "

    Hint: Not a compiler.

    1. Re:Compiler? by Kenbo · · Score: 1

      Actually, a compiler is a program that translates code from one representation to another. The final representation does not have to be machine language. CFront, the original C++ compiler translated C++ code to (very ugly) C code. Java and various other language compilers translate to machine independant byte codes. Assemblers translate assembly code ( with macros, variables, etc. ) to machine code which makes them compilers. Regardless of what the book might say.

    2. Re:Compiler? by Garen · · Score: 1

      A compiler has a more specific meaning than that: it translates code from a high level language. Otherwise the distinction would be meaningless.

      This isn't just "what the book says." The difference has to do with the close correspondence between the "translation," which is practically a one-to-one mapping in assembly.

      I'd expect someone who was teaching the course and have reviewed the book to know the difference.

    3. Re:Compiler? by Anonymous Coward · · Score: 0

      Set of assemblers is a subset of set of compilers.

    4. Re:Compiler? by Kenbo · · Score: 1

      Hmm, perhaps (likely) the consensus of what is a compiler has changed since I was last writing them (circa 1990). I have always seen a program that parsed statements in one language and then generated the equivalent statements in another as a compiler. The fact that the languages roughly correspond to each other is not important for my definition.

      The compiler definition I use is one I learned from my CS professor while taking compilers and advanced compilers. I wish I could find my dragon book for a more definitive answer..

      I guess I'm not really trying to say that either you or the author is wrong (though my previous hastily written post above might appear to ) but that there are other educated people who would agree with the author.

      Cheers.

  58. Re:Windows by sir99 · · Score: 1

    Linux asm is IMO nicer to work in than DOS asm; partly because everything goes through well-documented int 80h calls, instead of a mishmash of DOS and BIOS calls. And as an added bonus, it's not difficult to call libc functions from Linux asm, whereas Irvine's book only includes his own little library. Other than that, a straight forward Linux asm program looks pretty much like the equivilent DOS asm program.

    --
    The ocean parts and the meteors come down
    Laid out in amber, baby.
  59. asmutils - assembly on Linux by opk · · Score: 2, Informative

    There is a project at http://linuxassembly.org/asmutils.html where they're writing some of the standard UNIX utilities in x86 assembly. It's used for things like floppy distributions such as tomsrtbt.

    I used to do some assembly back in the DOS days and keep meaning to have a look again sometime.

  60. HTML by Anonymous Coward · · Score: 0

    HTML is a markup language, not a programming language. Markup languages embed metainformation within the data. Programming languages are instructions, specifying certain execution paths.

    No one ever confuses CPUs with hard drives. Why do they persist in confusing markup languages with programming languages?

    1. Re:HTML by Anonymous+Canard · · Score: 1
      HTML is a markup language, not a programming language. Markup languages embed metainformation within the data. Programming languages are instructions, specifying certain execution paths.

      Programming languages combine declarative and imperative elements. HTML is declarative, PHP is imperative. I don't see your problem. Actually I'll go one further; I don't think the problem is so much with the world as it is with you... I see it as net positive that HTML coders consider themselves programmers. Perhaps not programming as I learned it, or you did, but still abstraction, expression and execution. I think HTML coders have a refreshingly new perspective on the ideas surrounding programming that those of us too heavily steeped in the tradition of procedural and object oriented languages would have completely missed (and many people still do miss.)

      --

      --
      BitTorrent in C -- LibBT
      http://www.sf.net/projects/libbt
    2. Re:HTML by Anonymous Coward · · Score: 0

      thou are surely a troll.

      none whow ever felt the code flow would type something like even HTML as a first programming language (i only copyn'paste, though shutter).

    3. Re:HTML by Anonymous Coward · · Score: 0

      print "Hello World"

      or

      <html><body>Hello World</body></html>

      Now you explain why one is a program
      while the other is non. Software is just data
      and some environment knows how to make use of it.
      According to your book XSLT wouldn't be a programming language either
      but just XML data.

      You guys need to think a little bit out of the box.

    4. Re:HTML by Anonymous+Canard · · Score: 1
      ... none whow ever felt the code flow would type something like even HTML as a first programming language.

      As far as programming credits go, I first started programming in my late teens back in 1978, on various systems including the TRS-80, PDP 1170, and a DEC 10. My first open source development effort was a little assembly language hack for CP/M that loaded a shell overlay (a free but not open source program distributed by DRI IIRC) in about 10 seconds from disk rather than the 40 seconds it took on its own. Back in the days of SunOS I open sourced 'acc', a shell for 'cc' that translated ANSI'isms to K&R, and also 'ctoh', a program that combines non-code generating and code generating code into a single source file, seperating them only at compile time. Commercially I've personally written tens of thousands of lines of C, about 100k lines of C++ (with CORBA), maybe 20k lines of Java. This doesn't begin to cover the number of shell scripts, lines of Perl, or anything else that I've written just to scratch an immediate itch. If you want to see examples of my code, I occasionally manage to add new code to my open sourced Dragon's Reach project, including what I think is a pretty good combination of RPC and XML in the xdrxml subdirectory.

      So I don't think I'm trolling... I'm trying to get across something I think is actually quite important. You say HTML isn't code, I say that is because you want there to be a distinction between the elite coders and the non-elite HTML'ers; the means that they have to get a computer to do what they want are quite different from yours, but the things that they have accomplished would have been quite impossible starting from an ORB. The future of distributed programming belongs to loosely coupled systems, and thus to those with the web mindset, and not to you, for the same reason that NFS cannot be run effectively over an area larger than a LAN, while http protocols run everywhere.

      --

      --
      BitTorrent in C -- LibBT
      http://www.sf.net/projects/libbt
  61. Good assembly links on the web by Anonymous Coward · · Score: 0

    Good online textbooks for intel assembly are:
    "The Art of Assembly" by Randal Hyde
    at http://webster.cs.ucr.edu/
    (linux stuff as well)
    -good amount of detail, only downside is that he uses a language he's developed himself (High Level Assembler) for the code (although HLA does make it easy to learn assembler as a first language)

    Dr Paul Carter's book at
    http://www.drpaulcarter.com/pcasm/
    for more traditional approach of assembler using NASM.

    Michael Abrash's "Black Book of Graphics Programming" is also good for assembler, you can get an online copy at Dr Dobbs Journal

    A couple of sites for Linux Assembly are
    www.linuxassembly.org
    www.int80h.org

    and win32 at
    http://spiff.tripnet.se/~iczelion/
    http://www .azillionmonkeys.com/qed/asm.html

  62. MASM within Bochs/FreeDOS Emulation by Laven · · Score: 2
    I'm currently taking ICS312 at the University of Hawaii where we are required to use Microsoft Assembler (MASM) and this exact book for our coding projects. This book comes with MASM 6.15 for Windows, and MASM 6.14 for DOS.

    I am wondering if anybody has any experience with MASM, especially attempting to run it on any DOS running within a virtual machine. I am trying to create an easy platform for Linux and Mac students in my class in order to learn ASM without the need for Windows (grader will only test our project assignments in MASM).

    http://videl.ics.hawaii.edu/bb/viewtopic.php?t=2
    I had attempted to run MASM on FreeDOS running on the Bochs Pentium Emulator in Linux, but it crashed. You can read about these problems at this address.

    I am not fully understanding about the capabilities of MASM in FreeDOS, especially within a Bochs environment. I suspect that Bochs or FreeDOS cannot support some features that MASM needs, or some of the coding requirements needed for my class this semester. I realize this question is a bit vague, though I would appreciate any insight into these problems.

    Alternatively, would there be any other 99.9%+ MASM compatible assembler that is free or Linux based? What problems may I run into with the other assemblers?

    Somebody else had mentioned trying DRDOS because that has become free (beer or speech?). Does anyone have any experience with DRDOS and MASM instead? Where can I get this?

    Thanks,
    Warren Togami
    warren@togami.com
    Mid-Pacific Linux Users Group
    http://www.mplug.org

    p.s.
    http://www.mplug.org/archive/2002/bochs_win98_inst all.php
    Here's one cool though unrelated screenshot of Bochs running the Win98 Installer in Linux. Bochs isn't nearly as fast or stable as VMWare, but it is free and Open Source, and runs on other platforms like PowerPC.

  63. Re:Windows by ceswiedler · · Score: 2

    I don't remember how memory allocation works under DOS/BIOS; writing data to disk was indeed done using the BIOS, same with TSR applications and console string handling.

    DOS was implemented in BIOS calls. It was a completely "userspace" application. It could be replaced by (bootable) applications, such as games, which were willing to manage their own files.

  64. Obsolescence of the information by Anonymous Coward · · Score: 0

    I don't see why anyone would want to read this book. From what I can gather, it teaches 16-bit real mode assembly, and DOS specific programming. These two things are completely obsolete and should not be paid attention by anyone. I'm amazed that people still find value in these two topics. Intel itself has stated that 16-bit real mode should _only_ be used to transition to 32-bit mode. It is merely a holdover from a more primitive system architecture, when people were just starting to make the transition to native protected mode on the PC architecture.

    In my opinion, the only worthwhile texts on assembly that might be necessary are the Intel Developer's manuals, which detail most everything an OS or compiler developer would need to know - those two categories of programmer who still need to learn assembly.

  65. Re:Windows by scot4875 · · Score: 1

    I don't remember how memory allocation works under DOS/BIOS; writing data to disk was indeed done using the BIOS, same with TSR applications and console string handling.

    Yeah, writing data to disk was done using BIOS calls. But DOS told the BIOS *where* to write the data, and that's what was really important. No BIOS understands FAT, AFAIK. Memory allocation was done by DOS, unless you used a protected-mode extender like DOS4GW or pmode.

    Saying that DOS was nothing but an interface into BIOS calls is an overly simplistic way of looking at what it did. And I know of no games (at least, ones that didn't have to run on a floppy), that handled their own file I/O. Maybe at a higher level (like .WAD files in Doom), but none of them told the BIOS to read/write at specific sectors on the hard disk.

    Not that any of this has anything to do with the textbook in question... But I don't think that going into OS-specific details is necessary for an assembly text. It's outside the scope of the book.

    --Jeremy

    --
    Jesus was a liberal
  66. V2OS by Lxy · · Score: 2

    If you like assembly, and think small, fast code is cool, check out V2OS (or better yet, contribute code!).

    I haven't played with it in a long time, but it looks like it's come along by leaps and bounds. The first demo used somewhere around 50 K of floppy space and encompassed a kernel, filesystem, networking, and some basic tools. It appears that there's a stronger application base now, and it probably still sits on a floppy.

    --

    There is no reasonable defense against an idiot with an agenda
    :wq
  67. helpful by Greenisus · · Score: 1

    i have the third edition at my desk. i found it useful in college to learn assembly, and i find it useful today because it makes the other people with intro java and mcse books think i'm really smart!

  68. Re:Windows by ComaVN · · Score: 1

    Erm, int 21h (used for file access, tsr, and memory allocation) is *not* a bios call. (try an int 21h call in the bootsector, it's just an iret if I recall correctly). Int 13h (disk access) *is* a BIOS call, but doesn't let you write a file, only directly to disk, which will fsck up your file system (pun intended) if you're not REALLY careful.

    About those games: those were basically OS-less games. The only thing they used the bios for was to switch video mode, read data from disk (with some custom filesystem) and get input.

    It was a completely "userspace" application.

    If that's what you call userspace, then LiLo is a userspace application too. <FALLACY TYPE="APPEAL TO AUTHORITY">Believe me, I've debugged more than enough bios and dos interrupts to know what I'm talking about.</FALLACY>

    --
    Be wary of any facts that confirm your opinion.
  69. Assembly: Why it will replace C++/Java by Anonymous Coward · · Score: 0

    Gentlemen,

    Computing is a fast-paced field. What was cutting edge yesterday is as outdated as a pet rock today. Newer, more efficient technologies are always being developed. The 8" floppy gave way to the 3.5" floppy which was later replaced by the CD-R. The acoustic modem eventually yielded to the DSL/Cable modem. Unix was overtaken by Windows XP. And so on.

    The same technology also applies to programming languages. C yielded to C++ which gave way to C#. However, the time has come for a complete paradigm shift in programming. I propose a de facto migration towards a relatively new, but promising language known as assembly.

    Most of you are probably unfamiliar with this langauge. I know I was until I chanced upon it in my community college while completing my MCSE. So allow me to give you a little background on this language:

    C++ and Java do not allow the programmer to directly access the hardware. Instead they compile into a "bytecode" which is then interpretted by a virtual machine. While very portable, this limits the speed of Java and C++ programs.

    Assembly, however, was designed to allow the programmer *direct access* to the hardware! This makes for *much* faster programs.
    Furthermore, assembly is the same language "spoken" by computers.
    Because of this, you may sometimes see assembly referred to as "machine code".

    I fear that without the support of a large corporation (the way MS has pushed Java, or Sun supported C#) assembly will fall by the wayside like many other interesting languages (Python, I'm looking at you!) Thus I hope to start a "grass-roots" movement to support assembly. I would like to see the FSF release a GNU-based assembly compiler (although they can keep the bugs that have plagued the 3.0 release of gcc which caused people to switch to Visual Studio for their Linux programming.)

    I would love to expound on the superiority of assembly over C++/Java but I'm late for my "Intro to TCP/IP" class. Those of you familiar with assembly, please feel free to educate the many ignorant C/C++/Java users on the glory of this superior language.

    Thank you and God bless!

    1. Re:Assembly: Why it will replace C++/Java by drxenos · · Score: 1

      First of all C/C++ haven't been replaced by C#. Second, C++ is NOT compile into any kind of "bytecode" or run on a virtul machine. Third, you can talk directly to the hardware. Fourth, assembly is not spoken by the hardware, and is not machine code. It is a nmeumonic representation of the machine code. You should get your facts straight.

      --


      Anonymous Cowards suck.
  70. Why not go to the source by Anonymous Coward · · Score: 0

    When i had class
    systems engineering
    we learned motorola's Z80, and used no book.
    on microprocessors' class we did HC11, with just copies of the instruction sets.
    And I learned bits of intel's on a programming lesson where we interfaced the mouse. (DOS)
    The library is plenty (well, not exactly plenty, but has at least 4 different assembly programming titles) of books. And I had the documentation for the HC11 downloaded from motorola's site.
    So I see no reason why you wouldnt go to intel's site and search manuals and instruction set there. (In fact, just a few weeks ago i got the 3 IA32 Software Developers Manual mailed, for free time reading. Not that I think I will ever memoryze everything, but they are there.)
    Besides, its bleeding edge up to date :).

  71. Not at all. You can do modular ASM by MickLinux · · Score: 0

    Back in 95 I wrote a 3D panel-drawing program, but the Binary Spatial Partition code was in C, and on a 25MHz 486 was just too slow. So I decided to write my own practice OS. Well, I didn't get that far, but I *did* make a neat little 4-k program called "Machine Shop". Machine Shop rode on top of DOS (really only needed BIOS), and would handle virtual memory functions, but also made it easy to make modular algorithms and modular data sets, swapping them to the hard disk in an intelligent fashion as memory was needed. One neat thing was that it used IRET to call in both directions. That is, if you wanted to call a Machine Shop function, you set your variables and used IRET. When Machine Shop wanted to call the app, it set its variables and gave an IRET. It worked fine, but was nonconventional. It was just a way to make sure that the same call was always used, and was easy to identify. One other characteristic was that each module also came with its own documentation (input, output, data specs, algorithm, and what it does). Once you get the modular down, then spec changes really aren't a problem. --> Oh... and DOS Debug was awesome. I didn't have the money for MASM, so I did my ASM programming with DOS Debug. When I decided I wanted a few variables, I just wrote a substitution algorithm, and combined that with .BAT files to make my own microassembler. It worked nicely, but took a few minutes.

    --
    Correct Horse Battery Staple: 72 bits of entropy. Enter "Correct H" into google. When it generates the phrase, that's
  72. Re:Windows by AlgUSF · · Score: 1

    I always was taught that lower memory holds the interrupt vector, and when int 21h is called it took the pointer from 21h and executed the interrupt handling code that 21h pointed to?

    --


    I want my rights back. I was actually using them when our government stole them after 9/11.
  73. Books To Learn Assembly? by linuxislandsucks · · Score: 2, Funny

    Heck when I was your age we used brains and thinking to reverse engineer what the asembly instructions did..

    No wonder our education system is going down the tubes!

    --
    Don't Tread on OpenSource
  74. WHOA! by Greenisus · · Score: 1

    i'm going straight to the bookstore! everybody better MOV outta my way!

  75. Non MS-DOS/Windows book by LizardKing · · Score: 2

    For those without access to an x86 machine, but who do have access to a Sun box, I can wholeheartedly recommend "SPARC Architecture, Assembly Programming, and C" by Paul. I learnt assembly programming from it, then x86 assembly with NASM and a PDF I found on the web. The SPARC architecture seems much more coherent, and Paul's book was actually an enjoyable read - not what I ever expected to say about a book on assembly language programming.

    Chris

  76. The $ idea by xiox · · Score: 1

    The $ ending a string idea dates from at least CP/M. When you passed a string to print to BDOS (Basic Disk Output System), you terminated it with a special character (set with another system call), traditionally $.

    Sigh, CP/M - no directories, but you did have passwords on files!

  77. Is this suitable for veteran asm programmers? by Anonymous Coward · · Score: 0
    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 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. Does this book fall into that category? If not, can anyone name a book out they might recommend to me?

  78. The Art of Assembly is an excellent book by Anonymous Coward · · Score: 0

    My all time favorite book about assembly "The Art of Assembly Language Programming" by Randall Hyde. It is available at http://webster.cs.ucr.edu/AoA.html.

    I have used the third edition of Assembly Language for Intel-Based Computers and disliked it because it was very microsoft centric.

    The Art of Assembly has information about Linux, as well as Microsoft centric assembly programming. The are also some interesting teching techniques used in The Art of Assembly which I found work very well.

    1. Re:The Art of Assembly is an excellent book by Anonymous Coward · · Score: 0

      Simply amazing... I can't believe a book like this is freely available. Is it because it is beta?

  79. Hey, there's Java over here! by CCRancor · · Score: 1

    I'm just gonna stick my neck out and say: Java rocks.
    Assembly might be fast etc. but it simply to dated and machine specific to be useful.

    One thing that surprises me with open-source is the fact that there is very little support in the community for java. This is after all the language that could make Windows apps work on Linux without any extra work.

    And to be honest what's best: spending an extra 200$ on a faster computer (to make up for the slowness in java) and being able to run Photoshop etc, or sitting around with a dopey P200 and running those cute-but-fast Linux programs.

    - Waiting for Xandros

    --
    Open source is the art of letting other people write your bad code.
    1. Re:Hey, there's Java over here! by Anonymous Coward · · Score: 0
      Well, one reason Java may not be well accepted in the open source community is because it is proprietary, and owned by Sun, who is only putting it's toe in the waters because open source is the 'latest fad' (and it really is) and Sun feels like they can make money using Open Source.

      I don't know about you, but I'd like to be Free of Microsoft's, or anyone's grips. I don't want to be so dependant on Windows software that people waste thousands of man hours on projects like Wine, which could be spent writing decent software.

      Another thing to mention is that, last I checked, the goal here isn't to make MS software on Free Software operating systems - which Wine does(kindof), and Java doesn't, nor was it planned to, anyways. For you kiddies who weren't around for the early days of Java - remember Suns original goal was to 'hook' everyone on Java, because it was soooooo revolutionary, which would make everyone dependent on Sun, rather than MS. Is that any better? Java would've had a chance, and only that, if it were Open Source, then it would be available on any os, but as things stood, and may stand now(I havn't checked lately), you had to buy a license from Sun, which defeats the entire purpose of 'Write once, run anywheres', and we all know that Billy is too smart to jump on that bandwagon, Killer Apps are what make OS's sell.

      Java may be somewhat popular now - but I don't see what's so special about it, for a Free, OpenSource, readable OO language, try Python.

      My2C

  80. Oh dear by Anonymous Coward · · Score: 0

    Another fuckwad who things he knows everything.

    1. Re:Oh dear by Reality+Master+101 · · Score: 1

      Now, now, just because I know everything doesn't mean you have to get snippy. Be assured that I use my powers for good, and not evil.

      --
      Sometimes it's best to just let stupid people be stupid.
  81. hand-rolled assembly is good for one thing by Anonymous Coward · · Score: 0
    Compilers can produce much more "pretty good" code than any human could (without going insane, at least), in a much, much shorter period of time. But I've never yet had the compiler beat me on size and speed simultaneously on any individual calculation-intensive function I've coded by hand.

    Of course that's true. You're taking a small well-understood problem and you're optimizing past the constraints of the higher-level language. However, that is not where compilers excel. Compilers are good at examining large amounts of complicated data and producing good results. In other words, a compiler is good when you have fifty source files containing eight hundred functions passing around complicated data structures between each other. Sure, you could write that in assembly. But the compiler will beat you every time without resorting to optimization tricks that break the strict correctness checks. It can do register allocation across the board and function inlining recursively and data alignment to aid in cache hits and many other things you cannot because your mind cannot encompass it all. Claiming that you can do better on a small domain of the problem is a misleading anecdote.

    1. Re:hand-rolled assembly is good for one thing by Mr+Z · · Score: 1

      Still, you wouldn't know why the compiler is better than you are without understanding the principles behind the eventual assembly language.

      Compilers do many tricks, but often times they need help from the programmer to know it's safe to do them. For instance, knowing minimum trip counts, pointer alignment, pointer aliasing information and so on can help a compiler dramatically, especially if such information is not immediately obvious from the code but is necessary to enable a class of optimizations.

      Another factor is the type of architecture involved, and the delta you're willing to live with. I estimate that on most compute-intensive loops, GCC for x86 is off from my most-optimal hand code by as much as 50% (meaning, it runs half as fast, or takes twice as long as my code). For nearly anything I write on x86, that's perfectly acceptible and I don't write a single line of x86 assembly. In contrast, in DSP space, where cycle counting is a way of life, our compiler gets to 80% to 90% of hand-code performance on most of those compute-intensive codes, but we still hand-code. Why? Because those inner loops are 80% to 90% of the total run time and it can make the difference between 90 channels and 100, and that translates into $$. (Alternately, it can mean the difference between making a realtime deadline or not, which is even more important.)

      Elsewhere, you said: "Claiming that you can do better on a small domain of the problem is a misleading anecdote." I don't think it's particularly misleading. I know better than to spend my time coding large stretches of branchy control code, but I also know that I could easily beat the compiler if I chose to do so. Only, it could take me days or weeks to get something that runs well as compared to minutes with the compiler. And that's why we have the compiler. :-)

      Assembly is for the hotspots. You need to understand assembly to understand why the hotspots are hot and what to do to cool them off a bit.

      --Joe
  82. Stop being wusses by Anonymous Coward · · Score: 0

    Real assembler coders read the uP datasheets and just grok it. Instant karma. Maybe it's a generational thing, but once upon a time there were no textbooks. (Gasp!) There's nothing wrong with using a book if it's there. (In fact you're a lunkhead if you don't make use of all the tools you've got!) And God bless the people who try to write good books. And pay the people who actually do write good docs. But if you need a book, maybe you should consider another endeavour. Suck it up. Be a Mensch.

  83. If you're really nostalgic about Assembler.... by clintp · · Score: 1
    And you want a quick fix, stop by the Parrot project. This is the runtime engine for Perl 6.

    If you want you can code directly in PASM (Parrot Assembler) or help write some of the tools that parse real languages and emit PASM. It's not a particularly small assembler like 6502 (but it can be if you really want!) but still has that small-system feel.

    I got my Assembler fix this past spring with Parrot BASIC (link is PDF).

    --
    Get off my lawn.
  84. What if you already know assembly programming by TimMann · · Score: 1

    ...but not for x86? Is there a good book to bone up on the details of the x86 that doesn't start with "this is a 0, this is a 1"?

    I've done extensive assembly language programming for Z-80, and small to moderate amounts for 68000, PDP-10, PDP-11, VAX, and Alpha, but managed to avoid the x86 until I took my current job. Here most of what I do is well above the assembly level, but it would occasionally help to be fluent in x86 assembler.

    I suppose the answer is to just read over code with the Intel manuals in hand to look things up, until I get to where I don't have to look up so much anymore. But I was hoping for something less tedious.

    1. Re:What if you already know assembly programming by Anonymous Coward · · Score: 0

      If you know virtually any other 16/32-bit architecture assembly language, x86 will come as a horrible shock of the "why the hell did they do it that way? That's just bloody stupid" sort.

      This is particularly true if you come from an amiga/motorola background: M68k assemblers were all "macro assemblers" - you can't even take for granted that an x86 assembler will have a decent macro facility enabling one to write properly abstracted (macro)assembler code. In fact "abstracted assembler code" is routinely considered an oxymoron in x86 assembly circles, largely because the asymmetries of the x86 arch makes powerful assembler macros extra-difficult to write even when the x86 assembler includes macros (like NASM or gas+gasp)

      Amiga-style PPC assemblers like StormPowerAsm gave the same macrology to PPC.

  85. Re:Windows by oliverthered · · Score: 1

    you can kick dos straight into pmode and really play around with the processor(task-switching, calling 16bit dos/bios interupts) without having to worry about a kernel.

    --
    thank God the internet isn't a human right.
  86. MenuetOS by X-Nc · · Score: 1

    You can also look at MenuetOS for an example of an ASM OS. It's a complete OS with GUI that fits on a 1.44" floppy. It is very nice to see.

    --
    --
    If I actually could spell I'd have spelled it right in the first place.
  87. Start with Turing by Anonymous Coward · · Score: 0

    The Turing machine should be taught first
    (It was in my Uni days) in conjunction with Von Neumann architecture.

    thenassembler, followed by high level languages like C.

    End user scripting tools like basic should be left to the arts students.

  88. What about a book on AT&T assembly ? by elflord · · Score: 2

    I'd really like to be able to read the output of gcc, but most assembly language books deal with Intel syntax, while gcc outputs AT&T syntax. Are there any decent books for someone interested in reading gcc output ?

  89. if you think assembly is useless... by timbong · · Score: 1

    look at this program, a 3d raytraced tube, written in assembly in 32 bytes here.

  90. AH... Assembly!! by Anonymous Coward · · Score: 0

    I took an assembly course for my computer science degree and all I can say WOW! By the end of the semester I felt like just laying down on the floor and just twitching.... twitching..... twitching..... twitching..... twitching..... twitching..... twitching..... twitching.....

  91. x86 assembly is a bad teaching language by khuber · · Score: 2, Interesting
    I'd done a small amount of 6510 (gradeschool) and x86 (high school) programming before I took assembly language and computer architecture in college.

    Our assembly class was based on some invention of the professor's. It used a virtual machine and its own language. It probably would have been better to use something like z80, but it was okay. For me the class was rather pointless except for the project to write an assembler.

    We used the Hennessy book for architecture which is of course MIPS based. I thought that was a great assembly language for learning RISC and stuff like pipelining.

    After college I taught myself Motorola 68k assembly. Wow! That is the most elegant assembly language I've ever used. x86 assembly in contrast is very odd and clunky. I'm curious what PPC is like, but I haven't studied it.

    For Computer Science I think it is better to learn the general concepts such as memory hierarchies, superscalar design and pipelining, etc., and focus on generic 32 bit RISC architecture. I think that will serve students far better than learning x86.

    If you're not motivated enough to learn any specific language, assembly or otherwise, on your own anyway, I think you're in the wrong field!

    -Kevin

  92. INTEL -- Just Short of INTELligent by Black+Copter+Control · · Score: 1
    The 8086 is a horrid CPU arch. -- the unfortunate thing is that that's precisely why it's so popular.

    Back in the late '70s, we had 8 bit microcomputers (Z80, 8085, 6502 (risc without the registers), 6800, 6809 (ah, the 6809... Now THERE was a nice 8bit CPU!)) All these machines were pretty similar. 16 bit address spaces and 8 bit registers (sometimes combinable into 16 bit registers for some operations)

    One of the more popular CPUs was the Intel 8080. Zillog cloned (and improved on it) with the Z80 and Intel's answer to that was the 8085. Those 3 CPUs were used for the CPM operating system.

    The 6502 was the other popular chip (family)-- used in the Apple II, and Comodore 64 families (among others).

    Motorola's 6800 series were a bit less common, but the 6809 was used in the Radio Shack Color Computer. The 6809 was pretty late in the 8-bit CPU era, and was (IMHO) one of the nicest 8-bit CPUs out there.. It had hardware multiply (8x8 ->16 bits) 2 index registers, and a nice, clean instruction set.. and it allowed easy coding of completely relocatable code with 16 and 8 bit relative address references -- including jumps. (but I digress).

    When it came time to create a 16bit computer, the different manufacturers went different ways. Motorola, Zillog and National Semiconductors all decided to essentially redesign their CPUs from scratch.

    My experience was with the Motorola 68000. It was pretty much a cross between the PDP-11 and the IBM/370 processors. It had 16 32-bit registers split between 8 General Purpose registers and 8 address registers (one of which was the stack). Although the original 68000 'only' had a 16Meg address space, it was only because they only brought out 24 of the 32 available address bits (although there was a version of the 68000 with all 32 bits available). All in all, a reasonably nice processor to program for. It was a 16 bit processor with one foot firmly planted in the 32 bit world.

    Intel, on the other hand, decided to build a machine that was backwards compatible with the 8085. The 8086 had a base 16 bit address space with a bunch of 16 bit index registers that shifted the 64K address space in increments of 16 bytes. It also had two (relatively) general-purpose address registers a stack and the program counter. It was source code compatible with the old 8085 instruction set (all you had to do was set all the index registers the same, and you had a pretty good rendition of an old 8-bit processor. It was a 16 bit processor with one foot firmly planted in the 8 bit world.

    In truth, what the 8086 did was it formalized the kludgy practice of 'bank switching' which was used by 8-bit hardware designers to get beyond the 64K RAM limit. The Index registers made address math into almost a crap-shoot, because there were 4096 ways to address any given byte (combinations of index registers and 16 bit offsets), and you had to decide between address spacees -- small (all index registers the same) was the easiest, but limited you to 64K for each of code, data and stack). Medium allowed you more space, but nothing could be larger than 64K. Large gave you the full 1Megabyte address space -- and 'unlimited' object sizes within that constraint, but you then had to deal with the horrid addressing scheme. Everytime you accessed any data, you'd have to separately load/calculate the index and address data).

    So why would such a horridly designed CPU take over the world?? As one friend of mine used to say "It had 3 things going for it .. I B and M.

    As a market driven company (much like Microsoft is now), IBM saw the microcomputer revolution coming, and wanted control of it -- but it had a problem.. Most of the new 16 bit processors were 32 bit machines in waiting -- With 32 bit address spaces, lots of 32-bit registers and the ability to do 32 bit math. Their basic designs weren't that far from the power and ease of IBMs multi-million dollar system/370 CPUs. As such, they were a pretty clear threat to their bread-and-butter mainframe market.

    One exception to this was the Intel 8086. With an intrinsic 1Meg address space (Who'd ever need more than 640K anyways?), a couple of 16 bit registers and a hard time dealing with structures larger than 64K, the 8086 -- while able to claim the '16-bit' processor name, was such a hobbled design, that it would never be a real threat to IBM's mainframe architectures. Thus the Intel CPU was chosen for the IBM Personal Computer.

    Not in spite of the fact that it was a brain-dead processor design -- but because of it.

    Intel -- Just short of Intelligent.

    --
    OS Software is like love: The best way to make it grow is to give it away.
  93. Why learn assembly? by dolmen.fr · · Score: 1
    Try to implement the two following code snipnet in assembly:
    ---8<---8<---
    int n=50;
    for(int i=0; i<n; n++)
    print "OK";
    ---8<---8<---
    int n=50;
    for(int i=n; i>0; i--)
    print "OK";
    ---8<---8<---
    If you use the instruction set appropriately you'll understand that the second loop is more efficient because "loop if i>0" because there is a special opcode that can do that in just one instruction, whereas "loop if i>n" may require more.
  94. Free alternative by Angst+Badger · · Score: 2

    Those wishing to dig into Intel assembly language without shelling out seventy-some-odd bucks can download the PDF version of The Art of Assembly Language . IMHO, it's pretty good, and weighs in at about 1200 pages -- there's more there than you'll probably ever use. I no longer recall if there's a complete guide to the Intel instruction set in the book, but you can, unsurprisingly, get that from Intel's site.

    --
    Proud member of the Weirdo-American community.
  95. Re:Non MS-DOS/Windows book - SPARC Assembly by Anonymous Coward · · Score: 0

    Actually, the Paul book is good if you can ignore his desire to use the m4 macro preprocessor and get down to the real assembly. Also, keep in mind the 3rd edition of the Paul book is still only for SPARC v8 - i.e. SuperSPARC, not the UltraSPARC. As always, the ultimate source is the SPARC whitepaper in either hardback or downloaded from www.sparc.org.