Slashdot Mirror


Learning Computer Science via Assembly Language

johnnyb writes " A new book was just released which is based on a new concept - teaching computer science through assembly language (Linux x86 assembly language, to be exact). This book teaches how the machine itself operates, rather than just the language. I've found that the key difference between mediocre and excellent programmers is whether or not they know assembly language. Those that do tend to understand computers themselves at a much deeper level. Although unheard of today, this concept isn't really all that new -- there used to not be much choice in years past. Apple computers came with only BASIC and assembly language, and there were books available on assembly language for kids. This is why the old-timers are often viewed as 'wizards': they had to know assembly language programming. Perhaps this current obsession with learning using 'easy' languages is the wrong way to do things. High-level languages are great, but learning them will never teach you about computers. Perhaps it's time that computer science curriculums start teaching assembly language first."

218 of 1,328 comments (clear)

  1. Linux x86 assembly? by agm · · Score: 3, Insightful

    Is "Linux x86 assembly" any different to any other kind of "x86 assembly"?

    1. Re:Linux x86 assembly? by shaitand · · Score: 5, Informative

      It is in the same fashion that win32 asm is different from linux asm. The core is the same but knowing the core of x86 assembler is going to get you far if what you are wanting to do is talk to the kernel.

    2. Re:Linux x86 assembly? by dysprosia · · Score: 3, Insightful

      I think what is meant is programming in assembly under Linux. Programming in assembly under Linux is different than say programming in assembly under DOS/Windows, for example.

    3. Re:Linux x86 assembly? by pla · · Score: 5, Interesting

      Is "Linux x86 assembly" any different to any other kind of "x86 assembly"?

      Yes. Although it requires understanding the CPU's native capabilities to the same degree, Linux uses AT&T syntax, whereas most of the Wintel world uses (unsurprisingly) Intel/Microsoft syntax.

      Personally, although I far prefer coding C under Linux, I prefer Intel syntax assembly. Even with many years of coding experience, I find AT&T syntax unneccessarily convoluted and somewhat difficult to quickly read through.

      The larger idea holds, however, regardless of what assembler you use. I wholeheartedly agree with the FP - People who know assembly produce better code by almost any measurement except "object-oriented-ness", which assembly makes difficult to an extreme. On that same note, I consider that as one of the better arguments against OO code - It simply does not map well to real-world CPUs, thus introducing inefficiencies in the translation to something the CPU does handle natively.

    4. Re:Linux x86 assembly? by skurk · · Score: 5, Interesting

      You have a good point. I code assembly on many different CPU's, and I can only see a minor difference between them

      For example, on the 6502 family (like the 6510 from the C64), you have only three registers; X, Y and A. These registers can only hold a byte each. Most of the variables you have are stored in zero pointers, a 255-byte range from address $00-$FF.

      Then the 68k CPU (as in the Amiga, Atari, etc) you have several more registers which can be used more freely. You have D0-D7 data registers and A0-A7 address registers. These can be operated as bytes, words or longwords as you wish, from wherever you want.

      The x86 assembly is written the "wrong way", and is pretty confusing at times. Where I would say "move.l 4,a6" on the 68k, I have to say "mov dx,4" on the x86. Takes a few minutes to adjust each time.

      Once you master assembly language on one CPU, it's pretty easy to switch to another.

      I still think the 680x0 series are the best.

      --
      www.6502asm.com - Code 6502 assembly or.. DIE!!
    5. Re:Linux x86 assembly? by shaitand · · Score: 4, Informative

      Your post makes no sense unless you were confused by my mistype, I meant to say "the x86 core ISN'T going to get you far if what your wanting to do is talk to the kernel". Parts of the kernel ARE in assembler, and the bootloader is largely in ASM.

      So in truth, the kernel is the car. Asm can be the road, it can be the engine, it can be the passengers, it can be the wind resistance, it can be virtually any component. But nonetheless, if your writting an application sitting on top of the kernel you are going to need to speak to the kernel's api at some point (or the api of a layer sitting on top of it), just as if your writting a windows application in asm or c, or vb, you need to be speaking to the win32 api.

      Asm is no different than any other language, knowing the language is great and all, but it's worthless without learning the proper api's you'll need to actually write a program that does something. That's a major flaw in most programming tutorials. They'll teach C or another language and not mention a single word about the api's one needs to know to actually write a program that does more than calculate pie.

    6. Re:Linux x86 assembly? by perky · · Score: 5, Insightful

      On that same note, I consider that as one of the better arguments against OO code - It simply does not map well to real-world CPUs, thus introducing inefficiencies in the translation to something the CPU does handle natively

      maxim: cycles are cheap, people are expensive. For the *vast majority* of software it is significantly better value to design and build a well architected OO solution than to optimise for performance in languages and methodologies that are more difficult to implement and maintain. Who cares if it's not very efficient - it'll run twice as fast in 18 months, and will be a lot cheaper to change when the client figures out what the actually wanted in the first place. But I guess you already knew that.

      --
      "The new wave is not value-added; it's garbage-subtracted" - Esther Dyson, Dec 1994
    7. Re:Linux x86 assembly? by MarcoAtWork · · Score: 2, Interesting

      I still think the 680x0 series are the best.

      amen! as somebody who in the days of yore coded a Mandelbrot viewer on an Atari ST (68000) using only integer arithmetics (also shifts instead of muls whenever possible as the 68000's MUL was so slow, at the time I would've killed for the 68000 to have a barrel shifter though) and registers I can certainly sympathize with that: x86 CPUs always seemed to have way too few registers for my taste.

      --
      -- the cake is a lie
    8. Re:Linux x86 assembly? by ncc74656 · · Score: 2, Informative
      Is "Linux x86 assembly" any different to any other kind of "x86 assembly"?

      Given that most Linux-based assemblers use AT&T syntax and most other x86 assemblers use Intel syntax, yes. This page summarizes some of the most significant differences (operand order, operand prefixes, etc.).

      There's also the small matter of talking to the host OS. The difference between x86 assembly coding on Linux and x86 assembly coding on Win32 is comparable to the difference between 6502 assembly coding on the Apple II and 6502 assembly coding on the Commodore 64. Just as JSR $FDED does one thing on the Apple II (print the character in the accumulator) and does something completely different on the Commodore (crash?), making Linux calls to Windows is not likely to work too well.

      --
      20 January 2017: the End of an Error.
    9. Re:Linux x86 assembly? by pla · · Score: 5, Interesting

      maxim: cycles are cheap, people are expensive.

      True. This topic, however, goes beyond mere maximizing of program performance. Pur simply, if you know assembler, you can take the CPU's strengths and weaknesses into consideration while still writing readable, maintainable, "good" code. If you do not know assembly, you might produce simply beautiful code, but then have no clue why it runs like a three-legged dog.


      it is significantly better value to design and build a well architected OO solution

      Key phrase there, "well-architected". In practice, the entire idea of "object reuse" counts as a complete myth (I would say "lie", but since it seems like more of a self-deception, I woun't go that far). I have yet to see a project where more than a handful of objects from older code would provide any benefit at all, and even those that did required subclassing them to add and/or modify over half of their existing functionality. On the other hand, I have literally hundreds of vanilla-C functions I've written over the years from which I draw with almost every program I write, and that require no modification to work correctly (in honesty, the second time I use them, I usually need to modify them to generalize better, but after that, c'est fini).


      Who cares if it's not very efficient - it'll run twice as fast in 18 months

      Y'know, I once heard an amusing joke about that... "How can you tell a CS guy from a programmer?" "The CS guy writes code that either won't run on any machine you can fit on a single planet, or will run too slowly to serve its purpose until technology catches up with it in few decades". Something like tha - I killed the joke, but you get the idea.

      Yeah, computers constantly improve. But the clients want their shiny new software to run this year (if not last year, or at least on 5-year old equipment), not two years hence.

    10. Re:Linux x86 assembly? by Endive4Ever · · Score: 5, Informative

      Well, some of us code assembly on bare hardware. We have to roll our own 'api' and include it in there with the rest of the code.

      I've worked before with programmers who had little experience in programming 'bare hardware'- they do really foolish things like not initing timers, setting up stack pointers, and the like.

      Writing bare ASM code for a processor (where it boots up out of your own EPROM or on an emulator) is good experience in minimalism. It can give you a good feeling when the project is all done and you can say you did it all yourself.

      For those interested in getting into this kind of thing, start with a PIC embedded controller and a cheap programmer. You can get PIC assembly language tools for free, and build a programmer, or buy a kit for a programmer, that plugs into your serial or parallel port. Your first PIC machine can be the CPU, a clock crystal, a few resistors and capacitors, and the LED you want to blink, or whatever other intrigues you. If you're not into complex soldering, and/or layout and complex schematics, you can buy pre-etched boards you just plug the PIC into.

      Another easy-start processor would be the 68HC11. It has a bootstrap built into ROM. Basically, you can jumper the chip so it wakes up listening on the serial port for code you send down the wire at it, and burns it into the EEPROM memory in the 'HC11 chip itself. Move the jumper and reboot the chip, and it's running your code.

      I think this is far more interesting that just writing apps that run on an Operating System you didn't roll yourself.

      --
      ---
    11. Re:Linux x86 assembly? by bmac · · Score: 2, Interesting

      I agree with you in general, but I feel that OO's problems reside in that it should just be a way to organize code. If the OO folks just kept the perspective that an object is just a data definition and a bunch of functions whose first parameter is that data type, the mapping would be no different than C's mapping.

      Because they have had the desire to create layer upon ugly layer of syntax, the language just doesn't map down, as you say. Look how long it took to get a decent C++ compiler (5+ years). As well, the basic idea of data structure + associated functionality has been totally lost in the jumble of inheritance and public/private/protected.

      That said, I do disagree that an assembly programmer will fail the "object-oriented-ness" test. As stated at the start, it's all a matter of organization, and, IMO, that is where success or failure is determined. Sure, organizing a project that uses an OO lang is going to be easier than organizing a project that uses assembler, but that doesn't mean that it can't be done. If you look at my journal you'll see how much I value code organization ~ I say it determines the success of the project, regardless of prog lang choice.

      Peace & Blessings,
      bmac
      for true peace & happiness: www.mihr.com

    12. Re:Linux x86 assembly? by whittrash · · Score: 3, Funny

      I don't know why, but just saying the words 'assembly language', sends a chill down my spine. I guess I am too weak minded to learn it.

    13. Re:Linux x86 assembly? by afidel · · Score: 4, Insightful

      True. This topic, however, goes beyond mere maximizing of program performance. Pur simply, if you know assembler, you can take the CPU's strengths and weaknesses into consideration while still writing readable, maintainable, "good" code. If you do not know assembly, you might produce simply beautiful code, but then have no clue why it runs like a three-legged dog.

      About .1% of code needs to be so optimized that CPU architecture matters. For the other 99.9% speed improvements are much more likely to come from algorithmic improvements. Not only that but real world experience shows that code written in ASM is NOT maintanable, the indepth knowledge of a specific architecture is fleeting while knowledge of most high level languages lasts a LONG time.

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    14. Re:Linux x86 assembly? by HeyLaughingBoy · · Score: 2, Insightful
      Did you ever stop to think about what the world would be like if people actually wrote optimized code all the time?

      Yup. There'd be no software.
    15. Re:Linux x86 assembly? by vsprintf · · Score: 4, Interesting

      I don't know why, but just saying the words 'assembly language', sends a chill down my spine. I guess I am too weak minded to learn it.

      Maybe individual brains just work in different ways. In school, I knew some people who were good with high-level languages but just couldn't hack assembler. They could not get down to that absolute minimal step-by-step instruction level. I'm not sure what that says about those of us who use assembler. :) BTW, I certainly don't advocate assembler as a first computer language - second, perhaps.

    16. Re:Linux x86 assembly? by PylonHead · · Score: 2, Insightful

      And what software there was would be impossible to modify.

      --
      # (/.);;
      - : float -> float -> float =
    17. Re:Linux x86 assembly? by pla · · Score: 4, Insightful

      For the other 99.9% speed improvements are much more likely to come from algorithmic improvements.

      Gack! I perhaps have phrased myself rather poorly. Throughout this entire thread, I have not meant to refer to writing even a single line of actual assembly code. I don't mean that humans can do it better than compilers (though often true, for small sections of code), I don't mean that asm always runs faster than the comparable C (again, often true), and I don't in any way mean that asm reads more clearly than a high-level language (about as false as they come).

      Perhaps an example would help...

      In C, I can make a 10-dimensional array (if the compiler will let me) as a nice, easily-readable organization of... Well, of something having 10 dimensions (superstrings?). I can make a pointer to a structure that contains an array of pointers to linked lists (which sounds obscure, but I can imagine it as a straightforward way to implement, say, a collection of variable-length metadata on a set of files). I can choose to have my loop indices run in row-major or column-major order, with no high-level reason to choose either way.

      From an assembly point of view, I realize exactly the hellish task involved in dereferencing the first two example. I realize that row-major vs column-major ordering has a significant impact on the quantity of dereferencing needed. Even further, I realize that by choosing row-major or column-major indexing, I can ensure cache integrity, or obliterate it.

      The specific examples I just gave perhaps seem absurdly obvious to any decent programmer. But countless other, more subtle, differences in how I would choose to lay out my code, come from an understanding of what the compiler will likely do with that code, and how the CPU will eventually have to deal with it. Rather than having a superficially obvious relation to the CPU, such choices would look more like stylistic preferences than careful decisions with significant implications to performance.

      How about the size of an array, for example? Sometimes using a power of two will help immensely (if it allows a constant shift vs a multiply), and sometimes it will hurt immensely (if you plan to use it such that almost every access competes for the same cache line). Things like that, which a high-level-only programmer simply will not know without experiential (ie, programming in assembly) knowledge of the underlying architecture.

    18. Re:Linux x86 assembly? by geekoid · · Score: 2, Insightful

      it's the same excuse when people say "all programs have bugs". While that may be true*, it has become an excuse for sub-standard programming, applications, and has let managme ship products befor they are done.

      If applications were built like this in the 70's, we wouldn't have a computer industry.

      I do not believe that needs to be true, and should become less true as the software industry matures. For some reason it doesn't seem to be maturing.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    19. Re:Linux x86 assembly? by Ralpht · · Score: 2, Insightful

      Well architected OO solution ???????? You mean bloatware don't you? As well, 'well architected' and OO are contradictory terms. If you hand craft in assembler, you then will get well architectured code. Even though it may take 10 times as long to write, it will be 100 time more efficient and a hell of a lot smaller (assuming the programmer is competent in assembly and a OO language). As for running twice as fast in 18 months - no way. Like I mentioned before, bloatware effectiveley prevents newer code from running faster on faster machines. Using assembler, code will automatically run faster on faster machines, it's the nature of the beast because it directly translates into machine code. Bloatware OO caode eventually does as well but nowhere as elegantly or efficiently as assembler. If its not very efficient, then its done by a piss poor programmer. I'd rather have a programmer working for me who is efficient even though (s)he is slower, not someone who slaps crap code together quickly because the oo language allows him to.

    20. Re:Linux x86 assembly? by Daytona955i · · Score: 4, Informative

      That all depends on what you are doing... if you are doing it for fun then yes, I agree with you... however, if you are a programmer who picked up learn c++ in 24 hours, and now call yourself a coder, you have a lot to learn, and x86 asm might be the place to start.

    21. Re:Linux x86 assembly? by tjb · · Score: 2, Interesting

      First off, while I am not a Linux expert, I imagine that Linux would allow you more freedom to actually do stuff like mess with interrupt vectors and system resources (aasuming you are running at the correct privelege layer) whereas from my minimal exposure to Win32 driver-layer assembly, it seemed you are rather restricted in some regards.

      IMHO, DOS is the perfect OS to learn assembly-language programming on - no restrictions at all (and fast reboots when you fuck up). But maybe I'm just biased because I program DSPs with no operating system whatsoever :)

      Tim

    22. Re:Linux x86 assembly? by Kosgrove · · Score: 4, Interesting

      I disagree. Assembly has little to nothing to do with either programming or computer science anymore. Computer science (IMHO) deals with the study of software engineering and algorithms (network protocols, etc). Computer engineering deals with custom integrated circuit development, including processor architecture.

      I learned assembly as an undergraduate at Penn State (before attending a year of grad school at Drexel), but what I got out of the course had far more to do with understanding architecture (something not relevant for most developers, but much more relevant for hardware engineers).

      Assembly does not have any of the high-level features (OOP, libraries, etc) features that developers need to know these days. It's rarely used, even in embedded programming since C/C++ compilers have gotten quite efficient and are available even for open-core (similar to open source) procesors for use on FPGA's.

      On the other hand, assembly is important to know for computer engineering undergrads and graduates interested in architecture, and having taught in the CompEng department there, I can say that the depth of assembly in the cirriculum there is not sufficient.

    23. Re:Linux x86 assembly? by gweihir · · Score: 4, Insightful

      Not only that but real world experience shows that code written in ASM is NOT maintanable, the indepth knowledge of a specific architecture is fleeting while knowledge of most high level languages lasts a LONG time.

      That is not the point. The point is that knowing one assembly language gives far more insight into what higher level languages actually do. It is, e.g., very difficult to explain the actual workings of a buffer-overflow exploit to somebody without any assembly knowledge. Or what a pointer is. Or what pageing does. Or what an interrupt is. Or what impact the stack has and how it is being used for function arguments. Or how much memory a variable needs....

      The only processor I know that actually made assembly programming almost a c-like experience was the Motorola 68xxx family. On the Atari ST, e.g., there were complex applications writen entirely in assembly. Today it would indeed be foolish to do a larger project in assembly language, but that is not the point of the book at all.

      Bottom line: You need to understand the basic tools well. You don't need to restrict yourself to their use or even use them often. But there is no substitute for this understanding.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    24. Re:Linux x86 assembly? by OECD · · Score: 4, Funny
      I think this is far more interesting that just writing apps that run on an Operating System you didn't roll yourself.

      What, you don't build your own processors? What fun is that?

      --
      One man's -1 Flamebait is another man's +5 Funny.
    25. Re:Linux x86 assembly? by Breakfast+Pants · · Score: 4, Insightful

      To me, not teaching assembly in a CS major would be insane. It would be like teaching physics without any of the history of how it was discovered and without showing how to derive the various equations from the more fundamental equations. My first 3 semesters were in java. My fourth semester I was in a C, Assembly, and an intro ECE class and I am very glad that I was. The combination of these 3 classes at the same time was great. Sometimes it is a lot more helpful to learn why something works or how something works than just learning (heard countless times in my java classes) "Oh don't ask questions about that, its not something you need to know. Java handles this for you automatically." If you want it to only be taught like that thats great; just don't expect any of your students to ever create the next java.

      Also, you do know that compilers are written by programmers don't you?

      --

      --

      WHO ATE MY BREAKFAST PANTS?
    26. Re:Linux x86 assembly? by texaport · · Score: 5, Insightful

      Assembly has little to nothing to do with either programming or computer science anymore. Computer science (IMHO) deals with the study of software engineering and algorithms

      If it truly is a science, then someone who finishes a Bachelors and Masters program in Computer Science had better be capable of contributing to the advancement of this field.

      This could be through the development of new languages, in which case I hope they know a thing or two about assembly in the first place.

      Otherwise, a couple of Computer Science degrees would simply mean someone is a techno-wonk, a professional student, or just a technician rather than a professional engineer/scientist.

      --
      Disclaimer: 90% of the programmers out there do not
      need a Computer Science degree, and 90% of the jobs
      out there for developers don't need CS graduates

    27. Re:Linux x86 assembly? by YouHaveSnail · · Score: 4, Insightful

      I have yet to see a project where more than a handful of objects from older code would provide any benefit at all, and even those that did required subclassing them to add and/or modify over half of their existing functionality.

      Have you never used a decent class library? Writing reusable classes requires a much more careful approach to design and implementation than writing classes for one time use, and most people can't afford to spend that kind of time. The power of reusability lies in the fact that I can go out and buy a library of useful classes and feel pretty good that the code therein has already been well tested, usually at much lower cost and higher quality than I could produce myself.

      Whether it's building a user interface with PowerPlant, Cocoa, or MFC, or manipulating data with STL, the amount of code that I reuse far exceeds the amount that I write myself.

    28. Re:Linux x86 assembly? by tjb · · Score: 2, Informative

      That's not really true - Windows, for instance, runs in protected mode, where the chip intercepts memory access and hands it off to the OS for translation which then hands it back to the chip for execution. This way, the OS (or the old DOS memory managers, if you remember them) translate your address into a flat memory model. Under this system, each application gets its own little memory sandbox - In theory, I shouldn't be able to corrupt the memory of another program unless I have both cunning and malicious intent.

      Now, what this means is that if I write a Win32 application-layer program that attempts to directly modify, say, the interrupt vector table, I'm not writing to the real interrupt vector table that the hardware uses when it receives physical interrupt signals, I'm writing to a version of it in my slice of memory, and what happens next is anybody's guess.

      In otherwords, access to memory-mapped system resources like screen-buffers and interrupt vectors is arbitrated by the OS memory manager. What I want to do may work, it may not. I imagine Linux is more friendly in this regard, but I really don't know. DOS, on the otherhand, was anarchy - there was no memory manager (unless you intentionally ran one with your application) so all requests from the application layer were carried out without any intervention.

      Tim

    29. Re:Linux x86 assembly? by efti · · Score: 3, Informative
      What, you don't build your own processors? What fun is that?

      Chip development, and particularly processor development is a hobby few people can afford. But you can roll your own CPU on a budget -- use an FPGA (Field Programmable Grid Array) where you can program the connections between the components. And there are people who do this kind of thing. You can find some of their work here

      --
      I signed up for a /. account and all I got was this crappy sig
    30. Re:Linux x86 assembly? by efti · · Score: 2, Interesting

      FPGA = Field Programmable Gate Array.

      Damn, I really have too many acronyms / abbreviations to remember these days.

      --
      I signed up for a /. account and all I got was this crappy sig
    31. Re:Linux x86 assembly? by John+Courtland · · Score: 3, Insightful

      It also gave me a better appreciation for optimization. The cycle counting, the instruction scheduling, cheap tricks that save 30 cycles here and there (like SHL a few times instead of Multiplying). I miss having that sort of control. Coding for DOS was always a learning experience too, becuase you basically had to write an OS everytime you wanted to do anything non-trivial.

      I learned Asm before I learned C, and I must say that was a good way of going about it. I'm glad I don't view C as some sort of "hocus pocus", and I never did. Everything just made sense. Now-a-days you've got Joe Blow with dollar signs in his eyes and his shiny new degree in using Java, who doesn't understand the little black box he's entering commands into.

      It sort of pisses me off, because I don't want to put gay little buzzwords in my resume like C#, or Java, or .NET. I should be able to put down "Assembler: x86, z80, s/390" and the idiot HR guy should know everything else is a simple matter of syntax.

      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    32. Re:Linux x86 assembly? by zeath · · Score: 2, Informative

      I think the point that is trying to be made is that assembly, as you said, offers the programmer the ability to understand the hardware. Through that understanding you can better optimize your code. For example, by writing assembly I know how obscenely difficult it is, relatively speaking of course, for bytes to be thrown on and off the stack. Using that knowledge, along with other basic understandings of how the assembly level code works, I can then make a better judgement as to whether I should force a function to be inlined or not.

      In the larger scheme of things, assembly won't permit you to write elaborate user interfaces or hardware-intensive functionality, but it will grant you a better understanding of the code you're writing in the higher level languages for these purposes.

      I know that a lot more of what I was doing made sense when I finally got to a low-level programming course in my junior year. Even while in that class I made frequent comments that the computer architecture course from the year before would have made a lot more sense if we had the low-level class first.

      IMHO this is an excellent concept, and would breed a new set of knowledgable programmers not only being able to program efficiently but knowing why their programs are efficient.

    33. Re:Linux x86 assembly? by wagemonkey · · Score: 2
      I learnt a lot from programming the Motoral 6502 on my BBC micro back in aeons past. The instruction set was sweet and all made sense, those were the days.
      Of course Acorn had come up with a wonderfully hackable OS and BBC Basic had a built in assembler. I remember writing routines to cope with running tape based programs from disk. The (5.25 floppy) disk interface took up more memeory and sometimes you had to load the program, patch the OS and then move the whole program down a few hundred bytes and then run it. The OS was in ROM but loaded it's address table into RAM so you could intercept a system call, run your own code and then call the real OS code - that thing was designed to be hackable from the start, and the standard documentation included memory maps, details of the hardware addressing etc. It was a dream to use - and that's not mentioning the sideways rom (or RAM if you bought solidisks expansion) and the expandability.

      Still my favourite computer and it was faster than the first IBM PC, but the 8 bit addressing limited it even with the tube interface and I was never interested in the z80 anyway.

      I still have it and some emulators for windows, I wish I had time to write an emulator for linux ......
      anyway after that I found learning C (there was no C++ in those days children) a breeze after assembler, even C pointers made sense straight away and I couldn't understand the complaints.

    34. Re:Linux x86 assembly? by Kosgrove · · Score: 2, Insightful

      I disagree. Someone with a PhD should be capable of contributing an advancement to the field. Someone with a masters should show exactly that - a mastery of the concepts in computer science or software engineering. And someone with a bachelor's should not be expected to be able to develop a new language.

      In general, working Engineers (non-PhD's, software or otherwise) don't contribute to to advancement, i.e. research papers. They work with the tools they're given to solve problems.

    35. Re:Linux x86 assembly? by RagManX · · Score: 2, Informative

      As others have pointed out, learning assembly is a way to become more familiar with the low-level stuff that can in turn help you with the high-level stuff. I learned assembly in college (Vax assembly, in fact, hehehe), and put it to use in a later job where we were using Visual Basic (version 3 at the time, on 486 and Pentium class boxen).

      My boss had written a routine for dealing with user input that allowed a user to just start typing from any field on the main input screen and the cursor would go automagically to the text input field and start a search based on the typed text. Today, that would seem trivially easy, but at the time, not many programs were doing this. The problem, though, was his handling of the typing was horribly inefficient. I could guess what was going on behind the VB code, because I know assembly and some compiler construction theory. I was able to improve the performance of his code by 3 orders of magnitude. Since the function worked on his system fine (a then top of the line Pentium), he couldn't understand why I spent time optimizing the routing. For our customers, though, many of whom were using 486s, this made a huge difference. Under his code, a moderately skilled typer could out-type his routine, and the letters would show up in a different order than typed (due to his poor coding and an interaction with how VB handled execution among several routines that got called when the cursor skipped up to the text input field). Under my routine, we could never out-type the routine, and customer calls about the function not working were eliminated. Since those calls alone made up over 5% of our help-desk calls about that product, that's a significant savings.

      And that was all from knowing enough assembly and compiler construction to intuit how VB was handling the code, and using the info to improve it. I'm not good at assembly, but I know enough to help me optimize my coding in many cases. I've done plenty of stuff like the above (but usually not as significant an improvement, because really, someone has to write some pretty poor code to allow another user to tweak that much), and others who know assembly but work at a higher level probably have similar tales.

      RagManX

    36. Re:Linux x86 assembly? by wezelboy · · Score: 2, Insightful

      I'm sorry, but saying that assembly language has nothing to do with computer science is like saying concrete and steel have nothing to do with building skyscrapers. The "features" of your high level languages have to be implemented in assembly at some point, and there are tons of crappy ideas that look great on paper but fail miserably because the theoretican had no understanding of architecture or assembly language. Interestingly the opposite happens as well, where a chip designer has an idea that looks great on paper, but fails miserably because they don't have any CS knowledge. Itanium is a good example of this.

  2. Not So New Concept by andyrut · · Score: 5, Insightful

    Although unheard of today, this concept isn't really all that new -- there used to not be much choice in years past.

    While starting Computer Science students off with assembly (without first introducing them to a high-level language) may be a relatively new concept these days, the idea of teaching low-level languages to Computer Science students is not a revolutionary technique whatsoever. Every decent Computer Science curriculum includes several semesters of courses in which assembly language is required, to demonstrate their knowledge of basic computer processes.

    That reminds me of a great fortune:

    "The C Programming Language -- A language which combines the
    flexibility of assembly language with the power of assembly language."

    1. Re:Not So New Concept by gid13 · · Score: 2, Informative

      I'm not even a CS student (I'm Engineering Physics), and I still had to learn some microcontroller assembly language.

      While I admit that it helps you understand the device more, I have to say it's much less intuitive and enjoyable than high-level programming (not that I'm the type to find scripting fun, but you know what I mean).

    2. Re:Not So New Concept by rblancarte · · Score: 4, Insightful

      I was about to say the same thing. I don't think that it is some new "mystical" idea of teaching assembly to students. I am currently taking my THIRD assembly class at the University of Texas. And I know that there are others to take.

      I will agree with the parent post, this is not a new concept. Now teaching assembly to beginners, that might be new.

      And I don't know if "great" coders know assembly, but I think knowing assembly is a useful tool in being able to program efficient code. If you understand concepts like division, how bad it is, what the computer is actually doing when your C/C++ or whatever language (that is not interpreted) is compiled, then you are well on your way to being able to produce efficient code.

      --
      It is human nature to take shortcuts in thinking.
    3. Re:Not So New Concept by Angry+Black+Man · · Score: 2, Insightful

      Win32 bit assembly (do a google search for MASM32) is actually closer to a HL language than it is to true assembly. Yet, at the same time it still manages to give you direct hooks to win dll's and whatnot.

      Otherwise, true x86 assembly is not THAT difficult to understand. People bitch and complain, but it really isn't that hard. Once you understand the concept of registers and interrupts, there really isnt that much more to it besides learning the commands. It really isnt bad at all.

      --
      the byproduct of years of oppression by the white man
    4. Re:Not So New Concept by tealover · · Score: 5, Informative

      Since this submission is nothing more than an attempt to hawk his one book, on principle I refuse to buy it. I don't like dishonesty in the submission process. He should have come out and directly admitted that it was his book.

      --
      -- You see, there would be these conclusions that you could jump to
    5. Re:Not So New Concept by Jester99 · · Score: 5, Funny

      "The C Programming Language -- A language which combines the
      flexibility of assembly language with the power of assembly language."


      The way I heard it was far drier humor: "C: The language combining the power of assembly with the ease of use of assembly." :)

    6. Re:Not So New Concept by Sire+Enaique · · Score: 3, Interesting

      It's just what somebody said earlier, it's not the language itself that's difficult to learn, it's the APIs.

      20 years ago hp calculators used ASM as their programming language - though it wasn't called asm by hp. I didn't realize it until I started learning Z80 asm and noticed it was almost the same as my hp-15C's language.

      Except for the hp-16C, those calculators weren't targetted at programmers, so I guess there must be lots of people out there who know asm without realizing they do...

    7. Re:Not So New Concept by cide1 · · Score: 5, Interesting

      I think people that have been out in the real world for a while don't realize how many languages are taught in school's today. I'm in Purdue's computer engineering program, and so far, I have had to learn c, c++, fotran, java, asm, python, bash, and ksh. I'm sure there are some others I have forgotten (like the little bit of perl I know). We also learn ABEL and VHDL, several version control systems and Makefiles. My roommate is taking an AI course right now which is all in scheme. People talk about the old days like their is lost knowledge, we still learn all that. I could write ATARI games in asm if I wanted to, but why do that when tools are available that let me do so much more? For learning, we don't have to learn assembly first anymore, you can start with any language. I think it is good to take a two pronged approach. Learn C first, and at the same time, start learning digital logic. C compilers are forgiving, and warn about obvious errors compared to assembly just doing exactly what you tell it do. When one is comfortable with both, I think learning assembly is much easier. Without this prior knowledge, you are just doing what you are told to do, you do not really understand it, and when you make mistakes, you have a harder time understanding why. After learning asm, it is easier to think like the machine, and easier to write efficient code in other languages.

      --
      -- the computer doesn't want any beer, no matter how much you think it does. NEVER, EVER feed your computer beer.
    8. Re:Not So New Concept by FreshFunk510 · · Score: 5, Insightful

      I disagree. Call me a skeptic but when he starts out his review with:

      "A new book was just released which is based on a new concept .." He feigns disassociation with the book. He could've easily said "My new book was just release..".

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    9. Re:Not So New Concept by ca1v1n · · Score: 3, Insightful

      Starting CS students in assembler isn't a new idea either. It's an old idea that some guy recycled, wrote a book about, and advertised on slashdot. Why are the old guys who started on assembler "wizards"? It's easy. Back then there weren't that many people doing it, and it was really hard. Anyone who stuck with it had to be really good.

      Now for my own rant on the topic:

      My first programming classes at the University of Virginia had me programming in VHDL and m68k assembler. This wasn't the intent of the curriculum or the CS faculty at all, but rather a result of some schedule conflicts and a first year advisor who wasn't in the CS department and didn't know any better. It was a disaster. Normally students here get their first taste of assembly in a course that works its way down to it from the high-level languages they'd been introduced to first. My pain with assembly distracted from the course material on architecture. I learned more about efficient programming during two lectures on C# than I did while banging my head against the desk writing m68k assembler.

      Anyone who has benchmarked the C++ standard template library extensively will tell you that using the fairly complicated, safely implemented data structures are incredibly fast. Using an STL deque as an array, without any deque operations, is actually faster than using an array, which is the same in basically any machine-code language, be it C++ or assembly. The STL vector is even faster.

      Moral of the story? Compilers are amazing. This has not always been the case, but it is now. Writing code in assembly results in a product that takes forever to create, is less likely to correctly handle special cases, is impossible to debug, is unreadable to those who did not write it, and often is slower than compiled high-level code. In fact, JIT compilers are getting good enough that bytecode languages are nearly as fast as well.

      It's true that assembly can often be used to get a bit of a speedup. This is why game developers will often write everything in C or C++ except for 3 or 4 functions that they'll implement in assembly. The advantages that high-level languages give for correctness vastly outweigh any miniscule performance gains in almost all circumstances. Assembly's advantages in compactness are becoming moot too, as embedded devices are now capable enough to run full-fledged operating systems.

      Aside from teaching architecture though, assembly does teach an important skill to CS majors though, and that is staying up all night to find a one-line bug that is making everything go wrong.

    10. Re:Not So New Concept by rblancarte · · Score: 2, Informative

      If you continue on the curriculum, CS 352 - Computer Architecture also teaches assembly. Depending on the section, you will either learn some IA32 or MIPS. I was also a EE undergrad about 10 years ago, then we were also taught 68000 Assembly.

      LC-2 assembly is not bad, but that class is just a light class compared to what you will learn in 352. I would say pay close attention in that class and EE 316, very useful for 352.

      --
      It is human nature to take shortcuts in thinking.
    11. Re:Not So New Concept by fingusernames · · Score: 2, Interesting

      When I was at Purdue in CS, we had to write a machine emulator, for a VAX I think. It was the companion to a CEE course, which you likely took; I forget the numbers of both. We wrote our emulator in, of all things, Pascal. We had to program in assembly and then hand translate that into binary, and manually create the binary files to feed into the emulator. It would crank, and dump the memory image to disk. We then had to look through the memory image to figure out what happened.

      Later, in a compiler course, we had to compile a subset of C++ to SPARC asm, and also use an emulator to execute that, and also do a memory dump analysis, though we did have pseudo ops to display output too.

      Also, we didn't really have any classes that taught languages and programming, per se, other than the entry level CS courses which taught using Pascal. I learned C in a EE course, FORTRAN when I was still in Aero (switching from AAE to CS, I already knew FORTRAN & C). We learned C++ specifically for a compiler course, for most of us our first time using a language supporting OO at the language level; of course, it was just a cross compiler from C++ to C, at that time. Other languages, specifically for those courses.

      Something also for you to realize is the caliber of the education you receive at Purdue. In the many years since I've left there and worked professionally, I have worked with many fellow professionals from many universities. The CS program, and the EE/CEE programs, at Purdue are among the very top. I worked at Cray Research, back in the day when Seymour was still around. They recruited heavily from Purdue for a reason: they trusted two PU CEE interns enough to be solely responsible for developing the pre-hardware emulator for the first MPP Cray machine, used for porting the OS and testing the architecture. Also at Xerox, and Motorola; also heavy Purdue recruitment. I've been in the position to interview and evaluate a good number of candidates from many universities, and I can say that Purdue is very much top tier.

      Unfortunately, lots of other universities don't have "real" CS/CEE programs. A good number are degree mills, producing graduates narrowly educated, and not well equipped to learn new technologies and methodologies throughout their career, because they were never challenged and never exposed. I have run into "CS" graduates who learned in nothing but a pure MS GUI environment, using IDEs, who never were taught how computers really work, how to develop language translation/compilers, how to develop an operating system. There are CS graduates who never have touched a Un*x command line. It's sad. The Internet driven tech bubble has, perversely, devalued CS as a curriculum it seems.

      Larry

    12. Re:Not So New Concept by Weird+O'Puns · · Score: 3, Informative

      You don't have to buy the book. You can download it from here for free in pdf format.

    13. Re:Not So New Concept by johnnyb · · Score: 3, Informative

      "I don't like dishonesty in the submission process."

      What's dishonest? It would have been dishonest had I registered a new account to make the submission. However, the way that you know that I was the author was because I _did not_ resort to dishonest tactics. I simply wrote from the third person, which is exactly how I wrote the back cover text for the book, the press releases, etc.

      I don't even spamguard my email address, because I want people to know who I am and be able to reach me easily.

    14. Re:Not So New Concept by Monty · · Score: 2, Insightful

      They teach Scheme, which doesn't have OOP, but allows you quite easily to implement your own in a good page of code. As for LISP in general, maybe you should read up a little on it before you talk about it....

      See Common Lisp and CLOS.

      This doesn't turn people off of computer science, IMO-- quite the opposite, it allows them to focus on the problem solving aspect of CS before getting down to the nitty gritty of having to deal with complex syntaxes in other languages and low-level optimization.

      This brings in another point.... Programming is all about problem solving, so why should a beginner have to worry about doing it step by step according to some arbitrary machine's low-level instruction set? It's like telling someone to learn to build houses by building his first house using only his hands and a forest-full of trees. It's educational in a masochistic way at best. It's wrong to omit it completely, but still better to teach later in education, I think....

  3. Knuth by red+floyd · · Score: 4, Informative

    Isn't that what Knuth did with his ASM language? I believe it was a synthetic assembler for a hypothetical stack machine -- hence the name ASM - Abstract Stack Machine.

    --
    The only reason we have the rights we have is that people just like us died to gain those rights. -- Cheerio Boy
  4. Somewhere in the middle... by shakamojo · · Score: 4, Insightful

    My Grandfater worked for IBM in the 70's and 80's. He did all his coding in assembly and machine language. His motto is "Anyone who doesn't know machine language has no business using a computer."

    There has to be a happy medium IMHO, and I think this is a great start. While my Grandfather was on the cutting edge of the PC revolution, he now has trouble figuring out email, etc, because he operates at too LOW a level (and I feel that he now has no business being online!). Then you have the users who have the same problems because they operate at too HIGH a level (AOL, etc...). The majority of programmers nowadays fall about smack in the middle of these two groups, but I'd argue they should be a little closer to the lower levels than they currently are.

    I learned LOGO and BASIC as a kid, then grew into Cobol and C, and learned a little assembly in the process. I now use C++, Perl, and (shudder) Visual Basic (when the need arises). My introduction to programming at a young age through very simple languages really helped to whet my appetite, but I think that my intermediate experiences with low level languages helps me to write code that is a lot tighter than some of my peers. Let's hope this starts a trend, it would be great if more young (and current) programmers appreciated the nuts and bolts!

    1. Re:Somewhere in the middle... by Supp0rtLinux · · Score: 2, Funny

      Your grandpa just clicked on the attachment I sent him inadvertently after I got the MyDoom virus after my wife clicked on the attachment her mom sent her after her husband opened the attachment your grandpa's system sent him.

    2. Re:Somewhere in the middle... by blixel · · Score: 5, Funny

      His motto is "Anyone who doesn't know machine language has no business using a computer."

      Just say to him "Well Grandpa, my motto is anyone who can't describe, with exacting detail, all the functions of every organ in the human body doesn't deserve to live."

    3. Re:Somewhere in the middle... by Saven+Marek · · Score: 4, Insightful

      I learned LOGO and BASIC as a kid, then grew into Cobol and C, and learned a little assembly in the process. I now use C++, Perl, and (shudder) Visual Basic (when the need arises). My introduction to programming at a young age through very simple languages really helped to whet my appetite, but I think that my intermediate experiences with low level languages helps me to write code that is a lot tighter than some of my peers.

      I'm with you there. I learned C, C++ and assembler while at university, and came out with the ability to jump into anything. Give me any language and I can guarantee I'll be churning out useful code in a VERY short amount of time.

      Compare this to my brother, 12 years younger than me who has just completed the same comp.sci course at the same uni, and knows only one language; Java. Things change, not always for the better. I know many courses haven't gone to the dogs as much as that, but many have. I'm not surprised the idea of teaching coders how the computer works is considered 'novel'.

      I can see a great benefit for humanity the closer computers move to 'thinking' like people, for people. But that's just not done at the hardware level, it's done higher. The people who can bring that to the world are coders, and as far as I'm concerned thinking in the same way as the hardware works is absolutely essential for comp.sci. Less so for IT.

    4. Re:Somewhere in the middle... by NanoGator · · Score: 2, Funny

      "Never fear a guy with a goatee, a black turtleneck, and a beret."

      You're confusing 3D artists for Mac users.

      --
      "Derp de derp."
    5. Re:Somewhere in the middle... by Snoopy77 · · Score: 2, Insightful
      I learned C, C++ and assembler while at university, and came out with the ability to jump into anything. Give me any language and I can guarantee I'll be churning out useful code in a VERY short amount of time.

      I'm in a similar position. Started with C++ and have since picked up Delphi, Java, PHP and other scripting languages without a problem. But don't get too cocky. We have both found picking up similar languages no problem but I will guarentee that you WON'T be churning out useful code in LISP in a short time.

      --
      "She's a West Texas girl, just like me" - G.W Bush Iraqis
    6. Re:Somewhere in the middle... by binary+paladin · · Score: 3, Insightful

      Yes, but for little kids who have a really hard time with abstraction, LOGO is excellent. LOGO was the first language I learned even though I didn't even realize what I was doing was programming. I thought I was just drawing. However, I was drawing via an instruction set rather than free handing. Mind you I was about 7-years-old when I picked up LOGO.

      LOGO is not for building applications, it's for teaching kids how to give a computer instructions. I've been tutoring some kids in HTML and CSS, ages 12 and 8. I forgot how much harder it is at that age to think in abstractions. When I try to explain broad concepts rather than concrete specifics, they have trouble following. That is why LOGO is excellent for what it was designed for.

      There might be a couple kids that age that could learn assembly, but odds are most simply aren't developed enough to get it. Your mind simply isn't normally designed to operate at that level at that age. LOGO works there because the tasks are very specific with results a kid can see and understand.

      I cannot believe you got modded "insightful" for making a statement like, "LOGO is primarily marketed towards educational institutions. It is hardly ever the language of choice in the world of business."

      Well no kidding. Incidently, carrots are vegetables and not fruits.

    7. Re:Somewhere in the middle... by Lord+Ender · · Score: 5, Informative

      This was posted to USENET by its author, Ed Nather, on May 21, 1983.

      A recent article devoted to the *macho* side of programming
      made the bald and unvarnished statement:

      Real Programmers write in FORTRAN.

      Maybe they do now,
      in this decadent era of
      Lite beer, hand calculators, and "user-friendly" software
      but back in the Good Old Days,
      when the term "software" sounded funny
      and Real Computers were made out of drums and vacuum tubes,
      Real Programmers wrote in machine code.
      Not FORTRAN. Not RATFOR. Not, even, assembly language.
      Machine Code.
      Raw, unadorned, inscrutable hexadecimal numbers.

      Lest a whole new generation of programmers
      grow up in ignorance of this glorious past,
      I feel duty-bound to describe,
      as best I can through the generation gap,
      how a Real Programmer wrote code.
      I'll call him Mel,
      because that was his name.

      I first met Mel when I went to work for Royal McBee Computer Corp.,
      a now-defunct subsidiary of the typewriter company.
      The firm manufactured the LGP-30,
      a small, cheap (by the standards of the day)
      drum-memory computer,
      and had just started to manufacture
      the RPC-4000, a much-improved,
      bigger, better, faster --- drum-memory computer.
      Cores cost too much,
      and weren't here to stay, anyway.
      (That's why you haven't heard of the company, or the computer.)

      I had been hired to write a FORTRAN compiler
      Mel didn't approve of compilers.

      "If a program can't rewrite its own code",
      he asked, "what good is it?"

      Mel had written,
      in hexadecimal,
      the most popular computer program the company owned.
      It ran on the LGP-30
      and played blackjack with potential customers
      at computer shows.
      Its effect was always dramatic.
      The LGP-30 booth was packed at every show,
      and the IBM salesmen stood around
      talking to each other.
      Whether or not this actually sold computers
      was a question we never discussed.

      Mel's job was to re-write
      the blackjack program for the RPC-4000.
      (Port? What does that mean?)
      The new computer had a one-plus-one
      addressing scheme,
      in which each machine instruction,
      in addition to the operation code
      and the address of the needed operand,
      had a second address that indicated where, on the revolving drum,
      the next instruction was located.

      In modern parlance,
      every single instruction was followed by a GO TO!
      Put *that* in Pascal's pipe and smoke it.

      Mel loved the RPC-4000
      because he could optimize his code:
      that is, locate instructions on the drum
      so that just as one finished its job,
      the next would be just arriving at the "read head"
      and available for immediate execution.
      There was a program to do that job,
      an "optimizing assembler",
      but Mel refused to use it.

      "You never know where it's going to put things",
      he explained, "so you'd have to use separate constants".
      It was a long time before I understood that remark.
      Since Mel knew the numerical value
      of every operation code,
      and assigned his own drum addresses,
      every instruction he wrote could also be considered
      a numerical constant.
      He could pick up an earlier "add" instruction, say,
      and multiply by it,
      if it had the right numeric value.
      His code was not easy for someone else to modify.

      I compared Mel's hand-optimized programs
      with the same code massaged by the optimizing assembler program,
      and Mel's always ran faster.
      That was because the "top-down" method of program design
      hadn't been invented yet,
      and Mel wouldn't have used it anyway.
      He wrote the innermost parts of his program loops first,
      so they would get first choice
      of the optimum address locations on the drum.

      --
      A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
    8. Re:Somewhere in the middle... by Mandatory+Default · · Score: 3, Interesting

      It's clear you weren't writing code 30 years ago and you have no ideas what it was like back then. I was there. If you had ever tried to write an entire application in 2K, you'd know that every trick Mel played saved precious memory and/or cycles. Back then, hardware was expensive, people were cheap. 4K words of memory cost more than most people made in a year (and no, 4K words was not 4KB) - and that pricing was long after the drums described in this article. The optimizers were interesting toys, but that was about it.

      Your talking about documented code makes pretty clear how little you know on the subject. He was writing machine code. Not assembly. Not C. Not Perl. Machine code. There's nowhere to put comments. Even if there were, you'd never waste a machine word on them.

      If you've never had to get a forklist to help you lift your computer, you aren't qualified to pass judgment on Mel.

  5. Programming or CompSci by Sebastopol · · Score: 4, Insightful

    Sounds more like a programming book than compsci book.

    writing an RB tree or an A* search an assembly would be a huge pain in the ass, if you ask me.

    compsci is a large part about data structures, how to choose the right datastructure, how to get the most out of an algorithm by picking the best datastructure, etc...

    but i didn't read the book, so i'll just go back to my websurfing now...

    --
    https://www.accountkiller.com/removal-requested
    1. Re:Programming or CompSci by dilettante · · Score: 4, Insightful
      I think it's a good idea in comp. sci. *because* it's a pain in the ass. I certainly agree that assembly language is not the easiest or most efficient language for implementing certain algorithms and data structures. I also think it's very instructive to understand why.

      I did learn assembly language first. I wouldn't claim to be a wizard (although i'm certainly an old-timer); but i concur with the premise that learning assembly language makes you a better programmer *and* computer scientist. Assembly language exposes you to the basic architecture of the computers that most of work with, and i believe that helps one to understand everything from why certain data structures are preferable in certain situations to basic computational complexity.

    2. Re:Programming or CompSci by vontrotsky · · Score: 2, Informative

      A* is like Dijktra's Algorithm, but instead of wandering randomly, you use a global function to guess at which paths to take.

      Jeff
      who thinks that you should ask google

    3. Re:Programming or CompSci by rskrishnan · · Score: 2, Insightful

      Well thats a good point - assembly is not that great for a complex data structure ..... but on the other hand a commercial db kernel like say Orcl - has a good deal of assembly code that deals with the most elementary stuff like say a spin-lock, or a latch etc - and also for some of the routines used to insert/update/mod a b-tree (and it's cousins). So essentially it's used to tweak a VERY heavily used codepath, thus shaving off a decent percentage of time. Of course it'd be CRAZY to implement the whole B* in asm - might as well jump off a cliff!

  6. Not new by El+Cabri · · Score: 2, Informative

    Knuth's The Art of Computer Programming was illustrating the algorithm in an imaginary assembly language.

  7. Good idea, Bad Idea by lake2112 · · Score: 3, Insightful

    Good Idea: First teaching simple programming fundamentals through a simple to understand language. Then, confuse the hell out of a student with assembly Bad Idea: Teaching CS by starting with one of the most cryptic languages around, and then trying to teach basic CS fundamentals. There are already problems with people interested in CS getting turned off by intro/intermediate programming classes. Imagine the retention rates once my CS100 class is taught in assembly.

    1. Re:Good idea, Bad Idea by AstynaxX · · Score: 2, Informative

      Not to be a prick (well, not too much of one) but that would be a -good- thing. Less retention means we are shaking ut the chaff faster, getting down to only those people who want to be in CS for the art's sake, not the Big Buck$(tm). As recent economic events have shown, too many of latter is a Bad Thing(tm).

      --
      -={(Astynax)}=-
      "Darkness beyond Twilight"
    2. Re:Good idea, Bad Idea by AvitarX · · Score: 2, Interesting

      Except more and more jobs are being outsourced because schools have churned out commodity programmers and business's can get them anywhere.

      What we need if we want to stay the forefront is for there to be fewer programmers of a higher quality. For the past decade we have had too many people not gettin turned off by CS. So they enter the workforce as commodity disposable workers, and they tarnish the reputation of you uys who are good too. Now our jobs go to India and either they have better or equal workers and thins will never come back or they suck and we can keep churnin out assembly line (not assembly) programmers.

      Or we can start teaching people to be great programmers and start another tech revolution with actual American (European/wherever you are the is a victim of outsourcing) workers.

      --
      Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    3. Re:Good idea, Bad Idea by CaptainCarrot · · Score: 2, Interesting
      High retention rates in higher education is not necessarily a good thing. Not everyone can benefit from such an education, and the sooner they find that out the better.

      The problem with your idea is that the "simple to use" languages that are most often taught are too simple and are too many generations removed from what the computer was actually doing. Years ago, even using BASIC on a TRS-80 would teach you a lot about how the machine worked. To get the best performance out of the thing you had to at least be familiar with the memory map, and that inevitably led you to further investigation.

      I gather that Visual Basic is among the more commonly used introductory languages, but when so many layers are placed between the programming language and the machine how are you supposed to learn what's going on at the bottom?

      --
      And the brethren went away edified.
    4. Re:Good idea, Bad Idea by RAMMS+EIN · · Score: 5, Insightful

      ``Bad Idea: Teaching CS by starting with one of the most cryptic languages around, and then trying to teach basic CS fundamentals.''

      I completely disagree. Assembly is actually one of the simplest languages around. There is little syntax, and hardly any magic words that have to be memorized. Assembly makes an excellent tool for learning basic CS fundamentals; you get a very direct feeling for how CPUs work, how data structures can be implemented, and why they behave the way they do. I wouldn't recommend assembly for serious programming, but for getting an understanding of the fundamentals, it's hard to beat.

      --
      Please correct me if I got my facts wrong.
    5. Re:Good idea, Bad Idea by pla · · Score: 3, Insightful

      Then, confuse the hell out of a student with assembly

      I disagree. Personally, I learned Basic, then x86 asm, then C (then quite a few more, but irrelevant to my point). Although I considered assembly radically different from the Basic I started with, it made the entire concept of "how the hell does that Hello World program actually work?" make a whole lot more sense.

      From the complexity aspect, yeah, optimizing your code for a modern CPU takes a hell of a lot of time, effort and research into the behavior of the CPU itself. But to learn the fundamental skill of coding in assembler, I would consider it far less complex than any high-level language. You have a few hundred instructions (of which under a dozen make up 99% of your code). Compare that to C, where you have literally thousands of standard library functions, a good portion of which you need to understand to write any non-trivial program.


      There are already problems with people interested in CS getting turned off by intro/intermediate programming classes.

      You write that as though you consider it a bad idea...

      We have quite enough mediocre high-level hacks (which I don't mean in the good sense, here) flooding the market. If they decide to switch to English or Art History in their first semester, all the better for those of us who can deal with the physical reality of a modern computer. I don't say that as an "elitist" - I fully support those with the mindset to become "good" programmers (hint: If you consider "CS" to have an "S" in it, you've already missed the boat) in their efforts to learn. But it has grown increasingly common for IT-centric companies to have a handful of gods, with dozens or even hundreds of complete wastes-of-budget who those gods need to spend most of their time cleaning up after. We would do better to get rid of the driftwood. Unfortunately, most HR departments consider the highly-paid gods as the driftwood, then wonder why they can't produce anything decent.

      Hmm, okay, rant over.

    6. Re:Good idea, Bad Idea by Darth_Burrito · · Score: 2, Insightful

      I wouldn't recommend assembly for serious programming, but for getting an understanding of the fundamentals, it's hard to beat.

      One problem that I've found with many CS programs is that they put the knowledge ahead of the motivation for the knowledge. Teaching assembly first would be a prime example. The teachers may believe that this will provide a simpler and more understandable foundation in which their students can learn to program. However, none of the students can actually do anything remotely useful in assembler. Therefore they will exhibit remarkable indifference to the subject matter.

      If they were being taught in a language like Java, C#, or even Perl, then they would be working in languages which they could use to produce useful programs. The utility of the knowledge gained would motivate them more than the fear of getting a bad mark. At least that's just the way my own brain works....

  8. New? by Sloppy · · Score: 5, Insightful
    A new book was just released which is based on a new concept - teaching computer science through assembly language
    Uh, assembly language for teaching isn't exactly a new idea. Knuth's AoCP books used MIX, a "fake" assembly language, even though easy-to-read languages (e.g. ALGOL) were already around at the time. And he wasn't even trying to teach fundamentals about computers work -- he was teaching higher-level stuff, algorithms in those books. Think about just how weird that is.

    Perhaps this current obsession with learning using 'easy' languages is the wrong way to do things.
    That depends on what you're trying to learn. I think someone with a CS degree should have a deep understanding of things, and should have at least some experience working in assembly language, managing memory, writing compilers, etc. But that doesn't mean that high-level languages are a bad idea when they're learning higher-level concepts. Do you want someone wasting their time remembering what is being stored in what register, when they're learning how to write a web browser? Of course not: you want them to be thinking about the real issues at hand.
    --
    As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
  9. Wussies by mikeophile · · Score: 4, Funny

    Real programmers learn machine code.

    1. Re:Wussies by unix+guy · · Score: 5, Funny

      Real programmers learn machine code.

      REAL programmers use cat > /dev/kmem

      --
      "Straddling the sword of technology..."
    2. Re:Wussies by 8282now · · Score: 2, Funny

      no. no... 8 toggles switches for code/data input and 8 led's for a "data display"
      all, 1 byte at a time.

  10. Your book? by Tet · · Score: 5, Informative
    A new book was just released

    What you meant to say was that your new book has just been released. If you're going to pimp your wares on Slashdot, at least put an appropriate disclaimer on. That said, I completely agree with the premise of the book. I've met a lot of mediocre programmers, and a few good ones. But I've never yet met a real star that didn't have some background in assembly language programming. Personally, I haven't written anything in assembly in well over a decade. But that fact that I can do so if needed makes me a better programmer, and I'd recommend it to any aspiring coder as a key skill to learn. I wouldn't say IA32 is a particularly nice introduction (I'd start with a cleaner, simpler architecture, such as 6502), but it is at least widely available to anyone that wants to study it...

    --
    "The invisible and the non-existent look very much alike." -- Delos B. McKown
    1. Re:Your book? by FreshFunk510 · · Score: 5, Interesting

      Ugh. Johnnyb should've wrote a disclaimer that he was promoting his own book. This type of action turns me away from wanting to support such an individual. Sorry, nothing personal.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    2. Re:Your book? by FreshFunk510 · · Score: 5, Interesting

      Oh, most definitely.

      Had he admitted that it was his own book, I might've actually read about the book, read the summary and saw if I was interested (as I'm a developer and have a degree in CS).

      But when he doesn't admit that and writes obviously biased remarks regarding knowing assembly to be a good programmer, I can't help but view it skeptically. In fact when I saw the response that it was his book I didn't even bother reading it anymore. All the words he posted lose credibility.

      And considering I got Score: 5 quite quick I have a feeling other people would agree with me. People don't like being "tricked" into buying stuff. It's the same reason why people don't like vendor-lock in and hate Microshaft.

      If you tell people its' your book and you give an open and honest review/opinion regarding it people will actually respect that and read about the book. Hey, it's just my guess, but I think I'm right.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    3. Re:Your book? by Mr.+Darl+McBride · · Score: 2, Informative
      I'm put off too.

      I'll download it for free myself.

    4. Re:Your book? by johnnyb · · Score: 2, Interesting

      I don't see how it's "tricking" you. I believe in moral marketing. However, I don't understand the general opinion that one shouldn't promote one's own stuff.

      Two things:

      1) whether or not I wrote the book is irrelevant as to whether or not it makes a good Slashdot story.

      2) would you be offended if I told you that the back-cover text, which was also written by me, is also written in the third person?

      Anyway, I'm not quite certain where you think the trickery or deception is. The only thing I can see from your post substantiating this is:

      "But when he doesn't admit that and writes obviously biased remarks regarding knowing assembly to be a good programmer, I can't help but view it skeptically."

      I agree that the remarks are biased in the way all remarks are biased. However, I think you are reversing the order of the biases. It is _because_ I believed assembly language essential to being a good programmer that I bothered to write the book in the first place.

      Anyway, I'm sorry if I offended you, but I am not sorry for how I worded my article submission.

  11. nah by galacticdruid · · Score: 2, Insightful

    I don't think that's necessary. Unless you need assembly, why spend the time? I think your time would be better spent working on object oriented concepts and the guts of programming in general, ie: variables, conditionals, types, etc. etc.

    just my 2 cents

    --
    we are all one consciousness experiencing itself subjectively - bill hicks
    1. Re:nah by kreyg · · Score: 2, Insightful

      Well, that was kinda covered, but...

      It's not necessary, and learning OO concepts will serve you very well, but given two equally competent OO programmers, but only one who knows assembly, I know which one I would pick.

      In my line of work (games) - or any real time programming - understanding what's going on under the hood is vital. It also vastly aids in debugging, because sometimes dropping to the assembly level is the only way to figure out what's going on (particularly if you're getting a crash in a library you don't have the source to).

      We also still do a small but significant amount of work in assembly (paralell vector calculations and the like). It's the superstars who know assembly and can actually do everything their job requires.

      --
      sig fault
    2. Re:nah by dubious9 · · Score: 3, Interesting

      Yeah because you don't use variables, conditionals and types in assembly. Right. You just have to think harder about it.

      Also, you can use object oriented principles in assembly, just like you can in C. There aren't any convenient keywords or enforced methodologies (ie everything is an object), but you can gather sections of code that tie data and associated functionality together. You learn the advantages of modular programs. You learn how to count in binary. It forces you to not code carelessly. You learn good coding principles that you can apply to higher languages. In general you get another tool in your tool box. I'd say there are different flavors of programming and they aren't mutually exclusive. ie:

      Object Oriented
      Procedural
      Event-Based
      Interpreted
      Managed Memory (garbage collection)
      Assembly

      To leave one of these out of a CS program leaves me wondering how good the program is.

      --
      Why, o why must the sky fall when I've learned to fly?
  12. Assembly language IS EASIER by Anonymous Coward · · Score: 3, Insightful

    The think concepts of registers and memory locations and stack pointers and branching is easier to understand in assembly. You can teach a simple subset of instructions. It was the way I started back in the day. I scratched my head more later learning C, etc. I guess its just the opposite to kids these days.

  13. Probably a bad idea by Geeyzus · · Score: 2, Insightful

    I think this is a bad idea, for a couple reasons.

    1) Difficulty - Assembly is harder to learn (and create meaningful programs with) than C++, or Java, which is replacing C++ in a lot of college curriculums. This means that students will be spending more time learning assembly, and less time learning about complicated algorithms and the things you really should be learning about (since languages change but algorithms are standard).

    2) Job practicality - 99% of CS grads aren't going to use assembly in their day to day jobs. They will most likely be programming in Java, or VB, or some web language (PHP/ASP/etc). Maybe some C++. But unless you are doing something that requires the control that assembly can provide, like real-time software or game engine development, you simply aren't using assembly at work.

    If it's harder to learn/teach, and you won't use it after you graduate, I can't see the point in teaching it at universities.

    Mark

    1. Re:Probably a bad idea by Total_Wimp · · Score: 5, Insightful

      The idea isn't to actually use the language but rather to learn it to help you understand other languages.

      It's like learning Latin. Nobody actually uses it, but it can give you a deeper understanding of the languages that are based on it.

      TW

    2. Re:Probably a bad idea by markprus · · Score: 2, Funny

      The language you're referring to is spelled LISP.

  14. Re:Not necessarily the mark of a great programmer by s20451 · · Score: 3, Funny

    I'm not a great programmer, but I never really understood programming -- especially C programming -- until I took 68000 assembly. It also took a digital logic course so I could imagine how a processor was built. It's just abstract manipulation of symbols until you can imagine exactly how your printf("Hello World!\n"); gets broken up into neat little binary chunks.

    ps. Don't make them learn x86 assembly. I think that's banned under the Geneva convention.

    --
    Toronto-area transit rider? Rate your ride.
  15. Available under GNU FDL by JoshuaDFranklin · · Score: 5, Informative
    I don't know why he didn't mention that this is a free documentation project:

    http://savannah.nongnu.org/projects/pgubook/

    It's also being used at Princeton

  16. Knowing assembly language is vital, mostly by dysprosia · · Score: 2, Interesting

    I agree with the sentiment that knowing assembly language maketh a programmer, in some circumstances. It allows a deeper understanding of how certain languages work "under the hood", and how to debug errors that may not be so easily detected by than just staring at code. Knowing C and assembler, for instance, is a good match in my eyes.

    It may not be so important though, if you're a database programmer, or if you're dealing with high-level languages such as Java or something.

  17. assembly? bah - real men program with punchcards by WankersRevenge · · Score: 2, Informative

    assembly is the great monster that requires fresh blood every year, or the great darkness will fall upon the land. i myself have never dabbled in assembly because i don't like living in an hp lovecraft nightmare.

    For those of you insane enough to take the plunge, check out this FREE online introduction course (no reg, don't ya love it). The guy who wrote it is pretty wacky. I took his java introductory course and it was hip as well as very educational.

  18. From the linked page by LineNoiz · · Score: 5, Funny

    Get it to your Valentine on time! Choose UPS 2 DAY and pay the price of Ground.

    Yeah. Give my GF a book on Linux Assembly programming. That should get those panties off in a hurry.

    --
    "Quotation is a serviceable substitute for wit." --Oscar Wilde
    1. Re:From the linked page by kurosawdust · · Score: 2, Funny

      Well, it's a hell of a lot faster than trying to get her panties off using some high-level language.

    2. Re:From the linked page by glitch23 · · Score: 2, Funny

      If you had these waiting for you wouldn't you want to give her the book?

      --
      this nation, under God, shall have a new birth of freedom. -- Lincoln, Gettysburg Address
  19. Computer Science Curriculums by pointzero · · Score: 3, Interesting

    Perhaps it's time that computer science curriculums start teaching assembly language first.
    Here at University of New-Brunswick (Canada), they may not teach assembly language "first", but we do have a second year course dedicated to assembly and the inner workings of computers. My only problem though at the school is that we learn the Motorola M68HC11 cpu and not current ones. Sure it's easier to learn and understand, but most computers we work on today are x86 based.

    My 2 cents.

    1. Re:Computer Science Curriculums by rthille · · Score: 2, Insightful

      Yes, but most likely if you're doing programming on an x86 you won't be using assembly except to read the compiler output when you think it has a problem.

      and 68HC11 chips may not be the latest and greatest, but I'd bet they still get spec'd in lots of embedded products (where you would be using assembly)

      --
      Awesome furniture, accessories and cabinetry in Santa Rosa, CA: http://humanity-home.com/
  20. A good idea by swtaarrs · · Score: 2, Insightful

    I agree that assembly language should be taught, but not necessarily as the first language. BASIC is a good tool for teaching higher level programming ideas like conditional statements, loops, etc... Once those concepts are understood, C should be taught. I was a fairly proficient C programmer before I learned assembly (68k), but even then assembly helped me understand much more about the inner workings of C and what lines of code do. Instead of just knowing that code I write works, I now know why it works and I am able to do much more advanced things with a low-level knowledge of programming.

  21. For the record by pclminion · · Score: 5, Interesting
    The CS program at Portland State University starts with assembly in their introductory classes. At the time I was there, it was x86 assembly, but I've heard that some professors are using Sparc assembly as well -- not a good idea in my opinion, simply because of 1) the delay slot and 2) the sethi instruction, both of which are a little confusing for someone who's never coded before, let alone never coded in assembly language.

    I think it's a little weird to call this "Learning Computer Science via Assembly Language." It's programming, not computer science. Computer science is really only marginally about computers. It has to do more with algorithms, logic, and mathematics.

    You can study computer science, and produce new knowledge in the field, without ever touching a computer.

    This misunderstanding is, I think, part of the reason so many students drop out of CompSci. They head into it thinking it's about programming, and are startled to find that computation and programming are not equivalent.

    That's why the Compilers course at PSU is considered the "filter" which kills all the students who aren't really interested in computer science. They really need to spin off a seperate "Software engineering" school for these students, since what they really want to study is programming.

  22. real programmers by lethalwp · · Score: 2, Funny



    real programmers do:
    copy con myprogram.exe

  23. Teach architecture, not assembly by wan-fu · · Score: 2, Insightful

    It's pointless to teach assembly as a method of creating "star programmers" -- all you'd do is teach people how to write a for-loop but in ten lines instead of three (in a higher level language). The real benefit that people get from being good assembly programmers is understanding the inherent problems/benefits of a certain processor architecture and that's what lets them generate good, optimized code for the platform they are engineering for. Teaching assembly may provide some insight into that but all it really does is teach a new language. Teaching the architecture would give the student real appreciation of what's going on and how to build efficient code. Because think about it: assembly only describes what the architecture is capable of doing.

  24. Syntax, OS interfaces... by Cryptnotic · · Score: 5, Interesting

    Well, for starters the syntax for assemblers is different. There are two standards, the AT&T standard (which is used by the GNU assembler) and the other one that is more familiar to DOS/Windows x86 assembly programmers (which is used by the NASM assmebler).

    Second, OS interfaces for making system calls (e.g., to read files, open network connections, etc) are different in Linux versus DOS or Windows).

    --
    My other first post is car post.
    1. Re:Syntax, OS interfaces... by Anonymous Coward · · Score: 5, Informative

      There are two standards, the AT&T ... and the other one

      Incorrect. There are at least four different assemblers and standards:

      ASM - GNU Assembler. AT&T standard, as commonly used on Linux. The syntax hasn't changed since the 60's - which is both very good and very bad. I personally think it should be retired.

      MASM - Microsoft Assembler. Intel standard assembly. The syntax is nice, but there are some ambiguous operators (is [] address of or address by value? - the meaning changes depending on the context). This is typically what the commercial Windows world uses. MASM itself is mostly obsolete - the Visual C compiler can now do everything that it could and supports all modern CPU instructions (even on Visual C++ 6 if you install the latest CPU pack).

      NASM - Netwide Assembler. An assembler that set out to put right all the things that were wrong with MASM. The syntax is excellent, ambiguous operators are cleared up, documentation is also excellent, it interoperates beautifully with Visual C on Windows and GNU C on Linux. Ideally NASM would replace AS as the standard now that it's open source.

      TASM - Borland Turbo Assembler. Based around the Intel standards, but does things slightly differently. Has extensions which allow for easy object-oriented assembly programming - which can make for some very nice code. Had a MASM compatibility mode, but nobody in their right mind used that if they could help it. I had version 5, but I don't believe they've kept it up to date, so it's obsolete now.

      There are a couple of others as well, most notably AS86 (which was the leading independent solution for writing assembler back in the DOS days).

    2. Re:Syntax, OS interfaces... by larry+bagina · · Score: 5, Informative
      those are implementations, not standards.

      x86 instructions that deal with 2 data points can be written 2 ways:

      instr src,dest
      instr dest,src

      The intel standard (used by nasm, tasm, masm) is dest,src. The ATT standard (used by gas) is src,dest

      --
      Do you even lift?

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

    3. Re:Syntax, OS interfaces... by steveg · · Score: 2, Interesting

      Isn't the syntax most naturally determined by the processor?

      Intel specified the syntax they did because their chips implement the instructions in that same order. You can obviously switch things around as part of the 'macro' in 'macro assembler' (and apparently gas did so) but it seems more 'natural' to stick with how the processor works. Anyway, it does to me.

      If you were masochistic enough to look at the numeric code you're producing, it might get confusing if the operands were switched around from what you were expecting. And there have been sometimes when it's been useful if not fun to look at the actual bits.

      Maybe if I were better at assembler I wouldn't have to trace it that way, dunno.

      --
      Ignorance killed the cat. Curiosity was framed.
  25. Disclosure: The submitter is the Author. by Wise+Dragon · · Score: 4, Informative

    I think the article should have disclosed that the submitter (johnnyb) is also the author of the book, Jonathan Bartlett. So rather than saying "A new book was just released", I would rather see something like "I wrote this new book." Here is johnnyb's website. http://www.eskimo.com/~johnnyb/

    1. Re:Disclosure: The submitter is the Author. by FreshFunk510 · · Score: 3, Insightful

      Furthermore Slashdot should make it a policy for people who submit their own books/publications to reveal that they are the author so that there is no conflict of interest (sort of like how News channels who report news on their parent company or subsidiary always say so explicitly). I think that's only fair to the readers of Slashdot and it won't make us feel like we're being scammed into buying someone's book.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
  26. Great concept. by shaitand · · Score: 4, Insightful

    I started out learning to code in asm on my c64 and I'd have to say it was a very rewarding experience.

    Anyone who disagrees with this probably doesn't have much experience coding in assembler to begin with. Asm really is fairly easy, the trick is that most who teach asm actually spend too much time on those computer concepts and not enough time on actual real coding. It's wonderful understanding how the machine works, and necessary to write good assembler but you should start with the 2 pages of understanding that is needed to "get" asm at all.

    Then teach language basics and THEN teach about the machine using actual programs (text editor, other simple things) and explaining the reason they are coded the way they are in small chunks. Instead of handing a chart of bios calls and a tutorial on basic assembler, introduce bios calls in actual function in a program, most of them are simple enough that when shown in use they are quite clear and anyone can understand.

    After all assembler, pretty much any assembler, is composed of VERY simple pieces, it's understanding how those pieces can be fit together to form a simple construct and how those simple constructs form together to create a simple function and how those simple functions form together to create a simple yet powerful program that teaches someone programming. Learning to program this way keeps things easy, but still yields a wealth of knowledge about the system.

    It also means that when you write code for the rest of your life you'll have an understanding of what this and that form of loop do in C (insert language here) and why this one is going to be faster since simply looking at the C (insert language here) concepts doesn't show any benefit to one over the other.

  27. CompSci's about more than that... by Svartalf · · Score: 2, Insightful

    It's about optimal instruction usage, language design, automata, and a lot more. It's about optimal computing all the way around.

    --
    I am not merely a "consumer" or a "taxpayer". I am a Citizen of the State of Texas
  28. Going even farther than just assembly by jinxidoru · · Score: 2, Interesting

    In the BYU CS department they've recently gone a little farther than starting with assembly language. The introductory programming class actually begins with digital logic gates. The next section deals with assembly programming using the contrived LC (Little Computer) opcode set. It's a much smaller set of opcodes than x86, so it's simple enough for beginners, but still contains the important elements learned from doing assembly programming. The course ends with an introduction to C++ and OOP. I think the change in curriculum is a very wise idea. I took a class in digital circuitry and it has helped me so much in my programming. I'd like to see more programs move in this direction.

  29. Re:Whatever by jhoger · · Score: 2, Insightful

    A lot of software work is at a smaller scale. If 60% or so of software's lifecycle is maintenance, and there's a lot of software out there, and also since many software projects are very small, I'd venture to say that process is almost irrelevant for plenty of work.

    Being knowledgeable about low level operation of the machine will take you farther, since you won't have the fear of getting down to the bare metal to figure out a problem. And assembly language is important there... but also things like debuggers, protocol sniffers, etc. Anything that lets you get to the bare metal to figure out a problem will get you to a solution quicker.

    Process and modern design concepts are important for large projects and at the architectural level.

  30. MIXAL by texchanchan · · Score: 2, Informative

    MIXAL, MIX assembly language. MIX was the virtual machine I learned assembly on in 1975. Googling reveals that MIX was, in fact, the Knuth virtual computer. The book came with a little cue card with a picture of Tom Mix on it. MIX has 1 K of memory. Amazing what can be done in 1 K.

    1. Re:MIXAL by Slamtilt · · Score: 2, Informative

      Well, if we're talking about the same MIX as in The Art of Computer Programming, it's defined there as having 4000 memory locations. Each memory location is made up of 5 bytes and a sign bit. The number of bits in a byte isn't precisely defined, but a byte has to be able to hold at least 64 distinct values, and no more than 100. And programs should never assume more than 64 values for a byte. Odd, but there you are.

      Writing your own MIX machine is an interesting exercise. I remember I finished the instruction set but never got round to actually implementing MIXAL (the assembly language). Which is embarrassing, since Knuth practically gives you the recipe.

    2. Re:MIXAL by bunratty · · Score: 2, Informative

      You might be interested to know that MMIX is the new 64-bit RISC processor version of MIX. There's even an assembler and simulator available so you can run code, and gcc even generates code for the processor.

      --
      What a fool believes, he sees, no wise man has the power to reason away.
  31. X86??? OMG that sucks... by walt-sjc · · Score: 4, Insightful

    Of all the processors out there, yes the x86 is common but it has to be one of the WORST instruction sets - one of the most difficult to work with.

    Is it just me???

    I DO think it's a good idea to be teaching assembly, not so sure as the core of a comp sci program however. I started playing with assembly fairly early, on 6052, z80, and then later with 68000 and IBM 370. It's good to know, but I would do major stuff in it anymore. That's what high-level languages are for. You only drop to assembly when you have to for speed or space.

    1. Re:X86??? OMG that sucks... by AnotherBlackHat · · Score: 2, Interesting

      Of all the processors out there, yes the x86 is common but it has to be one of the WORST instruction sets ...


      It only seems that way because you haven't been exposed to the really wretched ones.

      There were processors that had only one word of stack, processors that needed special instructions to cross page boundaries, that had only two registers, that couldn't add or subtract (forget multiply and divide), and even processors that didn't have linear instruction sequences (the program counter was a LFSRs).

      The whole x86 family even as far back as the 4040 has a much better instruction set than many of the (now thankfully dead) processors.

      -- this is not a .sig
  32. Re:No, but... by Alan+Shutko · · Score: 4, Informative

    Except that things like "i = i + 1" vs. "i++" vs "i+=1" are mostly irrelevant today, since that's a very easy thing for compilers to optimize. And they've been optimizing stuff like that for years.
    Try looking at the asm output from GCC at -O2 on those two statements.

    Knuth had reasons for using ASM that were a lot better than that. It does give you a better idea of how things are laid out in memory, because you have to do it yourself. It's easier to do detailed performance analysis of algorithms, because you can get exact cycle counts. (Which in turn helps train your intuition, and tell you how to find out from a CPU's instruction set how it does at various things to tune algorithms.) You can look at how cache affects things.

    Take a look at his reasons.

  33. Not a good idea by El · · Score: 2, Interesting

    I think one would be much better off writing in C without optimization, then stepping through the execution in a disassembler to see how the resulting machine code operates. Yes, it helps to write more efficient high level code if you know how it is converted to machine code. For example, I had a coworker who made a habit of declaring initialized arrays local to his functions. I had to point out to him: "You do know that this causes the array to be copied onto the stack every time you enter the function, thus really slowing down program execution, don't you?" Apparently this had never occured to him, because he had never actually watched the code execute.

    --

    "Freedom means freedom for everybody" -- Dick Cheney

  34. emulator by bcrowell · · Score: 3, Insightful
    When I was a kid, I first learned BASIC on a TRS-80, and then learned Z80 assembler. (There were no compilers available.) Thirteen-year-old me had a really hard time with asembler at first. For example, I thought preprocessor defines were like floating point variables that you could modify at runtime.

    Assembler-first might work with beginners if it was on an emulator where they could see exactly what was happening, and there was no way to crash it. Otherwise, I just don't see the point of making things harder.

    Of course if you really want to make it hard, you hand every twelve-year-old kid a copy of Knuth and a hardware implementation of Knuth's hypothetical processor. Then our generation could be completely assured of job security.

  35. It depends where you want to go in CS by use_compress · · Score: 4, Insightful

    There are a million fields in CS-- you can view them as points on a line that stretches from engineering to mathematics. The people who work in architecture are at the most extreme end of the engineering section. If you want to go into systems programming or into architecture, then I can see how would want to base everything off of asm. But if you specialize in ai, or algorithms, or theory, you really don't encounter assembly that often... for the most part, the need isn't there to develop extremely high performance, system dependent apps. In these fields, you could do of a cs curriculum (through graduate) entirely in Matlab, Prolog and ML. The emphasis is on the mathematical structures the program represents over how the computer actually deals with them.

  36. Implementation specific vs. generic... by Cryptnotic · · Score: 4, Informative

    A real computer science program will teach generic principles of programming and systems development, with projects that delve into a variety of actual implementations of systems.

    For example, a b-tree data structure is fundamentally the same thing whether you implement it in 32-bit ARM assembly language or 16-bit x86 assembly language or C or Java.

    To understand how assembly language works, you need to understand how a processor works, how instruction decoding works, how register transfer language works, how clocking a processor makes it accomplish things. To understnad how registers hold values electrically and transfer values between registers you need to understand some physics and electronics.

    To understand how a compiler takes a source language and translates it into a target language, you need to understand a little about the kinds of languages computers can understand (Context-Free Languages) and how they can parse them (Context-Free Grammars). Delving into that field will lead to the core theory of computer science, what is possible with machines in general and what is impossible.

    A real computer science program at a university will take you through all of these subjects over several years, allowing for some excursions into other things like databases and cryptography. A real computer science program is always theory with projects that are applied to actual implementations.

    --
    My other first post is car post.
  37. yep by NemoX · · Score: 2, Interesting

    I agree with what the author has to say about assembly. I never felt like I new enough until I learned assembly, even though I started with LOGO in 1st grade, and have had programming every year since. Then I came to understand a lot of how to prevent security holes in higher-level languages, and how to write tighter code. It also helped with better understanding program security from hackers, i.e. how they can hack my programs, product keys (or other such copy protection measures) and find the exploits. Mostly since they disassemble anything they can't decompile...and of course disassembling something puts it into assembly language of one sort or another. It is a class that I didn't get in college, and went back for after I got my degree. The most useful one IMO.

    An off the shelf book I liked and found useful was "The Art of Assembly Language" by Randall Hyde. I liked it better then my text books, anyway :p

  38. Race car driver analogy by betis70 · · Score: 2, Interesting

    From the website

    >>To be a programmer without ever learning assembly language is like being a professional race car driver without understanding how your carburetor works.

    A race car driver is a high-level user of the car (more akin to a financial analyst using Excel). Why would a high-level user care about HOW the carburetor works? All he has to tell the pit crew is how the car is behaving. A professional race car driver's job is to drive the car faster than the guy or gal next to him. End of story.

    Now the mechanic or race car engineer is a different story ...

    --
    I forget...are we at war with Eurasia or East Asia?
  39. Languages I sudied for my CS degree... by Ion+Berkley · · Score: 2, Interesting

    Lets see 20 years ago this is what I remember being taught in undergrad CS (Though I'd been an assembly programmer for 7 years already then):
    1st Year: Pascal, PDP-11 assembly
    2nd Year: 68000 Assembly,
    3rd Year: Ada, Eiffel, Modulo-2, Smalltalk, VHDL, EDIF

    Interestingly despite using mostly UNIX hardware C was left to be self taught, though it could be used in place of Pascal.
    The point really was use appropriate tools for appropriate jobs: Thus we learnt OS/Kernel basics in assembler, likewise IRQ concepts and HAL stuff. For algorithmic stuff we worked in a mainstream strongly typed high level language. For trends yet to propagate to the commerical world (some doomed ones!) we learned in exotic academic languages.
    Assembly is as valid today as it was in the 1950's, its just that its most appropriate for only some tasks that a minority of programmers do: Deeply embeded microcontroller SW, OS kernel work (take a look in our beloved linux kernel code), hardware bootstrap, hard real time etc etc etc

  40. How about an alternate? by man_ls · · Score: 2, Funny

    Just learn C instead. It combines the readability of assembly with the ease of use of assembly.

  41. Re:Not necessarily the mark of a great programmer by fitten · · Score: 3, Insightful

    I agree. It's rather unfortunate that one of the most ugly, ungainly, and hacked ISAs out there is also the dominant one. There are some assemblies that are a pleasure to use, though. The 68K line and almost all of the load/store ISAs are nice to use. Some of the older *really* CISC ones are OK too.

  42. Ugh... x86 by iamdrscience · · Score: 2, Insightful

    For anybody on here thinking about broadening their CS horizons, I would recommend not learning x86, at least not first. A simpler, RISC(-ish) instruction set is really the way to go. It's a lot more enjoyable to program in. Some good choices are maybe z80 or 68k (program your TI calculator maybe?) or Microchip's PICMicro microcontrollers (most models have under 35 instructions to learn).

    Learning x86 isn't a bad idea, and for most nerds programming assembly that's probably where it will be most useful, but I just think it's a better idea to start off programming ASM on something a little more enjoyable so that you can really learn to appreciate it before diving in with x86.

  43. Good Idea, not appreciated by PHB's, tho by ackthpt · · Score: 2, Interesting
    While starting Computer Science students off with assembly (without first introducing them to a high-level language) may be a relatively new concept these days, the idea of teaching low-level languages to Computer Science students is not a revolutionary technique whatsoever. Every decent Computer Science curriculum includes several semesters of courses in which assembly language is required, to demonstrate their knowledge of basic computer processes.

    I've found I get blank stares sometimes when discussing memory usage, I/O bottle neck or code optimization in front of PHB's. All they want is crap to run and if they've got the money they'll throw it at buying more power. Sadly I've seen BSCS people who care less about getting a project done rather than done well, often with hideous looking code which can choke the fastest quad processor servers. A little time spent, considering how code may be written to minimize impact or organize I/O more efficiently isn't even encouraged anymore, where it once was a hard rule.

    Look at VB.NET, it's the very embodiment of just code and don't worry about it. So much of the work is buried in libraries/namespace, you really have no idea what impact calling routines will do.

    Today's lesson: Screw finesse, just throw more CPU and memory at it.

    --

    A feeling of having made the same mistake before: Deja Foobar
  44. Learn assembly first, by all means by John+Jorsett · · Score: 3, Insightful

    I understand C much better than I would have had I not learned assembly language first. I think of C as a somewhat-more-abstract version of assembly. It has that "down to the bare metal" aspect in much of what you can do with it, particularly pointers.

  45. Not the point! by www.sorehands.com · · Score: 4, Insightful
    The point is the understanding of the workings of the machine. When I was in school, we had to take a computer architecture class which included using AND gates to make counters and such.


    My first IBM PC job was C, but I had to learn 8086 so that I could debug since there was no source level debugging when using overlays.

    Anyways, how do you find a compiler bug, if you can't read the code the compiler generates?

    1. Re:Not the point! by EugeneK · · Score: 4, Funny

      Luxury! In my day we had to make our own AND gates out of OR and XOR gates!

    2. Re:Not the point! by tomstdenis · · Score: 4, Informative

      Correct me if I'm wrong but isn't the most primitive CMOS gate a NAND gate? So I highly doubt you would make AND out of and XOR gate [XOR being the more costly of the three].

      Tom

      --
      Someday, I'll have a real sig.
    3. Re:Not the point! by EugeneK · · Score: 3, Interesting


      AND(a,b) = XOR(XOR(a,b),OR(a,b))


      You might be right about the cost of gates; I have no idea. Ok, it was a dumb joke. :)

    4. Re:Not the point! by weg · · Score: 2, Informative

      All logical formulae can be expressed in terms of negation and either disjunction or conjunction... construction of logical negation from a nand gate is trivial. Why should XOR be the champion??

      --
      Georg
    5. Re:Not the point! by Rick.C · · Score: 2, Interesting
      isn't the most primitive CMOS gate a NAND gate?

      You used CMOS?? Luxury! You probably had a clean-room, too.

      We had to make our AND gates out of bubble gum and baling wire.

      And cut the wire with our teeth!

      On more serious, but equally off-topic note, back in the mid 1970s I attended an IBM presentation by one of the researchers who built the first IBM disk drive. He described how they coated that very first 14-inch platter:

      The plan was to put the platter on a record turntable, crank the speed up to 78 RPM and pour the iron oxide slurry onto center of the spinning platter from a paper Dixie cup. The theory was that the centrifugal force would spread the slurry out evenly across the surface and give them a nice, smoothe coating.

      Well, they gathered around the turntable, started pouring out the slurry, looked down at the brown streak across all their clean, white lab coats, and said, "Maybe we should turn it down to 33 RPM."

      True story.

      --
      You were 80% angel, 10% demon. The rest was hard to explain. - Over The Rhine
      "Math in a song is good."-Linford
  46. Assembly language not required... by BigZaphod · · Score: 2, Interesting

    I don't think knowing assembly language is required to become a good programmer, but a good programmer should learn how the computer works at that level at some point in their life. And that's the key. Assembly language isn't a bad way to learn that, but it isn't the only way. And, in many respects, it isn't really the best way, either.

    See, I'm sort of tore. I like this idea since I feel most programmers these days are sorely lacking in the fundamentals. However there are advantages to starting higher. One major advantage I can think of is that when you start so low level, there are certain ideas that may never occur to you. Certain ways of solving problems won't come up because you "know" how the computer works and therefore adapt your thinking to it and seeing things very narrowly. I believe that we should be working towards adapting the computer to us instead. And when students start out learning at higher and higher levels, they start thinking higher and higher level and see connections from their "low level" beginnings to a higher level ideal without being bogged down in the little details. I think that would help drive innovation.

  47. This is BS by mslinux · · Score: 2, Interesting

    Real men type the 1's and 0's in directly. Who needs a sissy assembler to do the translation? I wouldn't hire a programmer who did not know what "011001001100" meant to today's x86 procs.

    Ok, let's get real. This is equivelent to saying that unless a farmer gets on his hands and knees to plant 1 seed at a time, he's not a real farmer. Sure, he knows how to operate a $100,000 tractor that can plant several million seeds each day, but his hands-on knowledge of planting seeds isn't near what his great-grandad's was so, he must be less of a farmer... even though his output is thousands of times greater.

    HELLO! It's called technology. It's all about advancement. We no longer have to type in the 1's and 0's ourselves. Hell, very few of us need to use assembly. Why was C written? Because all the fucked-up assembly languages in the world do not work together. A program written in XYZ assembly will only run on a XYZ computer, etc.

    Today, programming is high-level. Write once... run everywhere (Java, Python, C#). Let's leave this assembly crap, and it is crap, where it belongs... back in the dark ages!

  48. Re:Forget Computer Science! by sydb · · Score: 3, Insightful

    Well said. Computing is not a science.

    By definition. Science is the application of a rigorous discipline in an attempt to understand nature. Computing has nothing to do with understanding nature and everything to do with implementing logic in physical systems.

    This is not to degrade computing. In fact, computing is provably correct as it is based on logic. Science is a statistical endeavour in which nothing is proven, but theories are constructed which demonstrate usefullness and have not yet been disproven. Computing is, however, built on the results of science.

    Maths is a branch of logic. Science is a branch of logic. They are of course cross-fertilising. Computing is so close to father logic as to be almost indistinguishable - it's just a way of logic happening in acceptable time scales.

    Of course, you might disagree.

    Cheers!

    --
    Yours Sincerely, Michael.
  49. Teaching assembly good, but perhaps not x86... by GrahamCox · · Score: 2, Insightful

    ...or any modern high-powered CPU, it's just too complicated to write good, clear, effective code. That's why we have compilers.

    I think learning assembler is a great insight into an understanding of computers, but the old 8-bit CPUs were a lot easier to get a grip on, no pipelines, caches or parallel execution units to worry about. The C-64 was what I cut my assembly teeth on, and I still think that sort of machine is ideal.

    To this end, I feel a great learning aid is a programmable emulator which can be run on a modern machine with all the nice bells and whistles, but the "chip" at its heart is something like a 6502 or 6800. The emulator environment can make the machine operation clearly visible, such as providing a graphical display, showing step by step what the "CPU" is doing. In fact the CPU doesn't even need to be real, it can be a made up device that exhibits some idealised characteristics. The system can support other devices too, such as a virtual text or graphics display that the emulated CPU can work with, memory chips, and virtual I/O devices (e.g. port adapters that show the port and DDR state as graphical LEDs etc).

    About 10 years ago I developed such an emulator as a university project, and took it to a working demonstration level. Unfortunately I never did any more with it, but it was a good proof-of-concept and many of the CS profs saw it and felt it would make a great learning tool. Maybe it's time I resurrected it and finished it off/rewrote it. I'd be interested to hear from anyone with ideas about what sort of features this sort of aid should have.

    My original design featured a drawing area where the system could be built from a set of predefined parts - CPU's, memories, I/O, then connected together (using dragged bus links) to create a memory map of the system. The instruction set of the CPU could be defined, which in turn was intended to generate an assembler for that CPU (this part I never got finished - I think if I started over I'd just stick to a fixed instruction set and hence a fixed assembler). In the running phase, the CPU was shown as a diagram of a generic CPU, showing all the registers, data paths, etc. This was updated and animated in real time as the user's program ran, and could be single stepped. It also had interrupts,which was pretty cool - watching exactly what happened when an interrupt occurred (the I/O adapter unit featured a timer/counter register which would cause an interrupt, or you could just click an "interrupt" button on the screen) was truly enlightening, especially as you could watch the stack being graphically pushed and popped as it happened! Naturally with all this graphical activity going on to show the working, it was pretty slow, but as a learning aid definitely good enough. I implemented a variety of animation levels to help speed things up. User's machine code programs could write characters to a 40x25 emulated text display at around 10cps, to give you an idea. This ran on a Mac with System 7, at the time typically having a 25MHz 68020. A modern machine would probably be able to do all this and turn in a half-decent emulation performance to boot.

  50. Assembly is an impediment by Tom7 · · Score: 2, Informative

    Assembly is an impediment to understanding high-level issues. While I agree 100% that any good CS program should include some discussion of assembly and systems programming (at least a few semesters), there is so much more to CS than systems hacking. There is no way that a whole modern CS curriculum should be taught in assembly language.

    As a starting language it's really a matter of preference: the bottom-up method gets you really understanding the machine (and really yearning for more convenient tools), but it is a slow, painful start. The things you learn are less general and will be less applicable years down the line. On the other hand, learning a high level language can leave you in the dark about what's going on under the hood, which means that some aspects of what you're doing will seem like "magic". For you efficiency addicts, this can mean less efficient code. On the other hand, the world will have fewer efficiency addicts!

    However, I think that assembly will turn a lot of people off of programming that could otherwise be interested in the subject and perhaps productive programmers, if not cowboy kernel hackers.

  51. I disagree by markov_chain · · Score: 2, Insightful

    Universities are not supposed to be trade schools- they should focus on teaching their students the basic concepts, not technologies-du-jour. The purpose of teaching assembly is not to produce programmers who know x86 assembler, it's to teach the students the basics of how modern computers work.

    Having used assembly a long time, and having met both programmers who did and did not learn it, I found that the former benefit from the better understanding of the underlying mechanisms, regardless of whether they actually used assembly at work or not.

    --
    Tsunami -- You can't bring a good wave down!
  52. Computer Science != Programming by Michael+Odell · · Score: 2, Insightful

    Although I think this may be an interesting book, I think many people confuse computer science and programming.

    "Computer science is as much about computers as astronomy is about telescopes" --Edsgar Dijkstra

  53. assembly and hardware by jonniesmokes · · Score: 2, Insightful

    What I like best about computers is that they are super miniature machines. And unlike mechanical machines, they can do the same thing over and over again - not millions - but 10^20 or so times over and over. And they do this really really fast.

    Assembly allows you to get a little closer to the mechanism. And its really nice if your want to know how hardware works. Its especially good if you want to develop robots or gadgets that interface to computers. It's nice to learn about interrupts and flags and such.

    That said - if I can use C, Java, Pascal, Basic or anything higher - I will. Because it'll take 1/10th the time. Plus all those wonderful libraries are a lot easier to interface to. Even for programming the little micro controller's, its really nice to be able to do it in C.

    I started out as a computer programmer and have found myself branching in both the mechanical and electrical realms. Learning assembly:

    "Peter Norton's assembly language guide for the IBM PC" I wrote a disk editor. It took forever - actually - I didn't quite finish. Got about 85% of the way done. Nowadays - I think a microcontroller would be a lot more gratifying.

  54. The Art of Assembly Language Programming by CleverDan · · Score: 2, Informative

    by Randy Hyde at Univ California - Riverside. To learn about assembly on 80x86 processors, check out the printed book, or download the text with a Linux or Windows point-of-view. It's written in a style that's not overwhelming to the novice.

  55. Excellent Programmers by RKone2 · · Score: 3, Insightful

    I've found that the key difference between mediocre and excellent programmers is whether or not they know assembly language.

    You've got it backwards I think. The excellent programmers actually care about what they're doing, and as such have all learned assembly.

    Teaching assembly to someone who doesn't care won't turn them into an excellent programmer.

  56. To be a programmer without ever... by PissingInTheWind · · Score: 3, Funny

    From the book's presentation page:
    To be a programmer without ever learning assembly language is like being a professional race car driver without understanding how your carburetor (sic) works.

    To which I reply: To be a book writer without ever learning how to spell properly is like trying to teach programming by starting with assembly languages.

    --

    A message from the system administrator: 'I've upped my priority. Now up yours.'
    1. Re:To be a programmer without ever... by Dahan · · Score: 2, Informative

      So where's the misspelling? Or perhaps it is you who needs to learn how to spell?

  57. Difference in ideas about CSCI by WolfPup · · Score: 3, Insightful

    I think whether this idea is a good one or not depends on what the program considers a Computer Science Degree. Where I have taken classes, the philosophy of Computer Science is more the science of algorithms and mathematics rather than practical programming experience. The idea being the research of new and more efficient algorithms or data structures not tied to a specific language . This is more suited towards graduate work in the field of Mathematics and Computer Science.

    Some other programs may approach the degree as a professional/vocational type of program preparing the student for eventual work in the field of programming.

    Learning assembly may be more beneficial to the student learning as an eventual programmer in that understanding some of the low level work that the computer is doing could be important in programming.

    I'm not sure that the mathematics and concept work would help as much considering a lot of the ideas in this is more general and not tied to any specific architecture, so learning the low level process may not help as much.

    --

    -- Wolfpup

    "A man whose circumstances went beyond his control." -- Styx

  58. It is not the language, it is the paradigm. by Wolfier · · Score: 2, Informative

    It is not assembly language. It is the way we think - and in the world of computers there are 5 types of languages that will make you take on anything very easy.

    1. Procedural (Pascal/C/BASIC)
    2. Object-Oriented (Eiffel/Smalltalk/Java/C++)
    3. Functional (Scheme/Lisp/Logo)
    4. Declarative (Prolog/Forth)
    5. Assembly (x86 etc.)

    1. Re:It is not the language, it is the paradigm. by pclminion · · Score: 4, Informative
      I would organize those differently:

      1. Imperative
      -- 1a. Procedural (Pascal/C/BASIC)
      -- 1b. Object-Oriented (Eiffel/Smalltalk/Java/C++)
      -- 1c. Assembly language
      2. Functional-Type
      -- 2a. Pseudo-functional (Scheme/Lisp)
      -- 2b. Pure functional (Haskell/ML/Pure lambda calculus)
      3. Declarative (Prolog)

      Imperative languages are based on the execution of individual commands. Fundamentally they are based on the concept of assignment -- moving data from one place to another. Functional languages are based on the evaluation of expressions and the absence of side-effects. Pseudo-functional languages have variables, loops, and side-effects but are mainly based on functional concepts. Declarative languages are based on the concept of goals, and the recursive description of how those goals should be achieved, or the definition of what constitutes achievement of the goals.

      I'm not sure why you consider Forth a declarative language. To me it seems more like an imperative language with an unusual syntax.

  59. An (informed) dissenting opinion... by turm · · Score: 2, Insightful

    I'm a software engineer and I work for a major CPU manufacturer. As you might guess, my job involves a ton of assembly progamming.

    That being said, I disagree.

    You can learn CS concepts in many ways. It's cute to learn from the bottom up, but it's impractical. I oppose it for the same reason I oppose CS curricula based on underdog languages (like Eiffel, to name one I was taught). I don't care how 'clean' they are, teach something useful.

    If runtime efficiency matters, you'll know about it and eventually get down to the assembly level. If it doesn't matter, for the love of god please "optimize" for something that does: like readability, maintainability, extensiblity, portability, modularity, test-ability, etc.

    Crappy fast software is still crappy software.

    What we're really dealing with here is complexity, and how to manage it. Software engineers design complex programs for complex hardware. You can't possibly know every detail. Thanks to the magic of abstraction, you don't have to.

  60. x86? That's not a real instruction set by biscuit67 · · Score: 2, Funny

    Ewh! Yuckky. Teach them a *REAL* assembly language like MIPS or ARM.

    x86 is just an abortion that got to full term.

  61. "Tight" code not always necessary by James+Lewis · · Score: 2, Insightful
    "Old School" programmers tend to have this obsession with "tight" code, and very effecient code that Assembly language programming teaches. The problem is that some of them lose sight of reality, and sometimes they become downright elitist. The author of this book certainly falls in this category. He says, "The difference between mediocre and star programmers is that star programmers understand assembly language, whether or not they use it on a daily basis." Bullshit. Since when did what language you know determine how good a programmer you are?

    The fact is, MOST of today's programming requirements do not need tight code. Computers have become so fast that even a few million extra operations isn't going to make a percievable difference. That's not to say that there isn't a need for programmers who can program tight code, but the point is that it depends on the application and the platform it will be running on. Programming a huge text editor program like Microsoft Word is going to need good OO code that is easy to follow. You don't want a C hacker trying to squeeze .00000001 seconds out of the spell checker, making the code unfollowable to normal coders in the process, just because he thought it was cool. The fact is, he probably gets a kick out of writing code few others can follow. Maybe that's worth it for applications that need to be very efficient, but for other types of applications it isn't and it is just selfish of a coder to do that to the rest of his team so he can feel superior.

    In the end, how "good" a programmer is depends on how useful their code is and how quickly they can produce it. Usefulness isn't determined by efficiency alone, but by its maintainability and reusabiltiy as well. For some applications, assembly will help you, for others, it won't. Knowing assembly certainly gives you more flexibility, but not knowing it doesn't turn you into a "mediocre programmer". Hopefully, knowing it won't turn you into an elitist bastard like the author. It didn't me :)

    1. Re:"Tight" code not always necessary by johnnyb · · Score: 2, Interesting

      "Bullshit. Since when did what language you know determine how good a programmer you are?"

      Assembly is different. All languages eventually turn into assembly. Knowing how the stack operates, what a stack frame is, what a register is, what addressing modes are available, etc., all bear down on ALL programming languages.

      For example, in C, where should you place your most-used member of a struct? Why, in the first position, since it can be accessed using indirect addressing rather than base pointer addressing.

      Why do Scheme and C often have trouble interacting? Because Scheme's continuations mean that objects on the stack have to be able to live forever, meaning that the hardware stack is near useless.

      Also, many people who have trouble understanding pointers in C are able to "get it" after learning assembly language because it makes the concept far more concrete.

      Why are OO calls more costly than straight function calls? Because the method has to be looked up in a virtual method table first, before it is called. Not only does the lookup cost cycles, but the indirect jump can kill your pipeline.

      Anyway, these are the types of issues that all programmers in all languages have to contend with. It is easier to understand these types of concepts if the programmer knows assembly language.

  62. ASM is not the place to start. by John+Whitley · · Score: 4, Informative

    Perhaps it's time that computer science curriculums start teaching assembly language first.

    Having taught an assembly/into computer arch class, I agree with the sentiment that students who get "under the hood" gain valuable knowledge and working skills. Not just pounding ASM, but in learning how the machine works. Point agreed.

    Also having taught first year computer science students, and seen how some of academia's transitions in pedagogy affected students... I have to say that the idea of teaching first year students in assembly is friggin' daft.

    My reasoning is the same as why I strongly advocated an objects-first teaching model. It is increasingly critical for students to build a strong sense of software design and abstraction early on. This foundation makes students much better prepared to solve problems of many different scales (asm to component-systems) in the long run.

    There's evidence from a paper in one of the Empirical Studies of Programmers workshops that this approach does trade off design skills for purely algorithmic reasoning for students at the end of their first year. But my own experience, as well as that of some prominent Comp Sci Education (CSE) folks seems to indicate that this is far more than compensated for as a student's skills grow.

    Here's my theory as to why this is the case:
    The details of debugging, alogrithmic thinking, and problem solving are very much skill building exercises that really require time of exposure to improve. But it is much more difficult in my experience for students to build good design sense on their own. Once the framework for thinking in terms of good abstractions is laid down, it provides much stronger support for later filling all of those gory low-level details.

    Historical perspective: Ironically, this same reasoning is much of why I believe that academia's switch to C++ from languages like Pascal, Modula-2, etc. was an educational disaster for many years. The astute reader is now thinking: "hey, you just said you like objects-first; what up?" In the Procedural Era, many schools wouldn't expose students to C in the first year, as it had too many pitfalls that distracted from learning the basics of algorithmic thinking and important abstraction skills. Once the foundation was put in place, it was okay to swtich 'em to C for the rest of the program.

    When C++ and the early object boom really hit, this put on big pressure to teach first year students using C++. At one point in the mid-90's, upwards of 75% of 4-year institutions were teaching their first year in C++. Thus a language that had plenty more pitfalls than C, previously shunned for its pedagogical failings, entered the classroom. Combined with a lack of of proper OO mental retooling on the part of first year instructors and faculty made for something of a skills disaster on a broad scale. At best, students learned "Modula-C" instead of good OO style. At worst, they were so confused by this melange of one-instance classes and sloppy hybrid typing that they didn't get a cohesive foundation whatsoever.

  63. Why stop at Assembly language? by Timbotronic · · Score: 2, Insightful
    The most useful project I ever did in my CompSci degree was writing a compiler. It was written in C and compiled a cut down form of Pascal into PDP-11 assembly language. Taught me a hell of a lot about how data is stored, pass-by-reference vs. pass-by-value and the effect of good code on machine efficiency.

    But the one thing that annoyed me in Computer Science was whenever we did the really low-level stuff, the lecturers would say, "We can leave the extra detail to the sparkies (Electronic Engineers)"

    So in my final year of CompSci I did Electronic Engineering 100! I highly recommend it to anyone who wants to look below the "high level" of assembly language and see what's actually happening at the chip level. And if you want to get even more detail, there's alway quantam physics...

    --

    One of these days I'm moving to Theory - everything works there

  64. Actually, they DON'T. by Ungrounded+Lightning · · Score: 5, Interesting

    People who know assembly produce better code by almost any measurement except "object-oriented-ness", which assembly makes difficult to an extreme.

    Actually, they don't.

    A study was done, some decades ago, on the issue of whether compilers were approaching the abilities of a good assembly programmer. The results were surprising:

    While a good assembly programmer could usually beat the compiler if he really hunkered down and applied himself to the particular piece of code, on the average his code would be worse - because he didn't maintain that focus on every line of every program.

    The programmer might know all the tricks. But the compiler knew MOST of the tricks, and applied them EVERYWHERE, ALL THE TIME.

    Potentially the programmer could still beat the compiler in reasonable time by focusing on the code that gets most of the execution. But the second part of Knuth's Law applies: "95% of the processor time is spent in 5% of the code - and it's NOT the 5% you THOUGHT it was." You have to do extra tuning passes AFTER the code is working to find and improve the REAL critical 5%. This typically was unnecessary in applications (though it would sometimes get done in OSes and some servers).

    This discovery lead directly to two things:

    1) Because a programmer can get so much more done and working right with a given time and effort using a compiler than using an assembler, and the compiler was emitting better assembly on the average, assember was abandoned for anything where it wasn't really necessary. That typically means:

    - A little bit in the kernel where it can't be avoided (typically bootup, the very start of the interrupt handling, and maybe context switching). (Unix System 6 kernel was 10k lines, of which 1.5k was assembler - and the assembly fraction got squeezed down from then on.)

    - A little bit in the libraries (typically the very start of a program and the system call subroutines)

    - Maybe a few tiny bits embedded in compiler code, to optimize the core of something slow.

    2) The replacement of microcoded CISC processors (i.e. PDP11, VAX, 68K) with RISC processors (i.e. SPARC, MIPS). (x86 was CISC but hung in there due to initera and cheapness.)

    Who cares if it takes three instructions instead of one to do some complex function, or if execution near jumps isn't straightforward? The compiler will crank out the three instructions and keep track of the funny execution sequence. Meanwhile you can shrink the processor and run the instructions at the microcode engine's speed - which can be increased further by reducing the nubmer of gates and length of wiring, and end up with a smaller chip (which means higher yeilds, which means making use of the next, faster, FAB technology sooner.)

    CISC pushed RISK out of general purpose processors again once the die sizes got big: You can use those extra gates for pipelining, branch prediction, and other stuff that lets you gain back more by parallelism than you lost by expanding the execution units. But it's still alive and well in embedded cores (where you need SOME crunch but want to use most of the silicon for other stuff) and in systems that don't need the absolute cutting-edge of speed or DO need a very low power-per-computation figure.

    The compiler advantage over an assembly programmer is extreme both with RISC and with a poorly-designed CISC instruction set (like the early x86es). Well-designed CISC instruction sets (like PDP11, VAX, and 68k) are tuned to simplify the compilers' work - which makes them understandable enough that the tricks are fewer and good code is easier for a human to write. This puts an assembly programmer back in the running. But on the average the compiler still wins.

    (But understanding how assembly instruction sets work, and how compilers work, are both useful for writing better code at the compiler level. Less so now that optimizers are really good - but the understanding is still helpful.)

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    1. Re:Actually, they DON'T. by steveg · · Score: 2, Informative

      (But understanding how assembly instruction sets work, and how compilers work, are both useful for writing better code at the compiler level. Less so now that optimizers are really good - but the understanding is still helpful.)

      My understanding of the parent post was that this is exactly what he was saying. I don't think he was claiming that programs written in assembly were better, but that programmers who knew assembly were better programmers.

      I think you were agreeing with him.

      --
      Ignorance killed the cat. Curiosity was framed.
    2. Re:Actually, they DON'T. by Anonymous Coward · · Score: 2, Informative

      I used VAX, PDP11 and 68K assembly, and they are actually quite easy to use, because they are orthogonal: all the operands of all the instructions use the same addressing modes, and there are very few exceptions that you need to remember. And the addressing modes themselves are quite obvious and sensible: each meets a real need. The fact that any operand could be in memory was not a problem.

      It was a real shock when this new IBM PC thingy came along and I started dipping into x86 ASM. NOT orthogonal. Not all instructions could use each addressing mode. Downright ugly.

      Moving huge amounts of data is not unique to the VAX et. al. Even the x86 can do it. And the page faults, etc., add no complexity at all because the memory management hardware is at a lower layer, and thus invisible to the assembly language programmer.

      --An old shell-back

    3. Re:Actually, they DON'T. by Ungrounded+Lightning · · Score: 3, Insightful

      Well-designed CISC instruction sets (like PDP11, VAX, and 68k)

      Okay, you had me up to that sentence. It's my understanding from people I know who actually used VAX assembly, that it was a bear. Especially if you had to decode the assembly by hand. It had variable length opcodes, which if I remember right, a single instruction could extend to be upwards of 60 bytes. Oh, and that's not to mention, the 11 different addressing modes, which could be mixed and matched on all three operands (dest, left data, right data). Because all instructions could store directly back to memory, it was a bestie to create.

      Call me crazy, but somehow that much mixing and matching just doesn't sound like [fun].


      I didn't actually use the VAX instruction set - though I did use the PDP11's - both writing and reverse-engineering. They were both designed by the same guy (Gordon Bell) or teams he lead. I'm prepared to defer to people who actually dealt with it that the VAX instruction set was difficult.

      But in the case of the PDP11 (where the few-instructions, lots-of-address-modes style came into its own), the plethora of modes actually simplified the job of the assembly programmer (and the reverse engineer). I can tell you this from experience.

      Multiple address modes shrank the job of understanding the instruction set by splitting it into two parts - the much smaller set of base instructions than you'd need without the symmetry, and the small set of addressing modes. Rather than having an explosion of special purpose instructions with their own addressing modes, you have an explosion of combinations of the members of two small sets. Once you learned the two sets, the proper combination to achieve the result you wanted was obvious.

      The tricks were few - and brilliant.

      - The indirect-increment and indirect-decrement modes let you use any register as a stack pointer or index register, for instance. The "official" stack pointer was just the one that was implied by certain other features: interrupt and subroutine calls, primarily.

      - With the program counter as one of the general registers, applying indirect-auto-increment to it gave you inline constants.

      - The indirect and indirect increment/decrement addressing modes made any register a pointer. (They also led directly to the ++, --, +=, and -= operators of the C language.)

      - The register+offset mode and base/offset duality gets you to particular elements of an argument array, or index into a fixed-location array.

      and so on.

      If you understand a few things about C (Array/pointer duality, walking arrays with auto-increment, etc.), you have exactly the understanding you need to grok the modes of the PDP11 instruction set. (Which is hardly surprising: I understand that much of C was inspired by that instruction set.)

      --
      Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  65. A better assembly language by yintercept · · Score: 2, Interesting
    While the machine code generated might be the same, there are lots of ways to get there.

    Thanks for reminding the forum that Assembler is already one step removed from the actual machine language. I threw myself against several assembler lanuages and never got the result I desired. I loved the logic but hated the syntax.

    Personally, I wish that, in the evolution of computer languages, we spent a little bit more time evolving a somewhat more intuitive set of languages at the assembler level. As there is still a great deal of programming that really should be done at the machine level, an assembler rival might help spur on the use of linux.

    The book is going into my wish list.

  66. Download the book for free by milesw · · Score: 3, Informative

    The book was released under the GNU Free Documentation License, and it can be downloaded for free (in PDF format) from: http://savannah.nongnu.org/projects/pgubook/ .

  67. Lusers...I programin BINARY!!! by asternick · · Score: 2, Funny

    Anyone who cannot simultaneously consider the position of every logic gate and every memory register has NO business being in the same time zone as a computer.

  68. Re:Forget Computer Science! by Perl-Pusher · · Score: 2, Informative

    The CS and CE programs I went to in Virginia only differed by 3-4 classes. CE had 2 semesters of micro controllers, Linear Algebra, Ordinary Diff EQs and Chemistry. While CS required Algorithms and Operating Systems. CS could opt for matrix algebra for business or the engineering based Linear Algebra. Other than that, they were identical. Many students opt for dual degrees. Both required physics,calculus and what they called core curriculm which was Digital design, and alot of programming, computer architecture etc. Both taught assembly, C++,UML and java was a popular elective.

  69. Huh? by FreemanPatrickHenry · · Score: 2, Insightful

    A new book was just released which is based on a new concept - teaching computer science through assembly language

    I didn't know The Art of Computer Programming was a new book.

    --
    I have discovered a truly marvelous .sig which, unfortunately, this space is too small to contain.
  70. Why stop at assembly? by BlueLlama · · Score: 2, Insightful

    First year Electrical Engineering students at the University of Texas at Austin take an Introduction to Computing class that starts with the transistor and uses a book written by Yale Patt, a prof at UT that often teaches the class. The class then teaches how transistors can be combined to make memory circuits, how you store data when represented by bits (2's complement, floating point, ASCII text). You then learn to write basic programs for a simplified computer in actual binary machine code and actually run the code on a simulator developed by students in the advanced computer architecture class. By the time you get to programming in assembly you think it's a relatively high level language and are glad to have it.

    The successor to this class picks up where this one leaves off and teaches C from assembly up with an emphasis on what actually happens when you compile, allocate memory, and other things that a lot of students overlook. C++ is introduced in a later class, as well as algorithms, etc.

    I personally think that I am a much better programmer for having learned in this manner. I took a senior level class in the UT Computer Science Department (which teaches assembly much later in the game) and found that far too many students, including some that were about to graduate, still didn't understand the fundamental differences between handling text data and binary, non-text data in higher level languages. Most still seem to think code executes in a white fluffy cloud and wonder why on earth 119 + 133 = -4 in their program and think '133' == 133.

  71. Re:I taught myself assembly, and I disagree by LorenTB · · Score: 2, Interesting

    blech, 6 figures for VBA macros? I guess it's a living... um, good job, but I'd sooner toss my machine out the window than work with Excel all. day. long.

    There's more to life than money.

  72. Best assembler by rs79 · · Score: 2, Insightful

    The 68K instruction set is better than most of them, although if memory serves the Z80000 was even better.

    But, I still contend the best all time machine language was the PDP-11 instruction set. If anybody knws what they think was a better one I'd love to see it.

    --
    Need Mercedes parts ?
  73. Computer Engineering Perhaps? by Venner · · Score: 2, Informative

    Eh, it isn't really unheard of today.
    In the old days, computer scientists didn't really exist. You basically had groups of electrical engineers, mathematicians, etc, developing what is today computer science.

    As a graduate of an accredited Computer Engineering curriculum, my take is this; computer scientists develop software, algorithms, etc. Computer engineers design the underlying digital circuits, logic, and such. Software guys vs. hardware guys.

    As such, you'll find computer engineers use assembly a heck of a lot more than computer scientists. I've worked with MIPS, x86, motorola's, and several others. And when you get down to it, I like to work with C more than I do with languages like C++ or Java. I enjoy the low-level nitty-gritty.

    I'm making a generalization of course; there's no great schism between the two groups and our work often overlaps. We just each use the tools most appropriate for our jobs.

    --
    A preposition is a terrible thing to end a sentence with.
  74. Bad analogy in the book description by ca1v1n · · Score: 2, Funny

    From the description:

    To be a programmer without ever learning assembly language is like being a professional race car driver without understanding how your carburetor works.

    My corollary:

    To program in assembly language is like driving in the Indy 500 in a car that doesn't have fuel injection.

  75. This book by voodoo1man · · Score: 4, Informative

    has been available for some time under the GNU Free Documentation License. I tried to use it a while back when I decided to learn assembler, but I found Paul Carter's PC Assembly Language to be a much better introduction.

    --

    In the great CONS chain of life, you can either be the CAR or be in the CDR.

  76. On programming in a CS curriculum by DingoBueno · · Score: 2, Interesting

    Am I the only one who went to a school where it was expected that you already had a solid knowledge of programming? From day one I started taking theory classes. Aside from a digital design class where we briefly worked with motorola assembly, the only programming I did in school was to aid in math, physics, and CS theory. I personally find it offensive when somebody assumes that, because I was a CS major, I am nothing but a programmer. Honestly, I was a better programmer before college, because afterward all my time was spent on doing proofs, developing algorithms, studying computability, etc. Implementation was, for the most part, trivial.

    Anyway, that's what I learned about computer science. There are apparently a lot of school that teach *programming*, and I find that to be a real shame.

    --
    ascii art
  77. Forgetting the Most Important Point by duck_prime · · Score: 4, Funny
    For learning, we don't have to learn assembly first anymore, you can start with any language. I think it is good to take a two pronged approach. Learn C first, and at the same time, start learning digital logic. [...] When one is comfortable with both, I think learning assembly is much easier.
    You are missing the One True Purpose of assembly language, and the One True Reason everyone should learn assembly first:

    Nothing else in the Universe can make students grateful -- grateful! -- to be allowed to use C

  78. It's great by Balthisar · · Score: 2, Interesting

    I'm NOT an awesome programmer by any means. But I bet as far as someone that doesn't do it for a living, I'm damn good and could probably hang with a lot of pros.

    I programmed 8510 assy. on my Commodore-128 as a kid. Yeah, I had to, due to limitations of basic.

    There's NOTHING like knowing how a computer works to make a computer work, ya know?

    --
    --Jim (me)
  79. Teach easier langauges first by prozac79 · · Score: 2, Interesting
    I agree that assembly language is an important staple of any computer programmer. However, I don't think it should be taught first for a psychological reason. Teaching assembly first could be very confusing and might turn off people who could make great programmers. One of the things that attracted me to computer science was that I could create cool things right off the bat. My friends in other engineering diciplines had to go through about two years of coursework before they could even start doing anything remotely cool. I was having a great time writing programs in C and Java from day one. Then, when I did learn assembly, I had a much better background and understanding on how my printf statement was really fed into the computer. I don't think I would have had the respect for assembly that I have now if I would have tried to learn it first. It would be like trying to teach someone to drive by first having them put together the engine. Then again, if that were a requirement we would have less bad drivers. But I digress.

    Basically, I liked my education where I was taught concepts in the context of a language. You want to learn about memory allocation? Teach pointers and things in C. You want to learn about object oriented models... use Java or C++. You want to learn about how a computer functions at a base level, learn assembly. The language itself should never be the end goal, it should be a means to learn the concepts. The best programmers I've encountered are ones who have ideas, not ones who can't think outside a particular language.

    --
    "Oh dear, she's stuck in an infinite loop and he's an idiot" -Prof. Farnsworth (Futurama)
  80. Elitist, perhaps? by mblase · · Score: 2, Interesting

    Perhaps it's time that computer science curriculums start teaching assembly language first.

    Yeah, as a mathematics major I've often felt that number theory is glanced over far too often in high schools. Kids really ought to learn why 1+1=2 and how to strictly define multiplication of integers before getting into such oversimplifications of mathematics as the Pythagorean Theorem.

    I think the submitter is proceeding from a false assumption. Anyone who's really pursuing a BS in Computer Science (from a reputable school, anyway) is probably going to get a course in assembly language whether they like it or not, and anyone who hasn't earned a BS shouldn't be calling themselves a "computer scientist."

  81. The Misfits of Science... by frobnoid · · Score: 2, Funny

    JohnnyB, use your lightning powers to teach us ASM!

  82. Who cares about learning about computers? by jsburke · · Score: 2, Insightful

    > High-level languages are great, but learning them will never teach you about computers.

    Who cares? Knowing about computers per se isn't important; knowing how to use computers to solve your problems is. For this, high-level languages are best.

  83. Anyone ever seen Steve Gibsons stuff? by Phil+John · · Score: 2, Interesting

    ...his site is at http://www.grc.com, he's got loads of security related info on his page and a shedload of Win32 progs coded entirely in assembler, every last line of em. He also created the very neat ShieldsUp tool to scare people into getting a personal firewall installed (like listing their netbios share names, doing a remote port scan and telling them the gory details of what people could do to their computer etc.).

    Most of the progs are under 30k in size, including a very cool sub-pixel font-rendering demo, and ones to disable messenger, dcom and upnp. A really nice touch is that some of them have sound fx, produced by a simple virtual synth, also coded in assembler...just cause he could (a true geek!)

    --
    I am NaN
  84. It's available online by revery · · Score: 2, Informative

    Sorry if this has already been mentioned, but the book is available for dowload from this site, under the filelist link. Here is a direct link to the pdf.

    --

    Was it the sheep climbing onto the altar, or the cattle lowing to be slain,
    or the Son of God hanging dead and bloodied on a cross that told me this was a world condemned, but loved and bought with blood.

  85. Your analogy is incorrect, amoung other things by xtal · · Score: 3, Insightful

    I race cars, albeit not professionally. You are very incorrect.

    Being able to tell your crew that you think your car is leaning out under hard accelleration or that your suspension is too stiff or unbalanced is made easier if you understand the physics and engineering involved. Most professional race car drivers know a very great deal about these things indeed. Unless you are born rich, most dedicated racers build and repair their own cars and know a great deal indeed about the tools of their trade.

    I have an EE degreee; I was taught how to build registers from logic gates; how to build counters and adders from those; how to form the basics of a primitive cpu and implement one in vhdl; how to program x86 assembly; I was also taught how the electrical signals interact to make those things possible; the physics of semiconductors and the things that make those logic gates possible. All of those things have made me able to more effectively program computers on a high level. Why would we expect less from a CS program? Computational engines, computers, are the things that drive the CS profession. I would expect anyone in the field to be intimately aware of their theoretical underpinnings.

    Ironically, they have also made me a much better driver as I am intimately aware of the workings and how to tune my car's EFI system than most may be.

    Would you go to a doctor who has never taken chemistry? Didn't think so.

    --
    ..don't panic
  86. Compilers do this by lunachik · · Score: 2, Insightful

    Modern compilers are smart enough to perform many of these optimizations, and sometimes obsfucating your code can even interfere with their ability to recognize optimizable situations.

  87. Chills? It Ain't That Bad. Just Avoid x86 To Start by cmholm · · Score: 2, Interesting
    "Assembly" used to send chills down my spine, too, until my job required that I get over it and just do it. I think a big stumbling block is that the first instruction set most potential asm coders see is for the 8086 and it's large set of god-awful address indexing instructions. At least, that's the way it was at CSU, Northridge back in the day.

    However, when my then employer needed a high performance CPU for their missiles, they designed what in later days would have been called a RISC chip. The instruction set was all of maybe 20, so few that many of us found ourselves coding patches directly in hex. There were just a few general purpose registers and four pages of memory to worry about.

    It was elegant, straight forward, and only took a few sessions writing a patch to get the hang of. Once over the hurdle of writing a few lines on an embedded system like that, taking the next step and coding to an API of an open source system ain't too much bigger of a deal.

    --
    Luke, help me take this mask off ... Just for once, let me butterfly kiss you with my own eyes.
  88. Computer Scientists aren't programmers by smoon · · Score: 5, Insightful

    The problem is that computer scientists don't make good programmers and vice-versa. If you're good with code and hunker down to write lots of programs, then you tend to clash with the all-theory-no-code camp that delights in big-O notation and graph theory. Of course there is a lot of middle ground, but in general the PHd professor types that staff CompSci departments I've been in tend to have stopped learning about computers as soon as they finished their doctorate and instead concentrate on internecine politics, incomprehensible papers, and teaching the occaisional class (leaving most of that to T.A.'s who actually teach the class and understand how to compile programs).

    Meanwhile the coder types graduate with a B.S. or maybe a masters then go into commercial development shops and crank out code, forgetting as much as they can about red-black trees and other subtle CompSci concepts.

    So if you want to crank out programmers, then assembly is probably a good thing. God knows I learned a lot from the assembly classes I took.

    If you're trying to scare students away then assembly is also a good tactic. Nothing like a good hex dump to get some non CompSci students eyes to glaze over. Sort of like making people take Biology or Physics, but instead of teaching about cells and newtonian motion, jump right into the finer points of quantum mechanics or amino acid chemistry.

    On the other hand, for 2nd year CompSci students, Assembly is probably a good thing to get out of the way. It really sucks, for example to take economics for 4 years only to learn at the end "just kidding, reality is too complex to model so these are all just gross oversimplifications." Sort of like thinking programming == Java then finding out how it all _really_ works.

    --
    "But actually trying to use m4 as a general-purpose langage would be deeply perverse" --ESR
  89. Re: Don't program at all by d34thm0nk3y · · Score: 3, Insightful

    lesson 1: never listen to radio shack employees, you would probably get better advice from some random homeless people on the street, at least one of them is probably an out of work software engineer these days

    lesson 2 (for the grandparent): It could just be that doing basic for 3 years prepared you to do asm, which obviously has a steeper learning curve. Also, you just did the same thing to the great grandparent that the stupid HS teacher did to you, conratulations on being a complete hypocrite.

  90. CS != uber-coder degree by Senior+Frac · · Score: 4, Insightful

    Perhaps it's time that computer science curriculums start teaching assembly language first.

    It's more critical they actually teach computer science first, instead of programming. A new CS hire, assuming their school was worth a damn, can learn a new language. I want to know if they have the math background to understand the problems that will be handed to them and that they have the ability to self-learn.

  91. I think Jon von Neumann would agree, learn ASM! by Proudrooster · · Score: 2, Interesting

    Who is Jon von Neumann? If you don't know and are planning on programming you should find out. Worse, if you already have a CS degree and don't know about "von Neumann" architecture then you missed am important topic.

    If you want high performance code, you must understand procedural programming and assembly language. You must understand the components of the modern "von Neumann" architecture like RAM, Registeres, L1 cache, L2 cache, ALU etc ....

    While everyone has gone OOP (Object Oriented) crazy, the "von Neumann" architecture is NOT optimized for OOP programming. Because modern CPU's have lots of cache, the latency that exists between the CPU and Memory is reduced. This is called "faking" memory bandwidth, read this article on the von Nuemann bottleneck.

    Serious coders should learn ASM, then move to a higher level language like 'C' then see how the 'C' statements compile in ASM and then analyze efficiency.

    Modern wisdom says, be wasteful, vendors will make bigger/faster machines and we won't have to care that our code is slow, inefficient, and not optimized for the architecture. Keep in mind, you can save substantially on hardware expenditures by hiring good coders that know how to tune and optimize code but, if you don't want to be bothered, just plan on large capital expenditures every couple of years. Also write everything is JAVA and make sure you create indexes on every column of every table in your database for faster lookups.. ( I am joking, don't really do this. )

    1. Re:I think Jon von Neumann would agree, learn ASM! by foonf · · Score: 2, Insightful

      According to legend, towards the end of his life von Neumann was having graduate students hand-assemble programs he had written into machine code. They decided to write an assembler to do the work automatically, and he was apparently quite unhappy about it, not seeing any reason for a higher level of abstraction than machine language and viewing the diversion of time to write an assembler to be a waste. So he might not exactly approve...

      But learning assembly != learning architecture, and with the x86 it is probably counter-productive since you have to explain afterwards what the processor really does behind your back when you use memory operands, string instructions, etc... Understanding the architecture is important, but assembly language in and of itself is not that important, and x86 is an especially bad choice.

      --

      "(Man) tries to live his own life as if he were telling a story. But you have to choose: live or tell." --Sartre
  92. Re:Vacume tubes? by root:DavidOgg · · Score: 5, Funny

    When *I* was young we didn't *have* vacuum in space yet! You post-big-bang kids don't know how easy you have it!

    --
    --AROS is an Open Source AmigaOS clone, and source compatible with AmigaOS! Try the x86 build at http://www.aros.org
  93. Just to clarify by Raul654 · · Score: 5, Informative

    The correct answers are down there, but just to collect them and clarify - you can build anything using nothing but NANDS. Alternatively, you can build anything using nothing but XORS. You can prove this easily using demorgan's theorem.

    However, in the real world, NANDS are cheap (2-3 transistors), so that's what everyone uses.

    --


    To make laws that man cannot, and will not obey, serves to bring all law into contempt.
    --E.C. Stanton
  94. SICP by paxil · · Score: 2, Interesting

    Sounds like a bad idea to me, for reasons pointed out in other posts.

    For a first course in CS, I think it would be hard to do better than one based on Structure and Interpretation of Computer Programs .

    This book takes one from zero to writing a compiler in a few hundred pages, including a chapter on writing code for register machines which gives the student a good idea of what is going on "under the hood."

    To those who would say that Scheme is useless outside of academics, I would counter that once the concepts in this text are mastered, it is easy to transfer them to other languages.

  95. Amen! by SuperChuck69 · · Score: 2, Interesting
    My God, I've only been out of school going on 6 years now and I'm already antiquated. I learned my assembly, I studied my architectures, I shifted bits.

    These days, kids come out of school unable to manipulate simple pointers. Why? Because the sissy langauges they use don't even USE pointers, so they were never TAUGHT pointers. God forbid they have to figure out how a machine is going to execute their code!

    What they do know how to do is read. They read what's going to happen in the future. They read about the NEXT version of Java and its speed and other associated wonders. They read about how feature xyz is supposed to work (I read the source code for feature xyz; it doesn't work that way). They read about the flying car they're going to be cruising around in in a few scant years.

    As a fallen Java evangelist (not to pick on Java, but it deserves it), I've learned that there are a few constants in that particular language. It's slow as balls; it has been since I was using it in alpha 7 or 8 years ago, and every version promises that the next will be faster than C. Container-managed beans suck; for 5 years, they've been saying that the mythical container (read as: someone else) will magically optimize them, which we all know is bullox. The more fictional something is the more it's talked about; Java's been talking about Jini for something like 4 years now, with absolutely nothing to show for it.

    If students spent more time learning assembly and less time fluffing around with "references" (which is short for "retarded pointers"), they'd be much more bitter and cynical... Like me.

    --
    :wq
  96. You're a little bit confused. by Jerk+City+Troll · · Score: 4, Insightful

    Computer science isn't "knowing computers on a deeper level." Computer science is algorithms and lots of math. Computer scientists don't care about how a computer works. They don't care about the language either. They are interested in data structures and how to work with them. What language is in use is really unimportant, be it Java or Assembly.

  97. Assembly for speed? by DonGar · · Score: 4, Insightful

    I have say that trying to program in low level languages, or worrying about the details of the machine archtecture has usually been (in my experience) counter productive in terms of efficiency.

    I'm not saying that there aren't places where low level details aren't critical, but for the most part they just draw attention away from the thing that has the most impact on performance.

    Application Architecture.

    The choices of algorithms and data structures are far more important than any low level details. But low level details are more fun, and tend to make us feel more manly or guruly or something so we tend to focus on them instead. In practice I find that using low level languages or super optimized tools make it hard to worry about high level structure, so the structure gets ignored.

    I once worked on a project in which people were seriously freaking out over the performance hit in using virtual functions while parsing the configuration file.

    At the same time, the application (a firewall) was performing multiple linear searches through linked lists of several hundred items per packet. These searches were very carefully optimized, so they had to be fast... (sigh). When I switched the system to use STL dictionaries (and later hashes), total throughput jumped three fold, yet some of the developers were worried about the cost of the templates and virtual functions used.

    The fact that the algorithm is more important thatnthe details of implementation is a lesson that everyone (myself included) needs to keep getting pounded into them, because it's so easy to forget.

    There are places where assembler and hardware details matter a great deal. But they are usually places that contain a lot of repetition that can't be removed algorithmically. Graphics are the obvious example.

    A recent example:

    My brother in law gave me one of those boards with pegs in which you try to jump your way down to a single peg remaining. I have no idea what it's called, but anyway....

    I decided to be cute, and wrote a 100 line python scrpt over lunch to find all possible solutions. I was suprised when it hadn't found a single solution by the time I was finished eating. I was a lot more suprised when it hadn't found anything by the end of the day.

    So I killed it and started in optimizing for performance and tweaking and trying different things. This kept me occupied over lunch for a couple of weeks, but didn't produce anything else. Finally I started doing some analysis of the problem. The first thing I found was that the search space (for the board I had) was roughly 10**18.

    I didn't matter how much I tweaked the details of my search, it wasn't going to find very many solutions in less than a century (actually, it looks like a naive full search will take several thousand years).

    So, after wasting several weeks of lunch breaks, I have redefined the problem. Find A solution, and rewritten my search to use a heuristic. I finished everthing but the heuristic at lunch a couple of days ago. The new system will take 100 or even a 1000 times as long to perform a jump, but I'm expecting to find a solution before I'm dead.

    So, don't get bogged down in the details of an implementation. They won't usually take you very far.

    --
    plus-good, double-plus-good
    1. Re:Assembly for speed? by hugesmile · · Score: 2, Funny
      If it's a "plus shaped" board, with 32 pegs, and a hole in the middle, it was called "Hi-Q".

      A very efficient algorithm for you is to do a google search and you have a solution.

      Google: thousands of times faster than Assembler.

  98. Good, but not a good starting point by RallyDriver · · Score: 2, Informative

    Speaking from some experience (CS undergrad TA while in grad school)....

    A few thoughts:

    It's essential to teach some assembly at some point in a CS undergrad - A CS course should give full insight into the workings of a real CPU, and should give as wide a variety as possible.

    At Edinburgh the first year CS course included assembly, C, and ... wait for it ... PostScript. PS sounds wacky but it's the only stack based language widely used on modern computers (APL and Forth have died out).

    When I was a CS undergrad we had practical classes in no fewer than 17 languages, covering the range of imperative, declarative, functional and stack based, plus specialist toys like theorem provers and SQL.

    The best starting point for a university level course is the good old procedural language - in my day it was Pascal, C++ and Modula-3, these days I'd use Java (and many CS departments do).

    Also, when you do get to assembler, I don't think using a real assembler is the best teaching tool - assemblers are intended for developing real low level code, or as back end targets for compilers. For teaching at Edinburgh, we used an X11 based tool called xspim which simulated a MIPS R2000 (we actually ran it on Sun Sparc-II's, not that it matters), and it let you single step and examine registers without the complexity of adding a debugger, and had a window where you could see the registers, CPU pipeline etc. displayed.

    For introducing programming concepts to a younger audience I think an interpreted language which will execute command lines, allowing them to experiment while avoiding the edit-compile-run cycle, is very important. Some are better than others; when I was a kid the 8 bit micros (Apple, Commodore, Atari, ...) had BASIC interpreters in ROM, and they were mostly OK, though the only one with a really good BASIC language (proper procedures, not GOSUB) was the Acorn BBC.

    I don't like Pilot or Comal for teaching (failed experiments of the 1980's) but I think LOGO is a very commendable way to make concepts accessible to the young.

    A perhaps unexpected place I was made to learn with an interpreted environment was as an undergrad at Cambridge University, where the first programming language taught is ML which for the CS people who haven't heard of is an implementation of lambda calculus with a sane syntax.

  99. 4-bit Full Adder Using Relays or Vacuum Tubes by BigBlockMopar · · Score: 5, Funny

    However, in the real world, NANDS are cheap (2-3 transistors), so that's what everyone uses.

    Well, NANDs are easy to make with MOSFETs or vacuum tubes.

    But I suggest that, in order to simplify the learning of digital logic and avoid this whole nastiness of DeMorgan, we should adopt relays as our primary logic device.

    Think about it: two relays with their contacts in parallel = OR. Two relays with their contacts in series = AND. A relay with normally-closed contacts = NOT.

    In this way, all design work can be done with natural logic (AND, OR, NOT) rather than "efficient" NAND, NOR, etc.

    On top of that, your computer would make satisfying clicking sounds reminiscent of a pinball machine's scorekeeping system or an old elevator contoller, while you're crunching SETI@Home units.

    I'm building a 4-bit binary full adder with nothing but relays in order to demonstrate their sheer computing power, and was hoping that someone could write me drivers to allow it to have practical uses.

    --
    Fire and Meat. Yummy.
    1. Re:4-bit Full Adder Using Relays or Vacuum Tubes by nameer · · Score: 2, Informative
      Ladder Logic!

      I've built machine control cabinets with all of the logic done as relay circuits. Many control-reliable circuits (such as "emergency-stop") are still done using relays (albiet solid state ones). Although PLC's have for the most part replaced relay logic, they are still programed by the shop floor electricians using a UI that looks like a relay schematic.

      It's kind of a kick to think through a control problem in ladder logic, build it, and then listen to the clicking as it works through.

      --
      "Uh... yeah, Brain, but where are we going to find rubber pants our size?" --Pinky
  100. From a ring counter to OOP by rcpitt · · Score: 4, Interesting
    The first piece of digital gear I ever had my hands on was the size of a small desk and about 5' high. It had just enough "logic" on it to create an eight bit ring counter (0 1 10 11 100...)

    That was in 1965 and the unit was the only one for our whole school district and worth about $30,000 (CDN - about $35000 US at the time)

    From there to today's Object Oriented Programming languages has been an interesting time. I wouldn't have missed it for anything, and I honestly think that living through it has given me a perspective that many more recent programmers don't have and IMHO need, sometimes.

    Where "brute force and ignorance" solutions are practical, there is no gain in knowing enough about the underlying hardware and bit twiddling to make things run 1000% faster after spending 6 months re-programming to manually optimize. In fact, since (C and other) compilers have become easily architecture tuned, there really are few areas where speed gains from hardware knowledge can be had, let alone made cost effective. Most are at the hardware interface level - the drivers - most recently USB for example.

    If you're happy with programming Visual Basic and your employer can afford the hardware costs that ramping up your single CPU "solution" to deal with millions of visitors instead of hundreds, then you don't need to know anything about the underlying hardware at the bit level.

    On the other hand, if you need to wring the most "visits" out of off-the-shelf hardware somehow, then you need to know enough to calculate the theoretical CPU cycles per visit.

    Somewhere between these two extremes lies reality.

    Today I use my hardware knowledge mostly as a "bullshit filter" when dealing with claims and statistics from various vendors. I have an empiric understanding of why (and under what circumstances) a processor with 512 Megs of level 1 cache and a front-side bus at 500MHz might be faster than a processor with 256 Megs of L1 cache and a 800MHz FSB and vice versa. Same thing for cost effectiveness of SCSI vs IDE when dealing with a database app vs. access to large images in a file system (something that came up today with a customer when spec'ing a pair of file servers, one for each type application)

    Back in the mid 70s I dealt with people who optimized applications on million $ machines capable of about 100 online users at one time. Today I deal with optimization on $1000-$3000 machines with thousands of 'active' sessions and millions of 'hits' per day. Different situations but similar problems. Major difference is in the cost of "throwing hardware at the problem" (and throwing the operating systems to go with the HW - but then I use Linux so not much of a difference ;)

    Bottom line is that understanding the underlying hardware helps me quite a bit - but only as a specialist in optimization and cost-effectiveness now, not in getting things to work at all as in the past.

    --
    Been there, done that, paid for the T-shirt
    and didn't get it
  101. I Suggest FORTRAN (or C as a second choice) by DaveAtFraud · · Score: 2, Interesting

    I ended up teaching introductory Pascal back in the late '80s and found it to be useful only for teaching programming concepts but useless for teaching the students about how computers actually work. As an alternative to Pascal, I would choose FORTRAN over C because its possible to introduce students to things like internal representation without getting them tied up in their shorts over things like pass be reference vs. pass by value, pointers, etc. If C is bad, assembler is worse because the students will more likely get bogged down in nuances of assembly syntax. Also, if someone simply wants to learn how to program in C, I would suggest they buy "C for Dummies" and knock themselves out. On the otherhand, if someone wants to learn about how a computer works while at the same time being introduced to programming skills, debugging, etc., I'd go with something like FORTRAN as the teaching language.

    The goal of a first "computer science" class should not be to merely teach technical skills (programming, debugging, program design) but to also give the students an understanding of how computers work. Even with today's proliferation of home computers, most people (student or otherwise) have utterly no idea how a computer works internally since their exposure is limited to simply installing software someone else wrote. Assembler is too far on the side of "how the CPU works" without giving the student any better insight into how the whole system actually operates (memory, CPU, storage, peripherals, etc.) than a higher level language while requiring much more effort by the student to accomplish anything useful. This would seem to indicate that a second generation language such as FORTRAN (or C) would be more likely to let the course delve into programming, machine operations, machine organization, etc. It also means that the students can produce "interesting" programs fairly early on which will keep more people interested (which would you rather have: a PHB MBA with no programming classes or one that has at least sat through enough classes to have some understanding of what goes on inside the box and how difficult that can be to accomplish).

    One other complaint against assembler as an introductory teaching language is that, depending on the specific assembler, it is usually difficult to see the overall program structure even after the program is complete. This is primarily due to the low implementation level that leaves simple program controls (if-then-else, do-for, do-while, etc.) burried in the assembler syntax of loading and testing registers and smeared out over what is generally multiple individual statements. The student *may* end up with an appreciation of what it involves to implement these structures but will loose site of the tree (control structure) and never even notice the forrest (overall program design).

    --
    They that can give up essential liberty to obtain a little temporary safety deserve neither safety nor liberty.
    Ben
  102. Re:For the poor like me here is the download by johnnyb · · Score: 2, Informative

    That's an old link - outdated version. Go to

    http://savannah.nongnu.org/projects/pgubook/

  103. Re:Forget Computer Science! by Paolomania · · Score: 2, Insightful

    By definition. Science is the application of a rigorous discipline in an attempt to understand nature. Computing has nothing to do with understanding nature and everything to do with implementing logic in physical systems.

    You sir, have confused Computer Science with Computer Engineering. In actuality, Computer Science research ends up a massive agglomeration of Mathematics, Statistics, and Physics. Computer Science attempts to understand nature in many ways, both with and without the assistance of a computing tool: by understanding the nature of different questions and how difficult they are to answer (language theory, complexity theory, etc.), by attempting to find algorithms that mimic the natural phenomenon of a mind (vision, agents, etc.), by motivating numerical simulation of natural phenomenon (photorealistic rendering, inverse kinematics, etc.)

    Of course, you might disagree.

    Of course.

  104. Better for computer engineers by ashot · · Score: 2, Informative

    This strategy generally works better for Computer Engineers rather then Computer Scientists because what you are really learning with Assembly tends to be how the hardware functions. In fact if you are going to learn assembly, you could spend just another month and learn the basics of computer architecture. I feel like that is what really helped me de-mystify the computing process: the ability to trace back all the way to elementary physical processes, and see the computer as a almost a physical entity rather than a magical black box.

    For an example of this, you can see Patt and Patel's "Introduction to Computing Systems:From bits and gates, to C and beyond." I took and TA for a course that uses this book.

    --
    -ashot
  105. PDP11, VAX, 68K mislabeled by snStarter · · Score: 2, Informative

    No one would really call the PDP-11 a CISC machine. You might call it a RISC VAX however (pause for audience laughter).

    Also, many PDP-11's were random logic and not micro-coded. The later 11's were microcoded, of course, the 11/60 being the extreme because it had a writeable control store that let you define your own micro-coded instructions.

    It's important to remember that the entire RT-11 operating system was written entirely in MACRO-11 by some amazing software engineers who knew the PDP-11 instruction set inside and out. The result was an operating system that ran very nicely in a 4K word footprint.

    The VAX had a terrific compiler, BLISS-32, which created amazingly efficient code; code no human being would ever create but fantastic none-the-less.

  106. Oh, Wow. Deja Vu Again by Bob+Munck · · Score: 2, Funny
    We had this discussion at the ACM 20th Conference in 1968. It was me and Andy van Dam from Brown arguing with Al Perlis (Yale), Bernie Galler (UMich), and Harlan Mills (IBM). We used a simplified version of IBM/360 Assembler called SOS in the first-semester CS course, and the big guns on the other side thought we should switch to Algol. I mentioned my IF-THEN-ELSE macros for Assembler, and Harlan really liked the idea.

    Afterward a cute Pembroker in a really short skirt came up to introduce herself. I don't know if she agreed with our argument, but she's been my wife for quite awhile now. I don't teach much any more, but when I teach beginning CS, I teach assembler. The students we taught machine programming to back then have held positions like VP at Microsoft, CS Department Head at MIT, Princeton, Washington, UNH, and Waterloo.

    I wish people wouldn't keep referring to C as a "programming language;" it's a pathology.

  107. in reality... by slew · · Score: 4, Informative

    For what it's worth, they don't use just NANDs in cmos chip design in the real world. The primary primitive is the AND-OR-INVERT (AOI) structure.

    In the cmos world, pass-gates are much cheaper than amplifying gates (in the size vs speed vs power tradeoff), although you can't put too many pass gates in a row (signal degradation). So in fact MUX (multiplexor to pass one of the two inputs using the control of a third) and XORS (use input A to pass either !B or B) are used quite a bit.

    Some background might be helpful to think about the more complicated AOI struture, though...

    In a cmos NAND-gate, the pull-up side is two p-type pass gates in parallel from the output to Vdd (the positive rail) so that if either of the two p-type gates is low, the output is pulled high. For the pull-down side, two n-type pass gates are in series to ground so both n-type gates have to be low before the output is pulled to ground. This gives us a total of 4 transistors for a cmos-nand where the longest pass gate depth is 2 (the pull-down). The pull-down is restricted to be the complement function of the pull-down in CMOS (otherwize either the pull-up and pull-down will fight or nobody will pull causing the output to float and/or oscillate).

    A 2-input NOR gate has the p-type in series and the n-type in parallel (for the same # of transistors).

    Due to a quirk of semi-conductor technology, n-type transistors are easier to make more powerfull than p-type so usually a NAND is often slightly faster than a NOR (the two series n-types in a NAND gate are better at pulling down than the two series p-types are at pulling up in a NOR gate). However, this isn't the end of the story...

    Notice that you can build a 3-input NAND by just adding more p-type transistors in parallel to the pull-up and more n-type in series to the pull-down. You can make even more complicated logic by putting the pull-up and pull-down transistor in combinations of series and parallel configurations. The most interesting cmos configurations are called AOI (and-or-invert) since they are the ones you can make with simple parallel chains of pass transistors in series for pull-up and pull-down.

    For most cmos semi-conductor technologies, you are limited to about 4 pass gates in series or parallel before the noise margin starts to kill you and you need to stop using pass gates and just start a new amplifying "gate". Thus most chips are designed to use 4 input AOI gates where possible and smaller gates to finish out the logic implementation.

    Thus "everyone" really uses lots of different types of gates (including simple NAND and XORS as well as more complicated AOI).

  108. Re:Question by craigtay · · Score: 2, Informative

    Switching a task in an OS is called context switching. This means that the OS saves all of the registers used by the application, and then loads up the saved registers of the task you are switching to. When this task has ended, or another context switch occurs, the registers of the saved task are then reloaded.

    If you go to www.google.com and look up context switching you should be able to find all the information you'll ever need!

  109. PDP-11 C / Origin of gcc by rs79 · · Score: 2, Interesting

    I understand that much of C was inspired by that instruction set.

    I'm not sure inspired would be the right way to say that. C was invented a shorthand for assembler, in particular PDP-11 assembler. I'm probably just being pedantic but I think it's an important distinction.

    We owe a lot to those machines, by '74 UNIX and C were available (barely) from Bell Labs but by the late summer of 76 Dave Conroy at Teklogix in Mississauga, Ontario, had written and made work the only C compiler not written by Bell Labs, which ran under RSX-11M. This became DECUS C, and then gcc.

    I worked there between high school and university ; Dave taught me C to test his compiler and must have got all of about $1200 for writing it as it only took him a few weeks. It was of course written entirely in assembler.

    --
    Need Mercedes parts ?
    1. Re:PDP-11 C / Origin of gcc by nutznboltz · · Score: 2, Interesting

      C was invented a shorthand for assembler, in particular PDP-11 assembler.

      Yes, C is basically an abstracted PDP-11.

      Dave Conroy at Teklogix in Mississauga, Ontario, had written and made work the only C compiler not written by Bell Labs

      Is this the same Dave Conroy that does FPGA re-implimentations of old DEC computers?

      http://www.spies.com/~dgc/

  110. Assembly = excellent programmer ? by cr_nucleus · · Score: 2, Insightful

    I fail to see the causality here. How does "excellent programmers know assembly" translates to "teaching assembly to everyone will make everyone an excellent programmer" ?

    Does it also means that you can't be an excellent programmer without knowing assembly ? Well that certainly depends on how you define an "excellent programmer" but i think it's quite quick of a conclusion.

    That said, if assembly can certainly be harsh for newbies, the lack of abstraction can certainly be helpful in some cases. But appart from that, i'm not sure that it will change much from the current situation (as good or as bad as you want to see it).

  111. Really Simple Machines instead.... by 16K+Ram+Pack · · Score: 2, Insightful
    My first machine was a Timex/Sinclair machine. My second was an Amstrad 8256.

    As a kid, I did a lot of stuff on them, mostly just tinkering. Some of the things I did were to do with like building a multi line input system like I'd seen on a mainframe at college (so you could tab to fields). It was all built in BASIC, but from it, I understood the concepts behind things.

  112. Use C by jabber01 · · Score: 2, Interesting

    Ladies and Gentlemen of the Slashdot community... Code in C.

    If I could offer you only one tip for your future as programmers, C would be it. The long-term benefits of C have been proved by scientists, and academics, and professionals, and corporations all over the world, whereas the rest of my advice has no basis more reliable than a Microsoft marketing report. I will dispense this advice now.

    Enjoy the power and beauty of simple command line tools. Oh never mind, you will not understand the benefits of vi, make, grep and gcc until you're working as a contractor, and that fancy environment you have at home isn't available. But trust me, in 5 years, you'll sit down in front of an expensive IDE, pore over the GUI menus and checkboxes, read the badly written two-inch-thick manual twice, and still not be able to write a program to say "Hello World!" You'll then recall in a way you can't grasp now, the importance of understanding how to get useful work done with the standard, simple tools.

    Don't worry about not using the latest and greatest Microsoft tools or language; or worry, but know that worrying is as effective as watching all your carefully crafted code fail because a registry setting or dll you depend on was changed by the installation of some do-nothing program. The real troubles in your programming career are apt to be things that never crossed your worried mind; like a middle manager who wipes out the /opt directory thinking it to be "optional" while trying to make space for his porn collection, or a lethal bug in your fancy CASE tool.

    Write one script every day to aid you.

    csh!

    Don't be reckless with other people's test procedures, don't put up with people who are reckless with yours.

    Lint.

    Don't waste time on hand-optimizing your code; sometimes you're elegant, sometimes you're a kludge... The optimizing compiler will do it better anyway, and in the end you'll have to maintain the source code - so keep it readable.

    Remember the useful code snippets you receive, forget the cruft. If you succeed in putting together an elegant an efficient source "proverb" library, send it to me.

    Keep a logbook of your programming efforts. Toss your core dumps.

    Top.

    Don't feel guilty about not following a particular development methodology completely. The most useful programs I've seen have been cobbled together ad hoc. Projects I've seen follow the Rational Unified Process, Extreme Programming or Aspect Oriented Programming methodologies to the letter, dies over budget and behind schedule.

    Get comfortable with revision control.

    Be kind to your O'Reilly books. You'll miss them when they're gone.

    Maybe you'll become famous, maybe you won't, maybe you'll win the Turing, maybe you won't, maybe your codified soul will be ignored sight unseen, maybe you'll crank out the next Mosaic... Whatever you do, don't congratulate yourself too much or berate yourself either - the commercial success of your program depends more on the whims of lawyers and marketing drones than on the technical merits of your application or the effort you've put in. So does everybody else's.

    Enjoy your home computer, use it every way you can... Don't just use it to hack away at code or to automate your bedroom lights or to run a website, it's the greatest tool for self-expression you'll ever own.

    Learn... even if you have nowhere to do it but from a weblog forum. Read the responses, even if you don't agree with them. Do NOT read Ziff-Davis magazines, they will only make you feel like a long-haired, smelly zealot.

    Get to know your kernel, you never know when you'll need to recompile it yourself. Be prudent about your patches, they are the best trace of development and the means most likely to keep you safe and relevant in the future.

    Understand that CASE, GUI and other developer tools come and go, but for the precious few you should truly know. Work hard to bridge the gaps between convenience and uti

    --

    The REAL jabber has the user id: 13196
    What you do today will cost you a day of your life

  113. Re:Assembler and the dragon book ... by multipartmixed · · Score: 2, Insightful

    The Dragon Book, while one of my favourites (...as I glance over and see it nestled between K&R pre-ANSI 2nd ed. and Tannenbaum's OS book..) is certainly not a good *intro* to programming book, which is what the article is about.

    Take a proficient programmer who knows an HLL and assembler, feed him the Dragon Book and you _will_ have a better programmer in the end, though. So your point is certainly valid, but the timing of that book's intro should be carefully planned in a curriculum. If you're not proficient with an HLL, and at least halfway competent in some form of assembler, it will totally fuck you up.

    --

    Do daemons dream of electric sleep()?
  114. Assembly by fadethepolice · · Score: 2, Interesting

    I definitely agree with the idea that computer programmers need to learn assembly, and other low-level programming skills. I started my education as an Electronics Engineering Technician in D.C., (i used to teach NSA techs how to build FM radios in the electronics lab) Anyway... my career has been mostly writing macros, maintaining networks, user support, light engineering, etc. and I feel that my in-depth knowledge of computers has helped me immeasureably in these higher-level areas of software maintenance. I laugh at "micosofties" that graduate from colleges here in Northeast PA with their MCSE... I outperform them on a regular basis.

  115. Not a new idea by RCR · · Score: 2, Interesting

    In 1978 I had a liberal arts degree and no job. I borrowed $2000 and went to a trade school to learn computer programming. That $2000 has paid off big time of the last 26 years and continues to do so. The course started with a simulated, 1000-memory-cell decimal "computer"; we programmed it in assembler. We then went to IBM 360-style assembler (all this was on punched cards), followed by Fortran, RPG, and COBOL.

    I got a job right away for a company that made data comm hardware and, naturally, used assembler. I didn't touch a high-level language till 1984 (and that was C).

    As the years have gone by, the trade (NOT profession!) has become more and more the domain of the "computer scientist". These are the guys who learned how to write compilers in school. Often, they're disappointed when the job involves something more mundane. These are also the guys who have trouble with pointers and other basic concepts because they don't really know what's going on on the machines they program.

    German machinists used to spend a year doing nothing but filing as part of their training. Nothing but filing. These were people who honored their craft. Assembler is the computer equivalent. Without it, you might be a "scientist", but you'll be a lousy craftsman.

    I once worked for a guy who learned programming in the Air Force in the 60's. His motto: "It's all just loads and stores and branches."

  116. Anyone ever heard of Barbiac? by GorillaTest · · Score: 2, Interesting

    It's a contrived simple assembler they used to use at AT&T to teach programmers assembler. This is not a new concept. This kind of touches on one of my themes, that being that most younger computer science people are mere technicians who are in the field to make money, not because they love it. They don't have a clue about the history of their discipline, nor do they care. I really see this in the the 15 to 30 year olds. 99 times out of 100 they really don't have much of a clue. In a way I feel sad for them, because they didn't experience things before the huge monolithic companies (you know the cube farm sweat shops like Adobe and Apple and Microsoft) got on the scene and pushed lots of wonderful products off the market through business muscle and not survival of the best product. I also feel sad when I try to hire people. Most graduates that I interview know a whole bunch about Visual Basic and SQL, and not much else. (In other words they have no real training at all)