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."

1,328 comments

  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 Anonymous Coward · · Score: 0

      Two different subjects. Asm is tha car, the kernel is the road.

    4. Re:Linux x86 assembly? by gangien · · Score: 1

      aren't the interrupts different? Everything all the other instructions would be the same tho I think. But i thought interrupts were OS instructions.

    5. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0
      Assembly language is not machine language.

      The difference between "Linux x86 assembly" and any other kind of x86 assembly is that linux assemblers generally use an AT&T like syntax and other x86 assemblers use a MASM like syntax - the only difference being syntax.

    6. Re:Linux x86 assembly? by jhoger · · Score: 1

      The OS calls available are different from other platforms, obviously.

      Also, more importantly, the syntax of the GNU assembler is very different if you're used to the Intel syntax.

      -- John.

    7. Re:Linux x86 assembly? by AndroidCat · · Score: 1

      Sure. While the machine code generated might be the same, there are lots of ways to get there. An assembler might use non-standard mnemonics, or one might be a macro assembler. One might allow structures. (Object oriented assembler is a lot of fun.)

      --
      One line blog. I hear that they're called Twitters now.
    8. Re:Linux x86 assembly? by dysprosia · · Score: 1

      Uhh, the system calls will be different if you're coding assembly under anything else than Linux.

    9. 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.

    10. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0
      Uhh, the system calls will be different if you're coding assembly under anything else than Linux.

      That is like claiming C++ on Windows is a different language than C++ on Linux. The differences are API and implementation details.

    11. 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!!
    12. Re:Linux x86 assembly? by Anonymous Coward · · Score: 1, Funny
      Asm is tha car, the kernel is the road.

      And a win kernel is the road to Hades.

    13. 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.

    14. Re:Linux x86 assembly? by dysprosia · · Score: 1

      No it isn't, because the system calls talk to the kernel, while if you're doing things with C++ or any other language they get fed through a standard library first.

    15. Re:Linux x86 assembly? by sprig · · Score: 1
      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.
      I agree. I've always though of intel assembly as a kind of "reverse polish notation"... everything seems backwards.
    16. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      No but it sure helps lubrication - see the girlfriend comment above ...

    17. 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
    18. 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
    19. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      Interrupts are raised by a device and interrupt what the CPU is doing. It runs a program stored in memory for that interrupt, eg the ISR.

      An example would be the keyboard. The ISR will read the pressed key and add it to the buffer.

      In general the ISR will either be part of the OS or part of an application running on the computer - the latter is more common in embedded systems these days, which do not usually have an OS and just have that application running.

    20. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      CS curriculum NEEDS to be more high level. We just don't want developers coming out of college that understand the fundamentals of programming so that their job can be shipped to India. We want programmers coming out that understand current languages and design techniques, not something left to those pursuing graduate degrees.

      Curriculum does need to change, but to a higher level (read Program Design and Architecture), not to a lower level.

    21. Re:Linux x86 assembly? by Blakis · · Score: 1

      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.

      You're missing one of the most important goals of high-level programming concepts such as OO: to make things easier for the programmer, not the computer. Yes, it's probably less efficient in terms of speed, size, etc., but programmers want tools that are easy for us to map into the actual problem domain we're trying to solve. That's where the real value comes into play.

    22. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      That's why (aside from embedded projects), assembly is mostly used to optimize a few specific functions. You'll never see a large modern program written entirely in assembly language.

      However, with a profiler, you can find out which functions are taking up most of your CPU time, and write assembly routines for those small areas. This is especially true of modern computer games.

    23. 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.
    24. Re:Linux x86 assembly? by frovingslosh · · Score: 1
      Is "Linux x86 assembly" any different to any other kind of "x86 assembly"?

      There certainly are differences, and those differences will be extremely important to someone just trying to learn assembly. Without knowing what system the book is based on, if someone were to try learning assembly on a different system using the book they would be completely lost. A few things that come to mind include:

      The API that you are working with. It matters a lot of you are trying to interact with a terminal if you should use a DOS system call, the Win32 API, a Linux system call, a BIOS call, or directly manipulate the hardware with machine instructions.

      The Assembler itself. Different assemblers might include different directives, macro support, and other features. If your trying to introduce a new programmer to the mysteries of assembly language, it's important to make this as clear as you can, not leave it to the user to figure out the differences.

      How to evoke the assembler. Remember, we're talking about teaching from the beginning here. It's important that the user know the right way to start the assmembler, both in what command to run and what switches it needs. Looking back at some old DOS products it is important to know if he needs to do a seperate "bind" step as well, and to let him know how to run, test, and even debug the result.

      So yes, making clear that the book is for Linux assembly and not for another platform like Windows assembly is important.

      --
      I'm an American. I love this country and the freedoms that we used to have.
    25. 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.

    26. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      The syntax is AT&T rather than Intel, as it is in the Windows/DOS world.

    27. Re:Linux x86 assembly? by CosmeticLobotamy · · Score: 1

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

      Sure. But in 18 months it will be replaced by something three times as inneficient.

      I'm not saying write everything in assembly, but "who cares if it's not very efficient" is a really terrible way to think. That's what Microsoft and the Nazis did.

    28. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      your right. I was really mad when I had taught myself C and took programming in college that taught me C++. but they never taught me about how to do useful things like hooking dll's or making system calls or event driven programming. so its a big gap in the education system IMHO.

    29. Re:Linux x86 assembly? by snatchitup · · Score: 1

      There's a big difference in x86 vs. ARM assebly.

      Basically, with x86, there's all this worry about segment registers. Also, in x86 certain registers are used for certain things.

      With ARM, all you registers are basically treated equal.

      also, on ARM (THUMB), you may optimize your code differently. For instance, conditional instructions... With conditionals, you do the comparison, but no jumps for branching. You may write the if code, sprinkled with the else code. the reason for this is to increase cache hits. It's hard to explain, but very cool for cache.

      I'm sure that there are similar things for intel cisc chips of late. But, one thing is for sure.

      99% of all the code that is executed in the world today takes very little advantage of these architectural optimizations. The Chips are just so fast that it's not worth the bother.

    30. Re:Linux x86 assembly? by Bas_Wijnen · · Score: 1

      I don't see how the Nazis fit into this, but I don't think I want to know either ;-)

      OO code is not meant to be as inefficient as possible. If non-OO code is twice as efficient, then you probably had a bad OO coder. And there's no reason that an update should be slower. If you are considering the slowness just because of the OO design, that is.

      Problems arise when you say: Who cares about efficiency, as long as we can release our product in time. That is what Microsoft usually seems to do, and that does indeed mean that the update will be even slower. If you are coding well, however, there is no reason for an update to be any slower at all. And in that case, a factor of at most 2 below the most efficient possible program is a fair price for maintainability.

    31. Re:Linux x86 assembly? by E_elven · · Score: 1

      >I'm not saying write everything in assembly, but "who cares if it's not very efficient" is a really terrible way to think. That's what Microsoft and the Nazis did.

      I beg to differ. The Nazis were, sadly, very effective.

      --
      Marxist evolution is just N generations away!
    32. 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.

      --
      ---
    33. Re:Linux x86 assembly? by Progman3K · · Score: 1

      You know, I wonder about that whole "cycles are cheap, people are expensive"

      It seems to be the same excuse hacks have been using to foist substandard programming on us for years now.

      Did you ever stop to think about what the world would be like if people actually wrote optimized code all the time?

      For one thing, I'm pretty sure computers would be perceived as being a lot faster, and at all levels I mean. All those crappy routines add together and give what you have today...

      Maybe I've been around Windows too long...

      --
      I don't know the meaning of the word 'don't' - J
    34. 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

    35. Re:Linux x86 assembly? by NanoGator · · Score: 0, Offtopic

      "And a win kernel is the road to Hades."

      At least the Monica Lewinski jokes finally died down.

      --
      "Derp de derp."
    36. Re:Linux x86 assembly? by WindBourne · · Score: 1

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

      No, but I know it is radically different than Mix, which I suspect that only a few here will know what I am talking about.

      --
      I prefer the "u" in honour as it seems to be missing these days.
    37. 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.

    38. Re:Linux x86 assembly? by rskrishnan · · Score: 1

      Well sort of - an assembly programmer has to provide information to the assembler + linker to generate the actual code that will cooperate with the operating system - i.e. the OS determines to a large extent where the stack shoudl start, whats the default heap size/location, what order things are located in memory etc. This is no more than just "target'ing" your code for a specific OS - most embedded tools/guys do this each time they switch processors/micro-controllers.

    39. Re:Linux x86 assembly? by PCM2 · · Score: 1

      Whereas I am totally confused as to why this distinction is so confusing. You're saying the order of the value and the register seems backwards? Back in the olden days, on the 6502 series, if you wanted to load a register with a given value, you'd pick a register and load the value into it with the appropriate opcode: LDA $A6 to load the accumulator, for instance, where LDA is mnemonic for "LoaD Accumulator." Seems to me Intel just invented a more versatile opcode. Next time you see the opcode "mov," try training your head to pronounce it "load" instead of "move."

      --
      Breakfast served all day!
    40. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      [If it smells like b*llsh*t...]

      There is nothing about OO languages (themselves) that cause a compiler/translator/architecture ANY more trouble than C. HOWEVER, there are some FEATURES available with OOP/D that cause a BIT more runtime overhead when used, and if used improperly, a measurably small amount of runtime overhead. (I'm considering statically linked languages like most C++, not Obj-C or SmallTalk here.)

      When you get right down to it, there is nothing in OOP/D design without an assembly analog (how do you think compilers work?). Consider a member function call, it is just a function call with a this pointer. Consider a virtual member function call -- It's just a function call through a function pointer with a this pointer. Consider inheritence -- it's just appending multiple data structures together... I could go on, but my point is just that OOP languages are NOT the problem, it's the developers using them.

      [FULL DISCLOSURE: I am an embedded DSP developer who knows probably over 15 different assembly languages (x86, 680x0, PPC, ADI-DSPs, TI-DSPs, 8051, 68HC11, ARM, etc), and still uses C++ whenever I can.]

      (goes back to topic)

      I completely disagree with teaching a student how to program using assembly. There is nothing about assembly programming that is EASY to debug, and debugging is the first thing students should be taught when learning to program. If academia has come full circle and decided that this is the new way to teach, then I have truly seen it all (from asm to fortran to C to C++ to Java and now asm)... At least we've finally gotten rid of that Java thing... :)

    41. Re:Linux x86 assembly? by whittrash · · Score: 1

      To abuse an analogy, aren't you talking about the difference between a BMW and a pickup truck. The BMW will go really fast but is not practical for certain situations. Wheras a pickup truck will not attract chicks.

    42. 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.
    43. Re:Linux x86 assembly? by turm · · Score: 1

      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.

      I couldn't possibly agree more with this. Hits the nail right on the head.

      ...I consider that as one of the better arguments against OO code - It simply does not map well to real-world CPUs...

      This on the otherhand, couldn't be more incorrect. I'm not sure I'll ever understand the motivation of people who post this crud. How can anyone know so little, and not know that they know so little?

      Object oriented code is just as fast as anything else. If you don't believe me, listen to Stroustrup:
      Learning Standard C++ as a New Language.

    44. Re:Linux x86 assembly? by Anonymous Coward · · Score: 1, Insightful

      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.

      Embedded Systems?

      I guess there goes the vast majority.

    45. Re:Linux x86 assembly? by Captain+Segfault · · Score: 1

      I dunno about MIX, but gcc (sorta) has support for MMIX, so you don't need to code in MMIX asm if you don't want to.

    46. Re:Linux x86 assembly? by 680x0 · · Score: 1

      Devices are a source of interrupts. Error conditions in the processor are another (divide by zero, for example). And finally, explicit instructions to generate interrupts are used for various purposes: break points inserted by a debugger, and calling the operating system (which is usually not done via a simple subroutine call due to priviledge levels and virtual memory issues).

    47. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      Yes, its the other way round!

      (source, target rather than target, source)

      mov $2,ax
      rather than
      mov ax,$2

      Also the directives are different to, for example, MS assembler.

    48. Re:Linux x86 assembly? by EzInKy · · Score: 1

      The kernel is basically just a big library that handles I/O and memory management.

      --
      Time is what keeps everything from happening all at once.
    49. Re:Linux x86 assembly? by studerby · · Score: 1
      While the maxim is true, the "who cares" is not. With *poor* OO architectures, it's a lot easier to write programs that won't complete until well after the heat-death of the Universe. In such cases, a processor-derived halving of the runtime doesn't really help much.

      Which is not to say that we should go back to stone knives and bearskins, just to avoid a wasted cycles, but rather to say that todays' latest toys work better with a thorough understanding of the basics, so that the OO solution is in fact "well architected", and that any definition of "well architected" has to take performance efficiencies into account, not just object elegance.

      And by the way, there's a number of well-documented cases in the real world wherein increasing CPU performance actually degraded overall system throughput. This is particularly "not-uncommon" with complex database systems. See this PDF, originally published by Oracle.

      --

      .sig generation error:468(3)

    50. Re:Linux x86 assembly? by Lost+Engineer · · Score: 1

      Depends on the chicks. And the truck for that matter. Still, I'd take the Bimmer.

    51. 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.
    52. 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.

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

      And what software there was would be impossible to modify.

      --
      # (/.);;
      - : float -> float -> float =
    54. Re:Linux x86 assembly? by WindBourne · · Score: 1

      mmix is the new version of mix. The original stuff of don's was called Mix. Gotta admit that it would have been nice to have a real assembler for mix back then.

      --
      I prefer the "u" in honour as it seems to be missing these days.
    55. Re:Linux x86 assembly? by farnz · · Score: 1
      I still think the 680x0 series are the best.

      Have you ever attempted to write assembly language for the ARM chips? Things like condition codes on every instruction make it much easier than on any other chip I've used. And machines are still being built (even if they are expensive) - see the Iyonix

    56. 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.

    57. 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
    58. 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.

    59. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      you're a dumbass. the pdf by stroustroup is for C++, not object-oriented programming.

    60. Re:Linux x86 assembly? by haystor · · Score: 1

      You can only fit one body in the trunk of a BMW.

      --
      t
    61. Re:Linux x86 assembly? by raster · · Score: 1

      Ohhhhhhhhh I so agree with you! :)

      --
      --------------- Codito, ergo sum - "I code, therefore I am" --------------------
    62. Re:Linux x86 assembly? by geekoid · · Score: 1

      yes, he certianly wouldn't have a bias.

      I'll wager a years salary that it is not as fast as assembly.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    63. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      Yes, some CPUs do also have internal interrupts.
      But not all.
      Also, some CPUs don't have any interrupts at all though.

      It all depends on the architecture really.

      In any case though, they are not as OS instruction (although you may find there's an instruction that will raise one, I don't know).

    64. Re:Linux x86 assembly? by johnnyb · · Score: 1

      Mix is actually what inspired me to write the book. I loved Knuth's approach from the assembler level, but felt there were two deficiencies:

      1) There was no introduction to programming. Knuth's books assumed you knew how to program already.

      2) It used Mix. I felt that for new programmers a real language would be a more concrete learning experience.

    65. Re:Linux x86 assembly? by Wolfrider · · Score: 1

      --I seem to remember reading a magazine article many, many years ago (we're talking maybe sometime in mid-to-late 1980's) that said something about Intel registers having to be programmed in "backwords" order... That would explain it.

      See clicky - sorry, I googled and asked jeeves for like 10 minutes and that's the only reasonable link I could come up with.

      --
      .
      == WolfriderV6 == I'm willing to admit that *I just might* be wrong... Are you??
    66. Re:Linux x86 assembly? by randyest · · Score: 1

      Huh? How's that? I mean, assuming the same CPU in both cases, and besides the IDE/text editor/simulator, how exactly is programming assembly language "under" or "in" Linux different than doing the same under DOS/Windows?

      This is neither a troll nor a flame, though maybe I'll be modded such for implying these acts are one in the same (they are), but I'm just trying to understand what distinction you're making before I comment further.

      --
      everything in moderation
    67. 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.

    68. 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

    69. Re:Linux x86 assembly? by vsprintf · · Score: 1

      It seems to be the same excuse hacks have been using to foist substandard programming on us for years now.
      . . .
      Maybe I've been around Windows too long...

      Testify, brother! :)

    70. 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.

    71. Re:Linux x86 assembly? by Mr+Pippin · · Score: 1

      ABI AND API. You have to have the former before you can implement the latter.

    72. Re:Linux x86 assembly? by captainwasabi · · Score: 1

      The assembly code will depend on the assembler being used. The machine code will work within the common instruction set.

      As someone who has worked in about 15 assembly languages over 20 years, from Honeywell Mainframe Assembly to machine code, 8080 to risc, and from using no embedded OS at all to a full RTOS, I personally believe that the original premise of this article is as wrong as you can get. Knowing the mid-level workings of the electronics will teach nothing about Computer Science. Computer Science involves creating and working with an abstraction layer which is appropriate to the problem. The actual language used to implement this abstraction is irrelevent.

      I look back on the old days of assembly language hacking with nostalgia as much as the next person. I see what you can do these days with the support of all the great tools available and say "man, if they had to do this on an 8051 with 2k of ram this would sure be done differently." but that is not the case today, and that is a good thing. Looking back over the years and seeing the developments in the industry and what we are able to do now compared to then makes me wonder what the development tools of the next 20 years will be like. Program development has yet to move much past the command line driven methods of 20 years ago. I believe this will change to a more visual and sensual method before the next 20 years is up.

      Again, Computer Science is about using tools and choosing the correct tool for the job. While assembly language programming will never go away it is only one tool out of the many which are available today.

    73. Re:Linux x86 assembly? by d34thm0nk3y · · Score: 1

      wow, that sounds really fun. do you have any book or website reccomendations for a complete beginner?

    74. Re:Linux x86 assembly? by be-fan · · Score: 1

      If we actually adhered to the mantra "cycles are cheap, people are expensive" we'd be using fast, compiled, *safe* languages. There are a number of languages (notably CL and Dylan) that can get within 80-90% of the performance of C assuming equally well-written code. That remaining 20% would easily be made up by getting rid of all the crap (memory protection, process domains, enormous complexity in the virtual memory manager, a kernel/userspace boundry) that is completely unnecessary given a safe language.

      --
      A deep unwavering belief is a sure sign you're missing something...
    75. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      Not really weak minded, the draw of assembler is that you want to look inside the black box. You want to understand what is happening inside the machine and not just manipulate an object and hope the OS will react predictably or your compiler is working properly. I only program in assembler, both GoAsm and MASM for Windows, C, C++ and VB hold no interest for me. I refuse to relinquish my control of the machine to runtimes and compilers, there is a one-to-one relationship between what I write in assembler and the output in machine code, no other language can say this. Multithreading is easy in assembly, DLL's are easy to the point of being absurd. Generally a knowledge of the API for Windows or using Interupts for Linux is enough to get you started in assembly language and there are many forums with people who are more than pleased to help with just about any question. I find assembly is the only language that is worth learning.

    76. 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.
    77. Re:Linux x86 assembly? by kohsuke · · Score: 1

      In assembly, you can't do anything unless you use the system calls. I mean, you can't even exit your process unless you use one. Therefore, practically any assembly program has to be OS-dependent, hence "Linux x86 assembly"

    78. Re:Linux x86 assembly? by spectecjr · · Score: 1

      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.


      No, I believe you'll find that the C64's assembly language is written the wrong way. The correct (Zilog) way is the other way around.

      Sheesh... these C64 users... Sinclair owners still have to put them in their place. ;-)

      --
      Coming soon - pyrogyra
    79. 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.
    80. Re:Linux x86 assembly? by ganns.com · · Score: 1

      I agree that knowledge of assembly language helps in understanding the way computers work. These days, that understanding is not critical, nor even necessary in writing good programs. Instead of spending a semester or two honing assembly language skills, why not become specialized in a subset of a popular language?

    81. 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?
    82. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      ?! CS graduates should be more qualified than anyone to judge the run time of a piece of code.

    83. Re:Linux x86 assembly? by Witsu · · Score: 1

      Assembly language is part of the curriculum for computer science at my university, as is c/c++ and java. As long as you choose the hardware option. They teach using MASM on Windows though, but it is still x86. I'd imagine the basic commands are all the same, probably with just some formatting changes. System calls would probably be very different however. Learning assembly language does seem to help you learn about the computer. To program assembler, you actually need to understand how a CPU does it's work. You see some of what is behind the simple C commands. It can also produce extremely efficient programs. I think it is a great idea to teach assembler to computer science students, as long as they also learn a high level language, as these days high level programming is probably much more in demand.

    84. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      ...does more than calculate pie.

      Calculate me a big ole cherry pie, you dirty man you.

    85. Re:Linux x86 assembly? by BoneFlower · · Score: 1

      Hey, a pickup truck works fine for transvestites from Transylvania!

    86. Re:Linux x86 assembly? by skajake · · Score: 1

      Not when you consider that AND, OR and NEGATE logic is all you need to know the basics.

      --

      ~ Maintainer of the Skajake Projects

    87. Re:Linux x86 assembly? by starm_ · · Score: 1

      The HC08 is even easyer then the HC11. You can't really adress external memory like the HC11 though. So its not good if you need alot of memory. It doesn't have an E strobe. You could theoritically send address on some ports, BSET BCLR another signal to act as a E strobe.

      Appart from that it is the same as the HC11 I think. You just don't have to deal with adressing external memory and other things. You you still get like thirty some bits of I/O so you can control a bunch of things without adressing. And I think its cheaper. You can event get like a 4$ versions (although with much less I/O bits).

      If you are new to asm you will discover that you can do an amazing quantity of things with only half a kB of ram. I think the chip also includes 16k of flash memory. The version I was using anyways: MC68HC908GP32

    88. Re:Linux x86 assembly? by BoneFlower · · Score: 1

      he was comparing to C, not assembly. and its much more complicated than "just as fast" if you actually read that paper.

    89. Re:Linux x86 assembly? by dysprosia · · Score: 1

      Because the system calls under Linux will be different than the system calls/interrupts under DOS or Windows. In DOS you have int 21h, which you do not have in Linux, for example.

    90. Re:Linux x86 assembly? by iron_weasel · · Score: 0

      No No No. You don't understand.

      This is MACHINE language and is dictated by the processor language set. Not by something called Linux.

      Perhaps it would be more precise to infer that Linux MAY create a program that is an ASSEMBLER and not put in all the mnemonics for the real hardware instruction set.

      I was an IBM code junky as worked on the nucleus for many years. All in BAL(basic assembler language).

      If the ASM Program does not faithfully and fully implement all the mnemoics for he processor hardware language set then its flawed IMO. What would it do that?

      Now as to implementing macros and such I can see the differences yet one does not have to use macros.

      Why I often wondered was the PC assembler prograrm by MSFT or IBM called the Macro Assembler? But I did use it way back there and still have it squirreled away somewhere.

      Most know that real hackors(not hackers) who hack out cracks for various propietary products(Phrozen Crew et.al. ) are absolutel asm/machine language wizards and they have some very nice tools available to crack code. Also some nice tutorials, or at least used to.

    91. Re:Linux x86 assembly? by Endive4Ever · · Score: 1

      The 'HC11A1 part has enough built-in EEPROM memory to do quite a bit, if you're writing it all in assembly language, and becomes a true single-chip solution. I haven't used the HC08 mainly because I have so much 'HC11 'stuff' lying around. I'm not sure what you mean when you say it needs external memory.

      For a job about five years ago I coded an 'HC05 part. (It was a biofeedback device for 'pelvic floor' muscle development- it was called the 'electro-kegel' by some- if you know what I'm getting at, yes, I wrote code for that...) We did it 'cheap', doing the whole development on one of Motorola's $500 Evaluation Boards hooked to PC's serial port. You can do a heck of a lot with Moto. or Microchip (PIC) parts without investing a whole lot. You're in an 8-bit world, then, but that's not so bad.

      --
      ---
    92. 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

    93. Re:Linux x86 assembly? by beauzo · · Score: 1

      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.

      My three-legged dog runs faster then most with four...

    94. Re:Linux x86 assembly? by JesterXXV · · Score: 1

      You can't run Linux binaries under Windows, or vice-versa (without an emulator or tools like Wine or Cygwin), can you? That's because while programs for either use the same set of opcodes, the way they pass information to and from the kernel is different. Not only the kernel, but the available libraries differ greatly.

      --
      Yo mama so fake, she failed the Turing Test.
    95. Re:Linux x86 assembly? by gerardlt · · Score: 1

      Ah, the Atari ST. My happiest programming days (perhaps happiest because I wasn't yet old enough to have to earn a crust!) were spent in front of one of them.

      I taught myself 68000 assembler using Devpac 3. I basically just stepped though code in the debugger until I'd worked out what each instruction did. Later I bought a book which filled in the details. When I got to uni I found myself correcting the Lecturer on details of the Processor - I passed that module practically with my eyes shut!

      Unless I'm badly mistaken the later chips in the series did have a barrel shifter - Something like the 68020 or 68030 (As used in the Atari Falcon).

      I'm now writing code for a PIC, and I certainly wish THAT had a barrel shifter! Very slow multiplication routines! The program I'm writing is so tight on memory that the C compiler is struggling - humans can allocate RAM far better than compilers at this scale! I've also found bugs in both the compilers I'm using. Grrr.

      --
      /* This sig is disabled. Press CTRL-W to enable. Thankyou */
    96. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      >> Multithreading is easy in assembly

      That's encouraging! Could you maybe tell me in 50 words or less how it's done? Thanks!

    97. 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.

    98. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      > Two different subjects. Asm is tha car, the kernel is the road.

      No, the kernel is the CDR!

    99. Re:Linux x86 assembly? by sageman · · Score: 1

      Funny, but in my programming world (Open Source, baby!), cycles are expensive and people are free. Well, I guess closed source programming is clearly better, so we can save all that money by buying cheap cycles to pay off the couple of Cathedral programers.

      Not trolling, by the way. Just trying to be funny.

      --
      --- "To iterate is human, to recurse divine." -- Robert Heller
    100. 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

    101. Re:Linux x86 assembly? by starm_ · · Score: 1

      When I meant more memory I meant RAM. They give you plenty of flash or eeprom but ram theres only 512 bytes I think. I know.. its a lot when programming in assembly but...With the HC11 you can put external ram and memory mapped devices. With the HC08 you dont have that luxury. (Well as I explained in my other post you can always emulate it in software)

      I think the HC05 has a different instruction set than the HC11 and HC08. right? a little more primitive. Hey you say 8bit for the 05 did you mean in contrast to the HC11??? cause the HC08 is 8bit also, but I though the HC11 was the same. The HC11 has a few more registers I think. The HC08 has only 8-bit Accumulator A and a 16bit index register.

      My setup was even cheaper that yours. I used the free http://www.pemicro.com/ics08/ software for the compiler and programmer. It even includes an emulator and an in-circuit real-time Debugger!

      I heard that with de motorola kit can you even programm in C. Is that true?

      I made my home programming circuit on a breadboard connecting my serial cable with *frigen* paper clips.

      It was for university project, and the uni was too cheap to buy equipment. The first project in the microcontroler class was to make your own equipment.

      Im sure the 500$ development kit must be much nicer to work with.

      I fryed 4 units just because as it turns out my power off switch (a switch I unssolded for an old radio yes very cheap uni) was making spikes when I turned off the circuit. Putting a capacitor between the ground and 5V solved the problem.
      Debugging hardware is a real pain. Even more of a pain than debbuging asm.

    102. Re:Linux x86 assembly? by dtfinch · · Score: 1

      There actually is a big difference, despite them producing the same machine code.

      The GNU assembler (as) used by gcc uses AT&T's assembly syntax while most of the dos/windows assemblers, including those embedded in compilers like vc++ use Intel's assembly syntax. The two look very different. AT&T's is more type strict in the syntax (like movl instead of mov), and the operand order is different for most instructions, with the source and destination swapped.

      This is just in general. You can find Intel and AT&T style assemblers for both platforms nowadays.

    103. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0


      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.


      What the fuck does the Operating System have to do with the syntax used for assembly. That's like saying you can only used gcc on Linux. Last I checked, NASM works great for linux targets and uses a modified Intel syntax.

    104. 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
    105. 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
    106. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      "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."

      dx is only 16-bit. You'd have to be using edx to make the data sizes equivalent. As for 4, it turns into an immediate in your x86 example, because x86 doesn't have the 4 register.

      rts

    107. Re:Linux x86 assembly? by MarcoAtWork · · Score: 1

      thanks for the trip down memory lane, I couldn't remember the name of Devpac 3 (my fave assembler) and yes, IIRC the 68020 and later did have a barrel shifter but obviously you couldn't program for that and expect it to work on the 'standard' ataris... still the b&w monitor was the best, I could spend hours in front of that thing and never get headaches or anything and it was totally pin sharp!

      Sometimes I wish I ended up doing embedded software development, while high level languages have their allure I'd love to do 'smaller' stuff in assembly where I have control on most of everything instead of yet again working on a bit-part in a monster-sized project...

      --
      -- the cake is a lie
    108. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      maxim: cycles are cheap, people are expensive.

      This is only locally true. If you're talking a small-scale solution, then that's all there is to it.

      If you're talking about something that will be distributed to a large number of customers, then it's no longer absolutely true. See, you only need to pay your programmers once to write the code, but someone has to buy hardware for each machine they're running it on. At some scale, the cost of hardware exceeds the cost of people.

      Of course I doubt OO alone makes a big enough dent to matter.

    109. 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.
    110. Re:Linux x86 assembly? by statusbar · · Score: 1

      Did you just call MFC a decent class library??!!?!!

      MFC succeeds in being re-used because VC++ automatically spits out MFC code, not because it is a decent class library. It is the textbook example of how NOT to design a c++ class library!

      --jeff++

      --
      ipv6 is my vpn
    111. Re:Linux x86 assembly? by chgros · · Score: 1

      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)
      Or, more simply, a hash table.

    112. Re:Linux x86 assembly? by jrnchimera · · Score: 1

      Ummm Yoda, the whole point of learning assembly well is so that a software engineer is well rounded. Sure in todays world many software engineers will never need to know a whole lot about writing close to the hardware. But some of us really *DO* want to be well rounded. Also there is nothing wrong with *cross training* for those who think there is some imaginary boundary between Computer Science and Computer Engineering.

    113. Re:Linux x86 assembly? by jadavis · · Score: 1

      Actually, you can do anything with NAND logic gates. You don't need anything else.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
    114. Re:Linux x86 assembly? by 2short · · Score: 1

      Assuming we're talking about a project of any significant size:

      "If you hand craft in assembler, you then will get well architectured code."

      From what I've seen, buggy, impossible to decipher spaghetti is more common.

      "Even though it may take 10 times as long to write"

      Try 10,000.

      "It will be 100 time more efficient"

      Maybe 10%, if you're good.

      Now for a few lines of inline assembler, if say a 50% speed improvement is a big deal, definitely spend the 10 - 100 times as long to write it.

      "I'd rather have a programmer working for me..."

      If you're doing significant projects on x86 in assembler, you don't have any programmers working for you, or won't for long. Maintainability matters.

    115. Re:Linux x86 assembly? by YouHaveSnail · · Score: 1

      Mea culpa, you're right. What was I thinking?

      But the point stands. Code reuse is not just some unfulfilled promise in C++, and most of us who write any significant amount of C++ reuse classes all the time.

    116. Re:Linux x86 assembly? by JollyFinn · · Score: 1
      And what software there was would be impossible to modify.

      And because programmers are forced to do it anyway... For programmers open source would be medical term.

      --
      Emacs is good operating system, but it has one flaw: Its text editor could be better.
    117. Re:Linux x86 assembly? by pla · · Score: 1

      What the fuck does the Operating System have to do with the syntax used for assembly.

      Ah, I so love replying to bitter ACs...

      Anyway...

      OS matters quite a bit. On Linux, you use GCC. On Wintel, you use Masm or Tasm. End of story.

      Yeah, alternatives exist. But then, I can also write my own compiler normally only associated with platform X, and then pretend to act shocked when people claim that my platform of choice doesn't have great support for that particular compiler.

      Not really all that inspired... More like pissing into the wind. Linux has AT&T syntax assembler, Windows has Intel synax assemblers. Exceptions exist, but not enough to worry about.

      (FWIW, I made my original claim even after having extensively used a hellish 65HC05 AT&T syntax cross-assembler, with its "native" platform a Wintel one. So there).

    118. Re:Linux x86 assembly? by the_duke_of_hazzard · · Score: 1
      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.

      Nonsense. "Everything else" is not a matter of syntax. What about OO paradigms, for example, or database connections? And if you've only used a lower-level language, your experience and understanding of development will be limited; only the most perverse programmer would develop GUIs in a low-level language.

      Obviously being able to code in assembler is an essential skill for anybody who wants to code properly, but if you said that to me in an interview that would put me off you, rather than your lack of knowledge of Java.

    119. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0
      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.

      Actually it's not that bad -- you just have to accept that it's a very low-level language (leaving straight binary as the lowest). As you learn it, you learn how registers and memory work together, along with other computer concepts. Stuff falls into place. You also have to accept that it can be tedious and you'll certainly want to start writing macros to take care of the drudge work.

    120. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0
      BTW, I certainly don't advocate assembler as a first computer language - second, perhaps.

      Hard to say. I ended up learning basic COBOL first. It never really made sense until I later learned assembler. I usually debugged COBOL abends people brought me by looking at the dump and the corresponding generated assembler code.

    121. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      At ANU, we learnt assembly alongside Modula-2 (a designed-for-education procedural programming language, afaik) in first year. Was great fun. I still remember the snickers emitted when discussing our text: "Oh My! Modula-2"

      Thinking back, I remember shortly after our 3rd assignment how we all loved assembly, cause we got to code in octal instead of using binary instructions!

    122. 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.

    123. Re:Linux x86 assembly? by lars_stefan_axelsson · · Score: 1

      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).

      I'd never thought I'd say this, as I've been into computer security and dependability for the past 7-8 years or so (and yes, am doing research into the former, and have taught assembly langage programming at university). But that's all fine and well until you factor in the performance requirements.

      With today's complex architectures and higher and higher level languages, paradoxically you need to know more about the architecture and how your high level description is distilled down to it if you are going to have a chance to reason about efficiency. It's not for nothing that modern applications spend as much as 90% of their time i chache misses.

      Now, you left a loop hole with 'most developers'. To start and argue that I'd point out that most developers are employed by major industry, i.e. they don't build a product for the end cosumer (like MS Office) but instead develop systems that will be used in house, or as part of a larger product, such as a telephone switch. I'd still say that 'most' developers need an understanding of how their code is going to do memory and speed wise. (One of my pet peeves with the otherwise excelent language Haskell, it's bloody impossible to reason about memory usage).

      --
      Stefan Axelsson
    124. Re:Linux x86 assembly? by gangien · · Score: 1

      Well when we did Dos ASM we used interrupts to read/write files, to get time, mount of bytes ect. THose sure don't seem like they could be done in hardware to me, since then it would have to support all file I/O in varius FSs and such. but i'm not an expert, as you can probably tell.

    125. Re:Linux x86 assembly? by fessor · · Score: 1

      God i miss the old days of democoding on my amiga

      can still remember most of the tricks me and my old ASmOne 1.25 had going :)

      *snifle* gotta find my amiga.... ..fessor..

    126. Re:Linux x86 assembly? by MechaStreisand · · Score: 1

      It's definitely a good thing to know assembly language when doing programming in a high-level language. The reasons you have outlined here are good examples.

      What everyone else seems to be talking about, though, is that there's a big difference between knowing assembly language and coding real projects in it. Writing in assembly is a slow and bug-filled process, and even worse, the big thing with software is that it changes frequently: the code you spent more time writing in assembly than you would have in some high-level language might just get tossed out with the next change of requirements.

      We don't like OO programming because it's perfect. We like it because it's better than the alternatives. It gives us flexibility, and this makes software easy to change, which is the most important thing. People are expensive. Cycles are cheap. We know that OO programming tends to destroy locality of reference and doesn't map well onto CPUs. We don't care! It makes our lives easier. No one cares if it runs slowly: they just care that it runs when they want it as opposed to months or years later. And besides, the parts that do run slowly can be profiled and optimized, and if necessary... coded in assembly.

      Everyone wins when software is well-designed and easy to change. Performance just usually isn't an issue these days, machine performance, anyway. Coder performance is key.

      --
      Disclaimer: IANAL. This post is, however, legal advice, and creates an attorney-client relationship.
    127. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      In my experience, good programmers know assembly language (among other languages), but don't write most of their code in it.

      People who only know the languages they were taught in school are horribly bad programmers and write unmaintainable code. I'm not saying that those who program in their spare time are inevitably better, many of them are bad, too... But I've never met a good programmer who didn't know far more than is taught in school (and far more than is required for their job).

    128. Re:Linux x86 assembly? by byolinux · · Score: 1

      What about PPC Assembly?

      I did some Z80 back in the day, but I quite fancy writing some assembly stuff for my PowerBook.

      Anyone got any tips?

    129. Re:Linux x86 assembly? by bjpirt · · Score: 1

      This one is pretty good.

      My advice is to start with a pic 16F877a and use a bootloader. Life gets a lot easier this way, without having to slowly use the programmer every time.

      If you go to the microchip website you can get free samples which should get you started.

    130. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      68k assembly language is fairly nice, definitely much nicer than x86 assembly language, but I think RISC architectures have unnecessarily been smeared by the silliness of a few architectures.

      Alpha assembly language is actually pretty nice to program in, and 64-bitness is there by default, rather than through kludges. Sadly, like the 68k, it has lost in popularity to far more hairy designs - not for any technical reasons, but because of other market factors.

    131. Re:Linux x86 assembly? by twinpot · · Score: 1

      Way back when I started technical training (telecoms), we covered different programming languages and "levels". I hated (still hate!) just about all programming, but for some reason I really enjoyed (and understood at the time) assembly.

      Might have to take a look at this book now.

    132. Re:Linux x86 assembly? by Progman3K · · Score: 1

      >>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.

      LOL
      That's exactly the attitude I'm talking about!

      --
      I don't know the meaning of the word 'don't' - J
    133. Re:Linux x86 assembly? by Progman3K · · Score: 1

      Hmmm...
      That does sound like an interesting take, but I'm not sure I really understand what you mean. Could you elaborate a bit?

      I *think* you might be right about doing away with VMM, ring levels and all that, and if you do, you've essentially gotten rid of the operating system too, haen't you?

      In one sense, that could work; the would be no operating systems, just the task the program was developed for.

      When you think about it, operating systems or sort of a non sequitur, it's the tasks that are important...

      Heresy, I love it.

      --
      I don't know the meaning of the word 'don't' - J
    134. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      Actually, you can write OO code in asm very naturally, you just can't follow the C++ or Smalltalk model of object-orientation. ASM OO code looks like C OO code - lots of function pointers in objects, instead of in classes. This is a much more powerful model anyway.

      It always amazes me how much modern programming style I can take back into ASM when I need to. Learning C++ informs your ASM coding. Even learning LISP can inform your ASM coding.

    135. Re:Linux x86 assembly? by unitron · · Score: 1
      "wow, that sounds really fun. do you have any book or website reccomendations for a complete beginner?"

      What, is Machine Language for Dummies out of print already?

      --

      I see even classic Slashdot is now pretty much unusable on dial up anymore.

    136. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      OO is more difficult to implement and as difficult to maintain as other methodologies. The "silver bullet" isn't real. C is faster than ASM - no doubt - because it's higher level in a way that's natural to people. OO thinking just isn't natural to people - it tries to match something that's natural to people, and fails, meaning we get hundreds of bad OO programmers. So while I agree with your "high level is better" argument, I disagree that OO coding is higher level than procedural coding.

      If you really love high-level so much you should be using LISP. But no one does, because in the real world performance does matter.

      Anyway, the point is that knowing ASM makes you a better programmer - not that you should use it for every program.

    137. Re:Linux x86 assembly? by Bigman · · Score: 1

      An Interrupt is an event where the CPU saves its context (the address it is executing at, and the values of critical registers) and starts executing a service routine inside the operating system. The interrupt can be triggered by an instruction called a software interrupt or by an electrical signal fed to the CPU - this is called a hardware interrupt. The CPU implements both mechanisms using the same method - you could say the software interrupt 'Emulates' a physical hardware interrupt.
      So, since the software interrupt was a really easy way to call routines without upsetting the registers of the CPU, its not hard to see why software interrupts were used by the writers of the BIOS and DOS to call system functions, like reading and writing files, because it is a cheap mechanism in terms of speed and memory usage to call operating system functions. Additionaly, it didn't require the programmer to know (or care) where in memory the service routine was held, which was valuable since it meant changes to DOS or BIOS wouldn't require changes to the programs. Remember, the early DOS executable '.COM' format had no ability to fix external references. The new '.EXE' format does, I believe.

      --
      *--BigMan--- Time flies like an arrow.. but personally I prefer a nice glass of wine!
    138. Re:Linux x86 assembly? by Mickut · · Score: 1

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


      Let's see, if all you have is assembler, first you write a minimal compiler for the language of your choice. Then you use that compiler to compile a more complete version of the compiler until you have bootstrapped a fully grown compiler for your favourite language.

      If you had to write compilers in assembler only, you wouldn't be able to have cross-compilers that easily.
    139. Re:Linux x86 assembly? by douglas+jeffries · · Score: 1

      But if you write a compiler and assembler first, it is much easier to design the instruction set and hardware, because you just have to do an as-built analysis to discover the machine's native code. Extra points if your compiler implementation generates instruction mnemonics (which makes the reverse-engineering of your instruction set much more straight-forward).

      By that reasoning, implementing an API will greatly simplify the design work of the ABI. =P

    140. Re:Linux x86 assembly? by douglas+jeffries · · Score: 1

      The HC08 is even easyer then the HC11.

      For someone trying to learn about how processors work, the 08 is IMHO more appropriate than the 11 or 12, mostly because it is a smaller, more limited chip. 8-bit programming exposes you to many things you can get away with ignoring, especially since many people have only used 32-bit systems. 2^32 is much greater than 2^8, and generally makes the difference between thinking overflow will never happen and seeing it happen every time you try to do anything useful.

      That said, my favorite chip (at the moment, at least) is the HC12 (16-bit), which is really quite similar to the 11 (compared to the 08). I have been quite pleased with Motorola's reference manuals, and the instruction sets are quite comfortable.

      For anyone serious about learning the ins and outs of hardware/software, I would suggest writing assembly on 8-bit and either 16-bit or 32-bit chips with similar instruction sets. The differences between the 8-bit world and the 32-bit world are enlightening, and might even change the way you think about code. I would recommend trying a good mix of C and assembly code, because both will present different challenges to you.

    141. Re:Linux x86 assembly? by chthon · · Score: 1

      Well, my first language was 8080 assembler, and I did not have a computer back then. For exercising, I created really small programs, which I converted into hex.

      I bought my first computer when I was 18, a ZX Spectrum, which had a Z80. I think that was for me the main reason to buy it.

      I have always had the feeling (still) that I knew more about computers and good programming, because I have insight into the processor. I studied electronics, not CS, and for most part I write better code than people who learned only high level languages.

    142. Re:Linux x86 assembly? by douglas+jeffries · · Score: 1

      I agree. There are enough different paradigms that it should not be assumed that someone could understand any of them by virtue of understanding any one.

      However, the best engineers are those who understand many layers of abstraction and many different paradigms. When you know the strengths of each different view of hardware/software, you can make much better design decisions.

      Someone experienced in hardware design and assembly programming probably has no experience with higher-level programming. But if they have broad (even if shallow) experience, learning a new language or even a new way of thinking is probably not a problem for them.

    143. Re:Linux x86 assembly? by douglas+jeffries · · Score: 1

      only the most perverse programmer would develop GUIs in a low-level language.

      That sounds like a challenge. =P

    144. Re:Linux x86 assembly? by hayriye · · Score: 1

      Actually, it must be GNU/Linux x86 Assembly

    145. Re:Linux x86 assembly? by douglas+jeffries · · Score: 1

      I think that the only difference is that people who understand the lower-level system are more likely to consider the higher-level things. Ultimately, I think that some understanding of each layer of abstraction is necessary to succeed at designing within any layer, and that the best engineers study the entire system.

      People who only want to know one layer are probably likely to go for a really high-level one, because Java seems easier than assembly. In truth though, I think that there are similar challenges and that designing good software is just as difficult in Java as in assembly. IMHO the biggest difference is how easy it is how obvious your mistakes are.

    146. Re:Linux x86 assembly? by m2e · · Score: 1

      The point is, that your compiler, written in whatever language you prefer, must emit assembler or machine code (gcc emits assembler, cl.exe machine code). So you must know assembler or your target pcode anyways.

    147. Re:Linux x86 assembly? by Octorian · · Score: 1

      You've got some of the spirit right, but a lot of the details wrong. First, both Windows AND Linux run in "protected mode" (which I guess is the x86 term for "I'm using the MMU /w protected memory). In fact, any multitasking OS should do this.

      Second, with protected memory, the OS does not intercept memory access. Can you imagine how slow this would be? Every memory access would require an interrupt, context switch, dozens to hundreds of instructions to handle, etc... Even if you don't count "instruction fetch" as a memory access in this sense (though it is one), it would still be totally pointless.

      What actually happens, is that the OS tells the CPU's MMU (memory management unit) what memory the program is allowed to use (setting up virtual memory mappings, etc). All runtime memory access is managed directly by the CPU in this sense. The only time the OS gets involved, is if you have a page fault. (program tries too access memory address not in RAM, a page fault occurs, which tells the OS to go swap in that memory from disk)

      Now how does the CPU know who is allowed to control the MMU, and all those other "protected" functions? Well, it has a mode flag. Basically, you have a "unprivileged mode"(app) and a "supervisor"(OS) mode. When in "unprivileged" mode, you cannot do anything bad. The only way to get into "supervisor" mode is to trigger an interrupt that is serviced by the OS.

      In reality, I should hope Linux should be "more" restrictive (not less) in terms of what it lets you do. Multitasking without absolute memory and resource protection is just asking for fatal OS crashes and other bad things.

    148. Re:Linux x86 assembly? by mikael_j · · Score: 1
      I think the HC05 has a different instruction set than the HC11 and HC08. right? a little more primitive. Hey you say 8bit for the 05 did you mean in contrast to the HC11??? cause the HC08 is 8bit also, but I though the HC11 was the same. The HC11 has a few more registers I think. The HC08 has only 8-bit Accumulator A and a 16bit index register.

      It's been a while since I coded for the HC11 but I believe it had two 8-bit Accumulators (A and B) and that one 16-bit register. Also, I seem to recall there being different HC11 models with differing amounts of RAM.

      /Mikael

      --
      Greylisting is to SMTP as NAT is to IPv4
    149. Re:Linux x86 assembly? by Octorian · · Score: 1

      Agreed.
      Knowing assembly language gives you a far better understanding of "how" the processor actually WORKS. Now, while learning assembly out-of-the-blue often seems quite difficult and daunting, I think it makes more sense to learn in the context of a computer architecture course.

      If you know how a processor actually functions, then assembly is just a natural way to codify instructions. If you don't understand how a processor works, then it may not make any sense.

      It is also useful to learn how easy it can be, for simple code, to translate between C and assembly. This is especially useful for embedded development, where program size counts, processor power is limited, processor-specific features directly matter, and sometimes you have to deal with crappy, non-standard, compilers (and need to see if their output assembler is accessing memory in the way you intended, etc).

    150. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      "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). " Agreed to a certain degree, programming in a non object orientated language can be just as good, although I would have to disagree with what you say about OO languages have no benifits. It can all depend, I write in 12 languages now, mostly OO (because thats where my career took me I guess), I love C, but the pure power of C++ keeps me using it. Using Object Orientated languages (although hard to implement in Assembly) can be vastly supperior to a non OO language, not in performance but in management of code, I find that any larger C API's can cause stress with programmers as they have to be careful about naming of functions and globals, this means that an API can easily become messy. With C++ (being an OO language) we can easily separate those functions and globals into classes and even further with the use of templates. In a project like the Linux kernel, I wouldn't expect them to use anything other than C, as that is all they need. But in a GUI program as for example, as Point of sale program reusable objects (As an example) has a large amount of benifits which I might add are visiable.

    151. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      YOU'RE

    152. Re:Linux x86 assembly? by ricksmith · · Score: 1
      Is "Linux x86 assembly" any different to any other kind of "x86 assembly"?

      Historically, assembly languages have varied in two dimensions: the underlying instruction set (x86 vs PowerPC vs Vax vs 360/370/etc) and the assembler's syntax itself.

      In my experience, the challenge of changing "assemblers" came in when you changed instruction sets, and especially when moving between larger and smaller word sizes. Doing 32-bit arithmetic with 8-bit registers required a different approach than you take if you have 32-bit registers.

      The other dimension dealt with the question of how you would actually write up the instructions in your program. For example, you know that the program needs an instruction to move data from a storage location to a particular machine register: you need to code the instruction according to the rules for the "assembler" program you're using (think of the "assembler" as being the "compiler" for assembly language).

      In the olden days, most people used the assembler written by the computer's manufacturer: IBM's assembler, DEC's assembler, etc. So if you knew "assembly language" for a machine, there was a particular assembler (or family of assemblers) you used. This broke down in the DEC world farily early, partly because much of their early software really sucked. But even then, third-party assemblers tended to be 'culturally compatible' with the manufacturer's version.

      Unix assemblers diverged somewhat from the standard DEC assemblers for the same CPUs, but I think the worst divergence emerged when the Zilog Z80 came out in competition with the Intel 8080. The Z80 had a 'compatible instruction set' but the assembler syntax was completely different. The languages used different opcodes and different ordering for operands. It was almost like using two incompatible machines.

      Assemblers also differed from one another in how they defined symbols to establish storage locations and memory layouts. Some used predefined fields (IBM) while others used syntactic markers like colons (DEC). In general, the assemblers always gave you ways to define both absolute and relative storage areas.

      A final feature that varies is in the 'macro' facilities. Full-featured assemblers provide ways to define blocks of instructions to plunk into a program, generally with parameters to control how and which instructions appear.

    153. Re:Linux x86 assembly? by HeyLaughingBoy · · Score: 1

      Because it's true. Haven't heard it in the software world, but back when I was an EE, managers had a phrase "time to shoot the engineers and ship the product." Left to their own devices, development engineers will try to make something perfect. QA engineers have to understand the concept of "good enough," which is when the product meets the required level of functionality and quality.

      It's nice to talk about perfection, but reality is that optimizing every aspect of the code means it will never ship.

    154. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      maxim: cycles are cheap, people are expensive.

      True, however, if you are charged with coding a hard drive driver that is going to run in 40,000,000 copies of Windows 98, saving innumerable cycles every second of every day for 10 years, maybe you could spend a little more time on it.

      But I wouldn't code a button handler for a preferences dialog box in Assembly. THAT is a waste of time!

    155. Re:Linux x86 assembly? by John+Courtland · · Score: 1

      Are you kidding me? If someone can't understand OO, and yet understand assembler, I would be surprised. Maybe I have a different view than most, but OO is extremely simple. I mean, wasn't that the point? And it is just syntax. It all translates down to assembler in the end. Any programmer worth his/her weight in salt should be able to pick up a new language/API within the timespan of about a week, maybe two if it's completely different (Like Lisp, for example). Now obviously they won't be a master at it right away, but they won't be writing moronic loops and doing other dumb stuff because they KNOW what's going on under the hood.

      The parent to my original comment made a good point, people with no low level experience don't know what they are doing with things like interrupts, DMA, etc... I've been helping a friend of mine with a school project. He's very smart but wasn't really grasping the concept that you shouldn't play with the timer interrupt inside the timer interrupt callback.

      And you could easily make a Win32 GUI in Assembler. Everything is just push data, call API, push data, call API, push data, call API. Yeah, development would go a bit slower, but it could be done, and not very "perversly".

      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    156. 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.

    157. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      Yeah, me too. Also, we might be wise enough to realize (unlike the poster of this article) that you don't have to know assembly to be a very capable programmer. Certainly you benefit from it in certain applications but there aren't so many programmers that would ever even apply this knowlege today in the real world.

    158. Re:Linux x86 assembly? by gandy909 · · Score: 1

      If they had taught you the asm first, it would likely have given you a much better undestanding later when they throw the AND, OR, and XOR type stuff at you in the higher level languages. Assuming you enter the degree program with little or no programming experience in the first place.
      In any case, I certainly agree that Asm should be taught in whichever courseline they teach the 'other' programming languages.

      --

      (Stolen sig) Remember: it's a "Microsoft virus", not an "email virus", a "Microsoft worm", not a "computer worm
    159. Re:Linux x86 assembly? by grikdog · · Score: 1

      Doesn't matter. The point is, with a modicum of exposure to ANY assembler code AT ALL, a good if fatuous MFC nerd can avoid looking like an idiot just because somebody's string is stored backwards in core. This actually happened. One of those famous, "Aha! What's THIS?" great moments in paranoia. I have felt for years that Microsoft inherited IBM's old penchant for buzzspeak, confusing solid code with dense handwaving -- can institutional Linux be far behind? Maybe the requirement should be to master Don Knuth's arbitrary-machine Mix language.

      --
      ``Tension, apprehension & dissension have begun!'' - Duffy Wyg&, in Alfred Bester's _The Demolished Man_
    160. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      Mmmmmm.....pie.

    161. Re:Linux x86 assembly? by pommiekiwifruit · · Score: 1
      They didn't succeed in that notation then! Load up a Zilog Z80 based game in MAME (e.g. Pacman). Go into the debugger. Look at the disassembly.

      Perhaps the clue is the "80" part of the Z80 (8080 begat Z80 and 8086).

    162. Re:Linux x86 assembly? by Kosgrove · · Score: 1

      I think you have an excellent point there. Compiler design one of the areas of research I left out of my argument, but I would say that the real work of language/compiler design and definition is more related to discrete math than it is to the implementation in assembly.

      Even compilers are oftentimes written in C - correct me if I'm wrong, but I think the Java compiler and virtual machine were written in C.

      ASM and architecture is, of course, relevant to many (but probably not all) CS majors in their careers, but idea of the article was that assembly could/should be used to introduce CS students to coding. That's silly. I don't know of any CS cirriculums that don't teach assembly at all, but to start students out with it would be like starting physics or mechanical engineering students out with quantum mechanics.

    163. Re:Linux x86 assembly? by iron_weasel · · Score: 0

      I don't understand your reply.

      The architecture of the OS you are running your Assmebly Program on should have no bearing on the code of the program you are creating. It may be a standalone piece of work/code. It may run on windoze and then you have to have packaging and such for that but the machine language aspect is OS independent unless you wish to make it dependent.

      That was my point. Not that a Linux based Assembler can't do what it wishes.

      If one is therefore inhibited by the OS that the Assembler prog is running on then I would say that as a true learning tool is its impacted as to its value. It should shed then all semblence of adherence to a particuliar OS.

      I thought the discussion centered around LEARNING and not IMPLEMENTATION.

      It appears that many here are not versed at all in machine language and a lot of comment is misguided and keeps revolving back to the OS when its really dependent on the PROCESSOR and should be OS free.

    164. Re:Linux x86 assembly? by hesiod · · Score: 1

      > YOU'RE

      YOUR A DICK. some people can't spell, get over it.

    165. 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.

    166. Re:Linux x86 assembly? by douglas+jeffries · · Score: 1

      you've essentially gotten rid of the operating system too, haen't you?

      It sounds like the only thing being removed are protections. After removing these things, and operating system would still be needed for hardware initialization and providing base services. The key difference would be that those services would not have to be guarded because they could trust the application code.

      At first, you might think it sounds nice since it would be so much more efficient. But this is not a very realistic idea. How could you guarantee that all code was written in a safe language? Evildoers would have no problem writing in their own "underground" unsafe languages (that would invariably have intimidating names like "C" and "assembly"), and the system would give full control to their code as if it were safe.

      For a system to be stable and work well, major components must not implicitly trust the other components. There is a great deal of value in enforcing security and error detection whether application code needs/likes it or not.

    167. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      You're stupid. Get over it.

    168. 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

    169. Re:Linux x86 assembly? by drxenos · · Score: 1

      At least you said "assembly language." I always cringe when a moron at work tries to brag how smart he is because he knows "assembler." Instead of C, does he also know "compiler"?

      --


      Anonymous Cowards suck.
    170. Re:Linux x86 assembly? by Mr+Z · · Score: 1

      Something more approachable might be to write a game on one of the old console systems -- anything from Atari and Intellivision up through about Sega Genesis and Super Nintendo shouldn't be too hard.

      On most of those systems, you're still responsible for all the code on the system. Many of your comments about initializing timers, setting up the stack, etc. still apply.

      The plus side is that the project can stay a pure software project -- no hardware design is necessary. Also, you can do much (all?) of your development using emulators. And, to top it off, most game systems have more interesting displays than just some LEDs. ;-)

      That said, there is a certain satisfaction from building up a system from chips, writing code for it, and saying "I built that!"

      --Joe
    171. Re:Linux x86 assembly? by angryelephant · · Score: 0

      hate to break it to you, but in many applications it is the algorithms that are written in assembly and only the control code that is left in higher languages.

    172. Re:Linux x86 assembly? by angryelephant · · Score: 0

      [I]maxim: cycles are cheap, people are expensive.[/I] Two words: embedded applications In the field I work on we need software that will run well on a low power processor now, not 18 months from now. In fact, architectural decisions are made before I even get my requirements. If I went to my boss and said "I have a code design, but it won't run well unless you give me better hardware" he would tell me to clear out my desk.

    173. Re:Linux x86 assembly? by douglas+jeffries · · Score: 1

      In the link you provided, the "backwards order" is a reference to little endianism, although they do not state so directly. If you read carefully, they talk about backwards data storage, and discuss how algorithms in C might not work if written to use the Intel method.

      Here, we are considering the order of operands in the instruction, which does not effect the way the code runs.

    174. Re:Linux x86 assembly? by the_duke_of_hazzard · · Score: 1
      Saying that the difference between OO and assembler is just syntax because one "translates down" into another is like saying that the brain is the same as neurons. They are not the same. They are different *because* in some respects they are both simple and in some respects they are complicated. OO is simple on some levels because much complexity is shielded from you, but in others it is very complicated and subtle when done properly and well.
      "they won't be writing moronic loops"

      You don't need to know assembler not to write moronic loops.

      Picking up new languages quickly comes from two things: knowing what's going on under the hood and experience of others of similar type.

      At work here we develop using scripting languages, hiring bright young devs. Beating gratiutously applied OO principles out of them is our main problem. The difference between languages of all kinds is not just syntax: language determines thought processes as well as vice versa.

      I stand by my original response: if you know assembler even very well, this does not make you a good and hireworthy developer in all or even most cases.

      Seriously, does anyone do GUI development in assembler?

    175. Re:Linux x86 assembly? by Krunch · · Score: 1

      You mean the highway to hell ?

      --
      No GNU has been Hurd during the making of this comment.
    176. Re:Linux x86 assembly? by poot_rootbeer · · Score: 1

      if you know assembler, you can take the CPU's strengths and weaknesses into consideration while still writing readable, maintainable, "good" code.

      I notice "portable" isn't on your list. Do you really think it's a good idea to write code that can only ever be run on one specific architecture?
      If you're lucky -- if you wrote something reliable, efficient, and useful enough to stay in use for a long time -- the code you write for x86 today will have to be executed by an x86 emulator on some futuristic new architecture tomorrow. That's not elegant. That's a crude hack.

      C is still too close to the bare metal for my tastes (I have better things to worry about than tracking my own memory allocation) but at least it can be compiled into machine code for many different CPUs. Pure Assembly cannot.

      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.

      It takes less time to write good code in a high-level language than in a low-level one. There are times when it's worth a programmer's effort to try to shave two instructions off a program loop in Assembly -- hardware drivers come to mind -- but for general programming, it's better to just let a compiler give its best effort at low-level optimization for you.

    177. Re:Linux x86 assembly? by John+Courtland · · Score: 1
      Seriously, does anyone do GUI development in assembler?
      You bet. Lots of demo coders (arguably the best coders on the planet) use pure ASM to do their stuff.

      Also your analogy, IMO, is a bit off. A neuron cannot do anything by itself, if you want to compare a brain to a neuron, it would be more like VHLL = brain, opcode = neuron. I don't know exactly what a good analogy would be, maybe like those little russian dolls that fit inside each other.

      I would say that the concepts are all that matter. If you have a good understanding of the machine as a whole, and know good algorithms, even just theoretically, then it should be no problem to hop from language to language.
      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    178. Re:Linux x86 assembly? by Endive4Ever · · Score: 1

      You can also wire together your own processors using TTL chips and lots of wire wrap sockets. It's not likely to lead to any leading-edge designs, but who knows?

      --
      ---
    179. Re:Linux x86 assembly? by Endive4Ever · · Score: 1

      Someone experienced in hardware design and assembly programming probably has no experience with higher-level programming.

      Yes. That very thing got me into trouble in the first C Programming course I took. I'd already rolled out a commercial single-chip design written in bare Assembly Language. There were thousands of them out in the field being used. But I completely missed the point of the standard library for most of the course. In the final exam I ran out of time hand-coding my primatives, when there was an appendix to the test paper listing 'system calls' we were supposed to make use of in our answers.

      I've since gotten more of a clue, but am still (as are a lot of bare-hardware ASM coders) a control-freak when programming who prefers to not ride on the back of somebody else's code. It's not a good thing, some of the time.

      --
      ---
    180. 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.

    181. Re:Linux x86 assembly? by shaitand · · Score: 1

      I agree 100% and think minimalism is a wonderful experience to have in there. Whether or not I'd think it's the place to start for your first language is another matter.

    182. Re:Linux x86 assembly? by shaitand · · Score: 1

      I'd disagree, because of one simple thing. I feel it's never good to learn an abstracted layer before learning what it's abstracting.

      To use something that doesn't send chills down so many people's spines. html. There are so many people using netscape composer, and frontpage, etc etc. Would you really recommend someone use an html editor without learning html first? Of course not, you can't use one properly or even know if the one your using is any good if you can't see the code output... which is far more important than the visual output.

    183. Re:Linux x86 assembly? by AmicoToni · · Score: 1

      Haaa! You could do better, actually. A friend of mine came up with a wonderful trick, that was actually useful on the cache-less 68000. You can convert Mandelbrot iterations in simple subtractions and sums if you only ever use squares.
      For instance: 2xy=(x+y)^2-x^2-y^2.
      So, since integer arithmetic was to be used.... he used a huge table of squares! :)))
      Now, *THAT* was a quick Mandelbrot algorithm, for the time!

    184. Re:Linux x86 assembly? by the_duke_of_hazzard · · Score: 1
      "Also your analogy, IMO, is a bit off. A neuron cannot do anything by itself, if you want to compare a brain to a neuron, it would be more like VHLL = brain, opcode = neuron. I don't know exactly what a good analogy would be, maybe like those little russian dolls that fit inside each other."

      What I was trying to get across was that because something is composed or reduced to something else (eg brain can be reduced to neurons, Java to assembler) does not mean that understanding the latter means understanding the former.

      Understanding something in a higher-level way will give you a different viewpoint and powers than at a lower level. Not that either are useless - far from it - but than knowledge of one does not imply knowledge of the other, even if there is a mapping of one to the other. (cf Goedel, Escher, Bach by Douglas Hofstadter).

      Your final statement I completely agree with. It's why algorithms and data structures courses are ultimately the most important courses I took, not Java or even C++.

      Interesting what you say about GUI development. I did not know that.

    185. Re:Linux x86 assembly? by TwistedSquare · · Score: 1
      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... 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.

      I understand your sentiments, but I disagree. While assembly gives you a good grounding in languages it does not make you the master of all. I know assembly, C, C++, Java, Perl, and various others but when I recently started my new job, there are people here who know almost none of the above, don't understand the internal workings of a computer (not all people who program took CS degrees of course) , but they are very very good coders at what they do (in this instance, Prolog). I would be suspicious that someone who loved assembly a lot might not use the paradigms of other languages properly. As a similar example, ever seen what happens if you let a die-hard C hacker loose on Java?

    186. Re:Linux x86 assembly? by bluethundr · · Score: 1

      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.

      I disagree, completely. You shouldn't need a college degree at all if what you want to do is invent your own comiler, language, OS, etc...as if such things were impossible without one. In other words your potential for achievement has more to do with your passions and above all who you are than what Uni you've attended and how far you make it in formalized education. Some people have been known to INVENT circuit boards, elegant interfaces, write compilers and port languages to their newly created hardware...all without having been traditionally "academic" as we understand it. The last time the non-academic intellectual has been in vogue was during the beat generation. But whether that lifestyle is well regarded by the world at large or not does not affect the potential rewards of this approach to life.

      --
      Quod scripsi, scripsi.
    187. Re:Linux x86 assembly? by stonecypher · · Score: 1

      I tend to agree with the above poster that everyone should have written to the bare metal at least once. A good simple well documented well emulated learner platform which provides a lot of neat convenience functions but which still makes you handle low-level stuff is the GameBoy Advance.

      If you'd like to get started using the AGB, get the GCC build "DevKitAdvance" rather than using the 3.5 target (better lnkscript, utilities); get the emulator "VBA" (win, linux, mak), and get the document GBATEK.

      --
      StoneCypher is Full of BS
    188. Re:Linux x86 assembly? by Kosgrove · · Score: 1

      I think you missed my implication (I probably didn't state it very clearly) that these were minimum expectations. Of course non-PhD's or even high school graduates CAN advance Computer Science, but the grandparent post said that BS/MS holders should be expected to be able to advance the science. Research and discovery is really difficult stuff, and my original point was that to expect every BS and MS holder to be able to be able to contribute to research is unrealistic and unfair.

      However, if you have a HS diploma or a BS and you can contribute research, then more power to you!

    189. Re:Linux x86 assembly? by John+Courtland · · Score: 1

      True, however, as I mentioned to the other commenter, you should be able to pick up any new paradigm/language very quickly. IMO, if you can't adapt, you learned how to code incorrectly. I guess I should have mentioned that in my post.

      --
      Slashdot is proof that Sturgeon's Law applies to mankind.
    190. Re:Linux x86 assembly? by Viking+Coder · · Score: 1

      What would you recommend to someone curious about starting on the 68HC11?

      I'm thinking a "programming 68HC11 ASM" book, an emulator, cross-assembler, possibly a C cross-compiler, or C++ cross-compiler... libraries worth having... debugging system... visual emulator with register states... running under Windows...?

      Any suggestions?

      --
      Education is the silver bullet.
    191. Re:Linux x86 assembly? by vsprintf · · Score: 1

      I can see your point, but one reason for abstraction is hiding complexity. If someone can handle a 3GL, then there is hope for them. If not, there is no reason to try to teach them assembler. Since my track was EE (and then CS), I learned from the gates up, but that's not the way CS people learn it.

      The HTML example doesn't convince me. HTML, IMHO, is a formatting tool not a programming language. Using BASIC, I can show a kid that typing *print 2 + 3* produces a result and that a computer is just a glorified calculator without making him/her learn assembler.

    192. Re:Linux x86 assembly? by Frizzle+Fry · · Score: 1
      saying that assembly language has nothing to do with computer science is like saying concrete and steel have nothing to do with building skyscrapers.

      You are comparing computer science to building skyscrapers, when the two aren't analogous at all. One is a science. It is a diverse and rigorous academic field. One is a pratical task. These are not the same.

      For example, someone who mainly focuses on theoretical computer science, contemplating algorithms for quantum computers, etc., in no way has x86 assembly language as the basis of their work.
      --
      I'd rather be lucky than good.
    193. Re:Linux x86 assembly? by wezelboy · · Score: 1

      Try telling that to an architecture student. In architecture there are academics and theoreticians just like in computer science, but in the end someone has to draw it, spec it, and get it built. Architects who don't understand this do not last long in the field. Quite frankly, I don't ever use assembly language. But it is still valuable. When I have to explain to a grad student or faculty member a basic architecture lesson so that they can write programs that actually work, it is quite handy.

    194. Re:Linux x86 assembly? by gangien · · Score: 1

      ahh thank you for the clarification.

    195. Re:Linux x86 assembly? by gid-goo · · Score: 1

      I don't know you so this doesn't reflect on you just on your comment.
      My experiences with low level gurus have all been bad. They have with fail been overly fixated on performance, wrote C or C++ code like it was asm and would spend all their time writing code that was impossible for anyone else to read. The code was generally difficult if not impossible to extend or adapt to new problems.

      In a word, keep the kids away from asm until they know what they're doing. It's not any more or less difficult than any other programming language. And the idiom leads to awful spaghetti in the hands of the young or mindless.

    196. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      It was my first language; BTW that was in the 90s

    197. Re:Linux x86 assembly? by shaitand · · Score: 1

      Demonstrating that a computer is just a calculator is not exactly teaching programming either.

      Teaching that kid BASIC as his first language not only hides from him an understanding of what various types of loop translate to on the system and why one is more efficient to the other, it also impairs him to learn any other programming language henceforth since about the only one basic easily translates to is pascal.

      Unless you count vb, I'd almost more readily call html a programming language. But really that was just an analogy to demonstrate the concept.

      The relation is the same, you have output beneath that can be written in efficient and inefficient manners but produce the same apparent result. The only way to know those is to understand that code. And then you have a high level program to generate that output, some are grossely inefficient, or are grossely inefficient when applied in various ways. Without understanding html you'd never know that each time you move an image a pixel your frontpage or publisher program leaves legacy crud.

      Just as someone who doesn't know asm isn't going to know that a for and while loop in their high level language end up being different output and that it DOES make a difference which they use when either will work (dated example I know, sue me).

    198. Re:Linux x86 assembly? by Rick+BigNail · · Score: 1
      The "features" of your high level languages have to be implemented in assembly at some point

      Not really. You could compile your high level language into C.

    199. Re:Linux x86 assembly? by wezelboy · · Score: 1

      Have you ever written a C compiler?

    200. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0

      Actually LDA # has the opcode $A9 on 6502.
      /tlr

    201. Re:Linux x86 assembly? by Anonymous Coward · · Score: 0
      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.

      Yeah, great idea! Let us forget about the mathematical foundation of a programming language, the focus should be the code generation.

    202. Re:Linux x86 assembly? by expro · · Score: 1

      Assembly does not have any of the high-level features (OOP, libraries, etc) features that developers need to know these days.

      And C/C++ does? Assembly language is just another language and generally has easy access to all the same libraries that other high-level languages have, that in most operating environments are language-independent. It has at least as much OOP as C, and with any degree of competence (especially using a macro-based language combined with open register access), it naturally lends itself to produce much better OOP than is typically produced using the standard OOP features of C++.

      Object-referenced virtual function tables, GC, etc. do not somehow make less sense in assembly, and C++ "OOP" features can be quite difficult to use as effectively as non-built-in alternatives. Should courses be focusing on pseudo-OOP features of specific languages or OOP principles? Developers are less trapped by the stupidity of particular languages when they learn to apply principles that are applicable regardless of the language.

      The advantage of C/C++ over assembly is mostly found in the reusability of procedures, function calls, and and developer knowledge (if carefully restricted to a portable subset) for alternative platforms. If you only use C/C++ to write to the Windows API, to a certain degree you may as well be writing in assembly. I have been involved in huge projects using it to create high-level applications with many millions of lines of code. It is just another language, less-widely but more-strictly standardized (you never worried about varying integer size definitions, etc.), but not inherently less OOP.

      When DEC transitioned to Alpha, an arbitrary cross-compiled VAX Macro-32 assembly code was likely to run better, in my experience, on VMS on Alpha with a completely different hardware architecture, than an arbitrary piece of C/C++, because it was likely to be better aligned with the available libraries and operating system environment (because people didn't write Macro32 for non-VMS systems).

      Modern machines already translate the instructions to more-native forms, so learning popular CISC instruction sets doesn't necessarily teach much about modern/good architectures.

    203. Re:Linux x86 assembly? by vsprintf · · Score: 1

      Demonstrating that a computer is just a calculator is not exactly teaching programming either.

      Demonstrating that a computer is not magic nor something to be afraid of is a good first step. Teaching a one-line program does show the concept. Perhaps you think a child's first program should be a device driver?

      Teaching that kid BASIC as his first language not only hides from him an understanding of what various types of loop translate to on the system and why one is more efficient to the other, it also impairs him to learn any other programming language henceforth since about the only one basic easily translates to is pascal.

      The B in BASIC stands for *Beginner's*. All computer languanges have the same general constructs because they are based on abstracting the workings of the processor - even assembler. My opinion is that any person who has the skills to be a good coder can learn any computer language - in any order. The reason I chose BASIC as an example is that it has come preinstalled on many computers for decades.

      And then you have a high level program to generate that output, some are grossely inefficient, or are grossely inefficient when applied in various ways.

      Thirty years ago, when I used assembler for most everything, high-level compilers may have been grossly inefficient, but things change. Today, it's hard to improve on code from a good C compiler, and the time involved for gaining minimal returns makes the exercise pointless in most cases.

      Without understanding html you'd never know that each time you move an image a pixel your frontpage or publisher program leaves legacy crud.

      Again, that's not programming. Using Frontpage is just using an end-user application. That's the same as not knowing that every time every time you change fonts in a Microsoft Word document, it leaves cruft from the previous font. If you want to compare using Frontpage to using VB, that's fine, but eventually the person using VB discovers that they have to learn how to write code to do anything really useful.

      Whether we like it or not, there are millions of programmers who do not know assembler. The best coders who do know assembler build compilers and interpreters for the rest. While it is nice to reflect on the clever hacks we did decades ago and how we built applications in a few kilobytes of RAM, those days are gone. I'm not saying it's good or bad, it's just the way it is.

    204. Re:Linux x86 assembly? by Captain+Segfault · · Score: 1

      Yes, I know (although it might not have been obvious from my tongue in cheek post)... I have a set of Knuth's TAOCP on my shelf. :-)

    205. Re:Linux x86 assembly? by be-fan · · Score: 1

      There would not be an opeating system per-se, just a bunch of large libraries that provided services such as disk I/O, drivers, hardware management, etc. That and interrupt handlers, I guess. Its very similar to the idea of an exokernel, except there would be no kernel, just the library OS.

      If you get rid of protection, however, you would have to implement some form of code-signing to ensure that only safe code got executed directly, and unsafe code (C/C++ programs, for example) were executed in a virtual machine.

      --
      A deep unwavering belief is a sure sign you're missing something...
    206. Re:Linux x86 assembly? by pommiekiwifruit · · Score: 1

      68000? Luxury :-) Here it is in 6502..

    207. Re:Linux x86 assembly? by Delphian2 · · Score: 1

      Hades is the classic greek version of Hell.

  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 andyrut · · Score: 1

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

      It's amazing how often Computer Science bleeds over into other disciplines. It seems to rear its head quite often in Mathematics (and some would argue that Computer Science is nothing more than an extension of Mathematics) and other science-based majors.

      At my university, the poor engineering students had to learn Fortran. Now there's a language that's not too different from assembly.

    3. 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.
    4. Re:Not So New Concept by Anonymous Coward · · Score: 1, Interesting

      I've often wondered about this... I'm a meager 14 year old, and I've learned (and a good deal more then just a "hello world..." program) numerous "high level" languages - C/C++, a little bit of JAVA, and a good deal of PHP... However, I'm somewhat mystified by the concept of low level languages. I've never really taken the time to learn them, namely due to the fact that they are mostly useless in actual practice (as far as I can tell.) Nevertheless, I feel that I have missed out on learning how the computer works below the surface and what is actually happening when the code I write is compiled and run. It sort of produces an artificial barrier to my code - I know what it's doing, but not how and why. I feel that I could code much better if I understood what was going on, and yet I'm not sure if I'll ever really be able to learn a language like assembly due to the fact that I'm used to higher level languages and have been somewhat spoiled by them.

      Does anyone else feel this way, or am I just an oddball? (which is most likely the case ;)

    5. 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
    6. Re:Not So New Concept by lounger540 · · Score: 1

      I'm a sophmore CS major and I'm starting assembly right now. As far as I know that's always how the school had done it bcs we use a texy book from the mid 90's. It actually goes as far back as 8088 code through 486. Comp Sci I and II were all C++. Then data structers. It's only a community college so this is as high as it goes for now.

      --
      LOOP1: MOV CX,2 LOOP LOOP1
    7. 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
    8. Re:Not So New Concept by timeOday · · Score: 1

      Yes, but they only taught me MIPS assembler, does that even count? X86 assembler almost makes MIPS assembler look like Visual Basic.

    9. Re:Not So New Concept by vt0asta · · Score: 1

      I agree. Any CompSci department worth its salt has a mandatory Machine/Assembly language requirement, and then the next step above it, a compiler course or two.

      I wish people could learn to program asm on very basic hardware. It appears they will never experience the joy of trying to get their Apple II to do double hi-res graphics, or memorizing the specifics of the C000 page, or walking the drive arm and writing (and then READING) data from a floppy, or coding straight from the monitor, and cracking games the old fashion way (by bootstrapping them from their very own boot sector).

      *sigh*

      --
      No.
    10. Re:Not So New Concept by whorfin · · Score: 1

      Hell, I had to design a simple CPU that would execute a given assembly instruction set with a given timing for my Computer Engineering degree.

      --
      Laugh while you can, monkey-boy!
    11. Re:Not So New Concept by Wakkow · · Score: 1

      Here at UC Davis and probably most UC's, there seems to be a line of classes that many CS/CE/EE people take from Semiconductor Physics to Software Engineering. At the one end, emphasis is on semiconductors, properties of electrons.. the basis of any piece of hardware.. Other classes then move towards transistors and gates. Another puts them together into hardware design and using hardware modelling languages. Then computer architecture which links assembly and machine code to what's physically going on. Then assembly. Then C, C++. Then classes on Operating Systems and embedded controllers linking more of the previous classes together. This continue to the other end which is the high level software design.

      My point is that I'm in CE, and I focus on the left side and middle of that scale. CS focus on the right but trails into the left. EE focuses on the left and trails off the chart. You can't just learn the high-level languages and expect to fully understand much of CS is all about. You can't learn just the low-level stuff and expect to get far without understanding what's built upon it.

      Ok fine, you -can- get far just being a code monkey, but how fulfilling is that?

    12. Re:Not So New Concept by Paleomacus · · Score: 1

      At least there isn't a hell of a lot of syntax to learn with assemblers.

    13. Re:Not So New Concept by sphealey · · Score: 1
      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.
      Yes, that's a very new concept. Dating from 1970 or so! See Sterling & Pollack; also the First Course textbook by the same authors!

      I will say however, having had to TA many students through the course based on those works, that starting with assembly language works well for some but not for most. And the ones it works for probably didn't need the class anyway.

      NIP and SNORE forever!

      sPh

    14. Re:Not So New Concept by riffraff · · Score: 1

      I'm currently going back for my CS degree, and my current class is "Computer Organization and Programming", which is just assembly under 16-bit MS-DOS. I have a couple of advantages over most of the students: I'm about 15 years older, and have quite a bit more experience; I wrote assembly code on the C64. I learned a lot about how things worked when I learned assembly many years ago. I think this class will be good for most of the students, even though it may seem irrelevant. Some of the later classes need this as a prerequisite, like Digital Logic Design. (This is at University of Houston).

    15. Re:Not So New Concept by Anonymous Coward · · Score: 1, Funny

      What a pity that Basic English was not on the menu either.

    16. Re:Not So New Concept by Gramie2 · · Score: 1

      I am currently taking my THIRD assembly class at the University of Texas. And I know that there are others to take.

      Don't worry, some day you'll pass! :-D

    17. Re:Not So New Concept by Lehk228 · · Score: 1

      writing code for low power devices such as graphing calculators pretty much requires ASM to have any speed or power, check out for a huge directory of nice Assembly programs, although newer calculators have better high level languages real power needs ASM

      --
      Snowden and Manning are heroes.
    18. Re:Not So New Concept by Dukael_Mikakis · · Score: 1

      Yes, most curriculums have some option (or even mandate) to learn some low-level language, but obviously there are issues with both starting at a high-level language and a low-level one. I've heard that MIT (verify this?) learns on LISP (or at least they used to) which is precisely that sort of middle ground. It has some capacity for decent OOP, though it can be limited and convoluted, but it also flows in a similar manner as lower-level languages. Obviously it doesn't have quite the memory management and address control as assembly, but ....

      I think it's good, but it'll also likely turn many off of computer science. It is significant and beneficial to know the goal when programming (and Assembly is much closer to the "goal" of Machine code than Java) which helps in optimization and just the mindset of programming. But I've taken it and it's damn hard to learn, and damn complicated. At least for me it was.

    19. 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." :)

    20. 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...

    21. Re:Not So New Concept by Anonymous Coward · · Score: 0

      I had to take a second year course in Assembly language at college... and it wasnt x86 assembly, it was VAX.

      Right after that semester I switched my major to Mathematics.

    22. 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.
    23. Re:Not So New Concept by Anonymous Coward · · Score: 0

      MIPS shouldn't really be compared to VB. Just because x86 has a complete instruction set doesn't mean that MIPS isn't better or worse. When I took my class we learned MIPS second, and it seened better thought out, and in the long run will probably be faster than a CISC machine, depending on the application of course (memory usage etc).

      Cheers

    24. Re:Not So New Concept by dreamchaser · · Score: 1

      Perhaps, but it wasn't like he tried to hide his identity, it's easy to see that johnnyb is John Bartlett.

    25. Re:Not So New Concept by Anonymous Coward · · Score: 0
      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."

      I always heard it as

      "C combines the flexibility and power of assembly language with the ease-of-use and readability of assembly language".
    26. Re:Not So New Concept by zelphior · · Score: 1

      My school doesn't have a true CS major, but I'm taking a Computer track within the EE major (sort of like an EECS that I've seen some other schools offer), and unfortunately, I'll graduate just before they start offering an assembly language course. Most everything else is C++ and Matlab.

      --
      If you can read this then I forgot to check "Post Anonymously"
    27. Re:Not So New Concept by dev11 · · Score: 1
      Fortran, though archaic, isn't really like assembly at all, even the older versions, f77 and earlier. There aren't even pointers in Fortran. It is really more like the old batch/card reader systems, 80 columns, statements begin after column 7, no lower case letters, etc.

      Since I started out as an engineer in college, I learned Fortran 77 as my first language, and it really wasn't that bad. It's still good for scientific computing, especially vectorizing code.

      Of high level languages, I would have to say C is the closest to assembly language. It is also the language I prefer most, it's small, concise, and allows you to do what you want, which can also mean shooting yourself in the foot, of course.

      When I did my BS in CS, we did have a course in computing systems, or something like that, of which assembly was also a part (Motorola 68000). The prerequisite was an EE course in digital circuits. Most respected CS curricula do require courses in the lower levels, and I do think it is useful to gain a fuller understanding. But in most real world applications, with cheap hardware and CPU cycles, a high level language works just fine for most things.

    28. Re:Not So New Concept by Anonymous Coward · · Score: 1, Insightful

      This incident raises a question for me. What exactly do the Slashdot editors do?

      You would think they would be protective against this sort of thing.

    29. Re:Not So New Concept by HBI · · Score: 1

      done much conditional jump work in 8086 or 286 real modes?

      'nuff said. x86 assembly is easy for little routines that call interrupts or make system calls of other sorts. It's fine if you want to futz with integers or even if you want to play with the coprocessor. Doing real programming in it was problematic in the days before the 386.

      --
      HBI's Law: Frequency of calling others Nazis is directly correlated with the likelihood of the accuser being Communist.
    30. Re:Not So New Concept by Evil+Pete · · Score: 1

      If they teach assembly to beginners then they should at least teach them a more simple / intuitive assembly first before they launch into x86 stuff. x86 is a terrible assembly in many ways. I remember learning assembly first via simulators that had simple instruction sets and I thought that was great since it meant I learnt quickly and that real assembly wasn't such a daunting next step.

      --
      Bitter and proud of it.
    31. 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.
    32. Re:Not So New Concept by zxqart · · Score: 1

      I would disagree that programming a microcontroller is regarded as computer science. That is definatly engineering. Because there is software doesn't mean you have to know anything about CS to be able to program.

    33. Re:Not So New Concept by dreamchaser · · Score: 1

      That was the funniest thing I've read in all my years here. Mod Parent up!!!

    34. Re:Not So New Concept by jholzer · · Score: 1

      My first CS class actually had us generating machine code, in hex, by hand. It was machine code for a simplified virtual machine, but it was very insightful into how a computer worked at a lower level.

    35. Re:Not So New Concept by SillySnake · · Score: 1

      Hardly so.. Here at the University of Oklahoma the CS students don't take any assembly level programming.. however, the EE and CE students have to take assembly for the HC11

    36. 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.

    37. Re:Not So New Concept by Anonymous Coward · · Score: 0

      The original was more like:

      C - all the power of assembly language with the clarity of assembly language

    38. Re:Not So New Concept by afidel · · Score: 1

      That's funny since the core functions for the Ti-89 and family was written in C and have self optimizing abilities for specific functions. I know this because the functions are based on Derive, and you can see an ACM paper by the authors of Derive talking about their system.

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    39. Re:Not So New Concept by Anonymous Coward · · Score: 0

      "People talk about the old days like their is lost knowledge"

      such as...english?

    40. Re:Not So New Concept by geekoid · · Score: 1

      I thought it was Johnny B. Good.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    41. Re:Not So New Concept by steveg · · Score: 1

      This is less true now than it used to be. The ACM guidelines for curriculum have been steadily reducing the emphasis on assembly language, and I predict that within a few years it will only be offered sporadically. As it is right now, there are too many units required in a computer science degree for University Administrations to be happy -- we're not too far from the point where a computer science degree is almost like (in terms of units taken) having a major AND a minor in the same discipline. We're facing having to drop courses from the requirements just to enable students to fit it all in, and ASM is going to be one of the casualties.

      My ASM instructor wrote the book we used (in the early 90s) and it's gone out of print. It's not going to go to another printing because the publisher isn't interested -- there are so few colleges offering ASM that they don't sell enough to make it worth while.

      ASM in acedemia will probably live on only as long as there are professors who *insist* that it be offered. When they retire, that's it.

      --
      Ignorance killed the cat. Curiosity was framed.
    42. Re:Not So New Concept by Anonymous Coward · · Score: 0

      I too am a CS major at the University of Texas at Austin, and I have only had one class that uses real assembly. Even then, there were only one or two assignments where we had to program in it. The first hardware class taught to CS majors used some LC-2 assembly language.

      What are the three classes using assembly that you are talking about?

    43. Re:Not So New Concept by Lehk228 · · Score: 1

      I was mainly referring to the z80 based units, the 89 and above models use a different (motorola?) processor

      --
      Snowden and Manning are heroes.
    44. Re:Not So New Concept by bobthemuse · · Score: 1

      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 just graduated from a large three-letter university that's reputed to have a decent CS program. Nothing in the standard CS curriculum includes ASM. Lucky for me I started off as an electrical engineering major and had to learn the basics on a simpler chip (68HC11), which paved the way for x86 assembly. I think it's made me a better programmer at all levels, and certainly a better debugger.

    45. Re:Not So New Concept by afidel · · Score: 1

      Yep the Ti89 uses a Motorola 68000 running at either 10 or 12 MHz. That's not exactly a smoking hot processor.

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    46. Re:Not So New Concept by Anonymous Coward · · Score: 0

      Actually, I think a procedural language that doesn't have the pointer misadventures of c would be a better first language, Pascal or Modula-2 perhaps.

      After the student is well grounded in procedural programming, teach c and assembly since it is so easy to get into trouble with pointers and addresses in those languages.

      Next a pure OO language should be taught, perhaps java or smalltalk. Do not use c++ as the first exposure to OO programming, because it is so easy to program procedurally in it, most students will use the programming paradigm they are most familiar with (procedural programming) and learning the OO concepts will suffer from cognative interference.

      Next, functional languages: haskel, ML, scheme or lisp. Then a logical language: prolog. Finally round out the corriculum with a relational language such as SQL.

      Then offer the following languages as electives:

      c++
      perl
      python
      ada
      fortran
      tcl

      The following UNIX language-like utilities should all be offered too, perhaps as a single course.

      make
      sed and regular expressions
      sh and its brethren
      expect

      Web programming and markup languages should be covered, in particular:

      HTML/DHTML
      XML
      javascript

      For language wonks I recommend elective courses in:

      Algol
      BASIC
      SNOBOL
      awk

      And finally, COBOL should only be offered in terms of translation to other languages since it is such a suckfest to program in.

      COBOL -> c/java/c++

    47. Re:Not So New Concept by bigdavex · · Score: 1

      Yeah, I agree with you. Passive voice always makes me suspicious. Is is that they don't know who did the action, or don't want to tell me?

      --
      -Dave
    48. Re:Not So New Concept by Anonymous Coward · · Score: 0

      You should forget about CS degree because all jobs are going to India and China and stuff

      +5 Insightful

    49. Re:Not So New Concept by macjohn · · Score: 1

      At my university, the poor engineering students had to learn Fortran. Now there's a language that's not too different from assembly

      Naah.. Fortran goes on punched cards. Assembly takes paper tape.

      --
      --Hi. I'm in Portland and it's raining. This appears to be a permanent condition.
    50. Re:Not So New Concept by johnnyb · · Score: 1

      x86 is actually pretty decent when using it in Linux. It's the 16-bit stuff and the segmented memory models that are scary.

    51. 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.
    52. 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

    53. 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.

    54. Re:Not So New Concept by johnnyb · · Score: 1

      I did the same when I wrote the text for the back cover.

    55. 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.

    56. Re:Not So New Concept by EvilLile · · Score: 1
      A bit off topic, but that reminds me of this one

      C++: The power, elegance, and simplicity of a hand grendade

    57. Re:Not So New Concept by davebarz · · Score: 1

      If you don't have any spamguarding on your email address, you sir, are a moron, and I will certainly NOT buy your book.

    58. Re:Not So New Concept by torpor · · Score: 1

      API's are an abstract layer between two things.

      Learning API's is important, but jumping layers competently is more important.

      This is why its good to learn more than one thing about computers at the same time; study two areas concurrently. The more you do this, the more you can jump layers, and the more 'obvious' API's become, faster...

      --
      ; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
    59. Re:Not So New Concept by Anonymous Coward · · Score: 0

      ...says the pot to the kettle

    60. Re:Not So New Concept by Anonymous Coward · · Score: 0

      You mean "had exposure to" rather than learn. Don't stick all of those on your CV later.

    61. Re:Not So New Concept by Rigor+Morty · · Score: 1

      >People talk about the old days like their is lost knowledge, we still learn all that.

      Riiight. When you can program ASM on punch card decks without blowing core memory because of complexity, come talk to me. Until then, stop claiming it's all good.

      --
      Remove the spamfreak to speak.
    62. Re:Not So New Concept by lordholm · · Score: 1

      Reminds me of a Perl joke:

      Perl: A language combining the power of C with the speed of Java and the simplicity of Assembler.

      --
      "Civis Europaeus sum!"
    63. Re:Not So New Concept by AbbyNormal · · Score: 1

      Is it a coincidence that the poster of the article was "JohnnyB" and the author of the book was "Jonathan Bartlett". Nah.

      --
      Sig it.
    64. Re:Not So New Concept by d-rock · · Score: 1

      When I took assembly programming it was taught in AT&T syntax. I think it's a cleaner syntax than the Intel 3-letter ops. It's the default syntax for most Unix assemblers, and it's what you use for inline assembly with gcc.

      Derek

      --
      Don't Panic...
    65. Re:Not So New Concept by qui_tollis · · Score: 1

      Note that the author, Jonathan Bartlett, is also the founder of the book's publisher, Bartlett publishing, whose only other computing publication seems to be the scheme manual R5RS (which IIRC can be downloaded for free in any format you care for). The rest of their books seem to be christian stuff.

      My hunch is that this book is just some piece of crap that no mainstream publisher was interested in. I'd be more inclined to give him the benefit of the doubt if it wasn't for the dishonesty noted by the parent poster.

    66. Re:Not So New Concept by CanadaDave · · Score: 1
      I don't even spamguard my email address, because I want people to know who I am and be able to reach me easily.

      The real reason is because you are in the market for a penis enlargement. You should have used the first person when you wrote the submission you insensitive clod.

    67. Re:Not So New Concept by wrp103 · · Score: 1

      Starting comp sci students off with assembly isn't a new idea. My first computer course in the 1960's was FORTRAN, but it started out teaching a simplified assembler language. It helped us understand what the computer needed to work, so when we started writing "high level" FORTRAN programs, we had a clue as to what was going on behind the scenes.

      One of the courses I teach is Programming Language Concepts, where I show students a quick intro to assembly, and then show how structured programming language constructs are implemented in assembler.

      I looked at a text book a few years ago that taught the bits and bytes along with assembler language within an intro to programming course, so even you young'uns can remember back when this was done. ;^)

    68. 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....

    69. Re:Not So New Concept by FreshFunk510 · · Score: 1

      Yeah, but the difference is is that when you write a summary or review on the back cover it didn't appear as if it were from a third party did it? You didn't your review as being written by "Oprah's book club" or something right?

      The thing is is that on Slashdot I think it's taken for granted that reviews and/or praise for things sold are always a third-party independent.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    70. Re:Not So New Concept by samael · · Score: 1

      I don't use spamguarding. I use spamfiltering. Just like I'd rather the RIAA didn't treat it's customers like criminals, I don't treat my readers like spammers.

      I do use spamfiltering, and that seems to work just as well, while being an inconvenience only to me, not to people who want to talk to me.

    71. Re:Not So New Concept by johnnyb · · Score: 1

      I didn't see that posted anywhere. Sorry. You may have taken that for granted, but I did not.

    72. Re:Not So New Concept by Zo0ok · · Score: 1

      C: The language combining the power of assembly with the portability of assembler.

      But thats not only dry, its also false.

    73. Re:Not So New Concept by nineoneone · · Score: 1

      A poster wishes to let it be known that he is not buying your book.

      --
      sig under development
    74. Re:Not So New Concept by Antaeus+Feldspar · · Score: 1

      When Slashdot runs a story about OSDN, don't you think they themselves point out their relationship with OSDN?

      Surpressing relevant information is dishonest. The fact that the person promoting the book as worthy of the attention of Slashdot readers is the same person that wrote the book is relevant information. When the people reporting the news are the same people making the news, that's relevant information, and resorting to the passive voice in order to avoid drawing attention to the connection is dishonest.

      --
      If people are to respect the law, perhaps the law should begin by respecting the people.
    75. Re:Not So New Concept by pfavr · · Score: 1

      You don't need to buy it. I just downloaded the pdf and read the intro. This is really well written, and he even recognizes Donald knuth in the second paragraph:

      "One of the greatest programmers, Donald Knuth, describes programming not as telling a computer how to do something, but telling a person how they would instruct a computer to do something. The point is that programs are meant to be read by people, not just computers. Your programs will be modified and updated by others long after you move on to other projects. Thus, programming is not as much about communicating to a computer as it is communicating to those who come after you. A programmer is a problem-solver, a poet, and an instructor all at once. Your goal is to solve the problem at hand, doing so with balance and taste, and teach your solution to future programmers. I hope that this book can teach at least some of the poetry and magic that makes computing exciting."

      I look forward to reading the rest!

    76. Re:Not So New Concept by Piquan · · Score: 1

      C: The language combining the power of assembly with the portability of assembler.

      But thats not only dry, its also false.

      Personally, I prefer what it says in Programming Perl: "A bare C program is about as portable as Chuck Yeager on foot."

    77. Re:Not So New Concept by psb777 · · Score: 1

      1980 University of the Witwatersrand first year computer science course first taught us machine code and assembly using two synthetic languages Fred and Bassett. There were implemented in Fortran on an IBM 370. The Bassett assembler produced Fred machine code. I am dismayed that any computer science course could start without teaching assembly. Information Technology 101 or Computing for Business 101, OK. But Computer Science!!?!?!?!?

      No what really surprises me is that anybody here might think teaching assembly as a first programming language to computer science students can in any way be strange.

      Has nobody read Knuth's The Art of Computer Programming? It's all in a (different) synthetic assembly language!

      The youth of today. What is the world coming to?

      --
      Paul Beardsell
    78. Re:Not So New Concept by sjames · · Score: 1

      FORTRAN does have a very archaic feel to it, even though it's standard continues to be updated. There are a few really nice FORTRAN 90 and 95 compilers out there. There are several good reasons that FORTRAN stays around.

      One is legacy. There is a LOT of engineering and scientific code around that works just fine as is. In other cases, especially scientific where the code JUST works. It is horribly contorted and confusing code written by a succession of grad students (none of whom were CS majors) and if anyone new tries to change anything, it'll fall apart. It would be re-written except that it works well enough, and everyone involved sees code as simply a means to an end (rightly so since they are NOT studying CS).

      Portability is another concern. FORTRAN does not change from platform to platform. Compiling code on a new machine never results in INTEGER changing size. Since there are no pointers, there's nothing to change there. It's archaic file handling (that is, hard code files to be opened up front) assures that I/O does not change between platforms either. For all it's limitations, at least once it works, it works everywhere without question (as long as the compiler isn't broken).

      FORTRAN is so dedicated to not surprising the user when porting that it still supports the formatting dictated by punched cards. Newer compilers relax that requirement for newer code, but will still support it if needed.

      Optimization is a final reason. Compiler optimization for FORTRAN is very well understood. The lack of pointers (and thus, aliases) facillitates optimization. Naively written FORTRAN will still optimize decently. Naively written C code will likely crash, but certainly won't optimize well.

  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
    1. Re:Knuth by d_p · · Score: 1

      Knuth uses MIX, a 6 bit machine language as well as a form of assembly for his simulated computer.

      It may have been updated to 8 bit in the addendums to the book.

    2. Re:Knuth by zhenlin · · Score: 1

      MIX is used in his published (as of to date) TAOCP book.

      MMIX will replace it.

      Neither are stack machines. MIX predates 8-bit bytes, to give you an idea; MMIX is a load-store (i.e. RISC-style) machine.

      Both don't have a hardware implementation (yet).

    3. Re:Knuth by jemfinch · · Score: 1

      Uh, Knuth's assembly language was named MIX, not ASM.

      Jeremy

  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 CaptainCarrot · · Score: 1
      I now use C++, Perl, and (shudder) Visual Basic (when the need arises).

      Allow me to paraphrase Jack Handey here:

      It takes a big man to admit to using Visual Basic. It takes an even bigger man to mock him mercilessly for it.

      --
      And the brethren went away edified.
    2. Re:Somewhere in the middle... by digital+bath · · Score: 1

      My introduction to programming was similar to yours. I used some simple scripting languages (hypercard/javascript), then learned Basic. My first induction into assembly was through the TI-83+. Yes, the calculator :) I began programming z80 assembly for the 83+ over three years ago, and have since learned C/C++, Java, 68k assembly, PHP and a few other languages.

      I found that knowing an assembly language (even if it was for a relatively simple 8-bit processor like the z80) helped immensely when learning higher level languages (C++ especially).

      --
      find / -name "*.sig" | xargs rm
    3. 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.

    4. Re:Somewhere in the middle... by mgrennan · · Score: 1
      I like what www-cs-faculty.stanford.edu/~knuth said about people who first learned BASIC.

      "They are brain damaged."

      --
      There are 10 type of people in the world, those who understand binary and those who don't.
    5. 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."

    6. 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.

    7. Re:Somewhere in the middle... by line.at.infinity · · Score: 1, Insightful

      LOGO is a horrible language. It tells you very little about how the PC works. You don't get to find out how many bits are required to store an integer, for example. LOGO doesn't have types. You can do weird things like "PRINT FIRST (1 = 1)" which prints "t" because that's the first letter in true, the value returned by (1 = 1). The benefit of learning assembly is that you have to know about how the memory and CPU works. You don't get the same advantages if you learned LOGO(which is an interpreted language) instead of Assembly.
      LOGO is primarily marketed towards educational institutions. It is hardly ever the language of choice in the world of business.

    8. Re:Somewhere in the middle... by NanoGator · · Score: 1

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

      Not a motto to have today, otherwise you risk a pummeling by a horde of 3D artists.

      --
      "Derp de derp."
    9. Re:Somewhere in the middle... by Anonymous Coward · · Score: 0

      But assembler doesn't actually give you an advantage in the Real World. Your little bro probably knows java far more in depth than you will, and be able to do more than you can with your C, C++ and assembler combined. When you're off on your next project (in perl?) he'll be using VB, .net and any number of newer languages while your old skills languish in the dust.

      NOBODY apart from kernel coders needs to know assembler in this day and age, and even then that's only people who work in time critical portions of an OS. anywhere else you're just slowing development down

    10. Re:Somewhere in the middle... by toggles · · Score: 1

      There is never any need...

    11. Re:Somewhere in the middle... by Wolfier · · Score: 1

      LOGO, being a relative to LISP, has some really useful applications dealing with expert systems.

      But again, 99.99% of the population don't have to know about it.

    12. Re:Somewhere in the middle... by marko123 · · Score: 1

      I thought that was Edsgar Djikstra?

      "Those students who learn Basic as their first programming language will be seriously brain damaged and unable to have a future in computer science"

      - E.W. Djikstra

      --
      http://pcblues.com - Digits and Wood
    13. Re:Somewhere in the middle... by nomadic · · Score: 1

      3-D artists? What are they going to do, throw hot latte at you? Raytrace an unflattering caricature of you?

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

    14. 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."
    15. Re:Somewhere in the middle... by Anonymous Coward · · Score: 0

      LOGO is primarily marketed towards educational institutions. It is hardly ever the language of choice in the world of business.

      No fucking shit. I mean, really. Has anyone here ever seen a LOGO program doing something even slightly useful?

      No. I mean, for chrissake.. The interperter has a cursor....that's a freaking TURTLE.

      However, I think. THINK... That logo makes people start thinking about variables and intergers and math, (and most importantly..syntax and LOOPS) in ways that are different from what they're used to. It's a teaching tool. Nobody ever expected that someone was going to go off and program an operating system in LOGO, though I suppose that if you were a real h44x0r you could do some very unexpected things with it.

      LOGO is a great high level taste of what happens when a computer does stuff. TEACHING TOOL>

      REPEAT 1000 [PRINT [NO FUCKING DUH]]

    16. 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
    17. 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.

    18. Re:Somewhere in the middle... by oaklybonn · · Score: 1

      I will not work with someone that cannot at least read assembly. When they smash the stack and are dropped into GDB, I don't want to waste my time helping them understand what a load off of $r3 means.

      The fact is that you don't always have source, and you need to be able to read assembler if you're going to be an effective C or C++ programmer.

      Also important is a knowledge of what actually occurs at the ABI level - on some platforms, passing a small struct by value can be cheaper than passing it by reference. You can't understand these issues unless you understand what happens at the instruction level. If you can't describe to me (in vague terms at least) how a C function call works, you will not get hired.

      Extra points if you understand how those instructions are in turn implemented by the microcode.

    19. Re:Somewhere in the middle... by madeye+the+younger · · Score: 1

      That is so wrong. If for "doesn't deserve to live" you substitute "doesn't deserve to design human bodies" it would at least make sense.

    20. Re:Somewhere in the middle... by Anonymous Coward · · Score: 0

      and you, sir, are why jobs are flocking to India... What business person wants a prick like you to deal with?

    21. Re:Somewhere in the middle... by shakamojo · · Score: 1

      LOGO is not a horrible language when it's used as it's intended... learning LOGO when I was about 9 years old got me interested in computers, which led to a great career... I don't know many 9 year olds who could handle learning assembly.

    22. 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.
    23. Re:Somewhere in the middle... by ComputerSlicer23 · · Score: 1
      Nope, the quote is about Cobol, not Basic. I'm sure someone fiddled with the quote and said it was about basic:

      http://quote.wikipedia.org/wiki/Edsger_Dijkstra

      I see that it is listed under the attributed sections. However, I'm sure the Cobol quote was earlier, and the superior version of it.

    24. Re:Somewhere in the middle... by EzInKy · · Score: 1

      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."

      But you do expect a physician to have detailed knowledge of the body.

      --
      Time is what keeps everything from happening all at once.
    25. Re:Somewhere in the middle... by Ramses0 · · Score: 1

      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."


      Actually, it's no different from saying somebody who doesn't know the functions of every organ in the body doesn't deserve to be a doctor. Doctor != Layperson. Grandpa != Computer person.

      A computer person (anybody serious about using computers for generic processing) should definitely know assembly (or JVM bytecode, etc). People who use VB to write frontends are (in my opinion) really "business specialists" who also happen to know the beginnings of computer science.

      --Robert

    26. Re:Somewhere in the middle... by geekoid · · Score: 1

      contect, it's all context.
      in the 60's and 70's that was right. You didn't just it down to ues a computer.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    27. Re:Somewhere in the middle... by oaklybonn · · Score: 1

      People that want a high quality, high performance product, perhaps?

      Or perhaps they teach assembler in India? Or perhaps the Indians took the trouble to learn it instead of stopping at Javascript since thats all their job entailed?

      Its dipshits like you that assume you'll get a free ride that drive the jobs to India. Programming is hard - if you can't do it well, please don't.

    28. Re:Somewhere in the middle... by Bozdune · · Score: 1

      And it takes some intelligence to realize that there are many tasks more easily done with Visual Basic than with any other tool.

      So next time you feel yourself scoffing, think about some concrete things like how long it's going to take you to do the same thing that'll take me about 30 seconds.

      And with all the outsourcing uproar out there, any tool that makes you incredibly productive is something you should embrace, not scorn. VB lets you prototype software and have it working the same day the PHB asks for it. Most of the time, it doesn't matter a goddamn how you did it, just that it got done.

    29. Re:Somewhere in the middle... by Wolfrider · · Score: 1

      ...and then QUICK draw your sword before he can come out with: "Right, then - you name them first!"

      There can be only ONE! [Slash - Thud - Lightning]

      --
      .
      == WolfriderV6 == I'm willing to admit that *I just might* be wrong... Are you??
    30. Re:Somewhere in the middle... by Mastadex · · Score: 1

      Actually i wouldnt go that far...id say: "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 be a geneticist." people that live dont program thier bodies. doctors in labs are the ones fiddling around with genese that eventually make fish glow.

      --
      A morning without coffee is like something without something else.
    31. Re:Somewhere in the middle... by hayden · · Score: 1
      I will guarentee that you WON'T be churning out useful code in LISP in a short time.
      Yeah. It's been around for nearly 50 years now and it hasn't happened yet.
      --
      Nerd: Derogatory term typically directed at anybody with a lower Slashdot ID than you.
    32. Re:Somewhere in the middle... by Anonymous Coward · · Score: 0

      He said: "Anyone who doesn't know machine language has no business using a computer."

      Using your body doesn't constitute having to know how all the parts work. We call this sort of thing a logical fallacy, and the sign of a true idiot. Either you mired, or you're using the straw man technique (which makes you even more of an idiot than if you had simply mired.)

      Being able to use a computer doesn't constitute being called a "computer person". Similarly, just because one can read (without perspicuity, example: yourself), that doesn't make them exceptionally skilled at reading, comprehending, and scrutinizing.

      Get on your pillar when you really deserve it. If you go on like this on a daily basis, it would take an extraordinarily nice and patient group of friends and family to put up with bullshit like this.

    33. Re:Somewhere in the middle... by Montreal+Geek · · Score: 1
      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."

      How about "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 practice medecine?"... just as witty and accu...

      Oh, wait a minute...

      -- MG

    34. Re:Somewhere in the middle... by CaptainCarrot · · Score: 1
      Humor impaired today, aren't we? Maybe you should cut back on the caffeine.

      As it happens, I have used VB when it was the appropriate tool. That was exactly once, in a situation where the lack of bitwise logical functions and operators was extremely annoying, but then again I practically never have to program for Windows. For which I thank God.

      --
      And the brethren went away edified.
    35. Re:Somewhere in the middle... by Anonymous Coward · · Score: 0

      That is so wrong. If for "doesn't deserve to live" you substitute "doesn't deserve to design human bodies" it would at least make sense.

      Really? Reread the OP.

      Anyone who doesn't know machine language has no business using a computer.


      I think given this statement, it is fairly appropriate.

    36. Re:Somewhere in the middle... by blixel · · Score: 1

      But you do expect a physician to have detailed knowledge of the body.

      Yes. But I don't think my mom should have to learn assembler to check her e-mail.

    37. Re:Somewhere in the middle... by blixel · · Score: 1

      Actually i wouldnt go that far...id say: "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 be a geneticist."

      No because your statement actually makes sense. Remember his original statement? That people should have to know machine code to use their computers.

      So that means in order for my mom to check her e-mail, learning machine code is a prerequisite? Seems pretty ridiculous to me. Your statement makes sense, his did not. So I was making an equally ridiculous statement.

    38. Re:Somewhere in the middle... by Thiago+Ize · · Score: 1
      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.
      Any language huh? Pick one of these and let me know when you did something useful :)

      On a less sadistic note, assm, C, C++ don't really help with languages that operate in a fundamentally different way. Lisp is a great example. Want a simple for loop? Gotta do it using only recursion... Now there's a hard language to quickly pick up which is also widely used.

    39. Re:Somewhere in the middle... by blixel · · Score: 1

      That is so wrong. If for "doesn't deserve to live" you substitute "doesn't deserve to design human bodies" it would at least make sense.

      No because your modified statement actually makes sense. Remember his original statement? That people should have to know machine code to use their computers.

      So that means in order for my mom to check her e-mail, learning machine code is a prerequisite? Seems pretty ridiculous to me. Again, your modified statement would make sense, his did not. So I was making an equally ridiculous statement.

      (I copied this text almost exactly from my other reply a couple of messages down since it applies to your comment as well.)

    40. Re:Somewhere in the middle... by nomadic · · Score: 1

      Nah, they're identical.

    41. Re:Somewhere in the middle... by blixel · · Score: 1



      There's a big difference between "using" a computer and being a computer programmer. The guy said his grandpa said "Anyone who doesn't know machine language has no business using a computer." Insinuating that even the layperson should be required to learn machine code before they could even do a simple task such as checking their e-mail. It's completely ridiculous to think that my grandfather, a rancher, should have to learn machine code in order to check his e-mail.

      This guy's grandfather's comment was the comment of an elitist. He is interested in computer technology and (hypocritically) thinks everyone else in the world should be just as interested in it as he is. (Or more likely, he just "gets off" on dehumanizing others by making snide, condescending remarks.) So to prove how ridiculous his statement was, I made an equally outlandish and ridiculous statement.

    42. Re:Somewhere in the middle... by merdark · · Score: 1

      hardy har har :)

      I guess your not an emacs user? Well, neither am I, but it's in LISP.

      On a more serious note though, I'm increasingly finding myself using functional-like contructs or desiring them. For instance, lambda functions would make C++'s foreach algorithm (part of the STL) infinitly more useful. Considering I don't use it at all right now, that would be nice.

    43. Re:Somewhere in the middle... by Poligraf · · Score: 1

      > I will guarentee that you WON'T be churning out useful code in LISP in a short time.

      As well as in Prolog and Forth ;-).

      --
      Tigers respect lions, elephants and hippos. Maggots respect no one. (C) S. Dovlatov
    44. Re:Somewhere in the middle... by Anonymous Coward · · Score: 0
      I will not work with someone that cannot at least read assembly. When they smash the stack and are dropped into GDB, I don't want to waste my time helping them understand what a load off of $r3 means.

      Of course, if you're using a more modern language, like Java, Perl or Python, that sort of error does not arise. The added bonus is you then might be able to debug your program on platforms whose assembly language you haven't learnt.
    45. Re:Somewhere in the middle... by gangien · · Score: 1

      I'm in a similar position. Started with C++ and have since picked up Delphi, Java, PHP and other scripting languages without a problem.

      this is basically what CS is about. It's about teaching you how the ocmputer works at various different levels. And what pitfalls to generally avoid.

      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.

      LISP and it's ilk and languages like Prolog are different programming paradigms. So you can't apply the same problem solving techniques in them. Course i think any good CS department would have classes that teach those techiques.

    46. Re:Somewhere in the middle... by EzInKy · · Score: 1

      Is your mom a programmer? My point is a CS grad should be expected to know as much about the internal functioning of a computer as a medical grad is expected to know about the internal functioning of the body.

      --
      Time is what keeps everything from happening all at once.
    47. Re:Somewhere in the middle... by Anonymous Coward · · Score: 0

      Why should I care if my chiropodist doesn't have a good understanding of the function of the brain?

    48. Re:Somewhere in the middle... by blixel · · Score: 1

      And my point was and still is that the layperson shouldn't be expected to know how to program in machine code in order to use a computer - as his grandfather's comment suggested. "Anyone who doesn't know machine language has no business using a computer."

    49. Re:Somewhere in the middle... by EzInKy · · Score: 1

      Because the leg bone is connected to the hip bone, etc. Many leg and foot problems are caused by peripheral vascular disease which can be the result of poor cardiac output, stenosis, even diabities.

      --
      Time is what keeps everything from happening all at once.
    50. Re:Somewhere in the middle... by JUSTONEMORELATTE · · Score: 1

      I just wanted to say thanks for posting it within PRE tags. Mel's story should be printed in fixed-width font. Dot-matrix would have been better, but what can ya do?

    51. Re:Somewhere in the middle... by PurplePhase · · Score: 1

      Isn't this more analagous?:

      Anyone who doesn't know every protein in their DNA doesn't deserve to reproduce?

      8-PP

    52. Re:Somewhere in the middle... by Chromodromic · · Score: 1

      Yeah, okay ...

      Sorry to butt in on your reminiscence, but Mel sounds like an unrepentant asshole.

      His code was difficult for others to maintain. He didn't used standard tools. His code was poorly documented. He didn't work well with management. He didn't work well with team members, obviously, since other programmers such as yourself had to spend weeks deciphering his arcane nonsense.

      He didn't want to modify his program to client specifications (in this case the client was the company itself, trying to sell computers to pay Mel's fucking salary). He didn't want to do this because he felt it was dishonest, but then after agreeing to do it he failed to do it, claiming his "subconscious" was uncontrollably ethical, which further implies that somehow forcing a computer to lose at blackjack in order to give a customer a thrill is somehow a foul lie.

      He didn't used established APIs. He used terminology others had to "figure out".

      The guy sounds like the same walking egomaniacal dink that somehow finds a job in every software department in every software company. Some antisocial nitwit who can tell you exactly where every instruction of his compiled and linked code ends up in memory, but who absolutely will not just get the job done if it doesn't fit in with his otherwise arbitrary sense of whatever-is-filling-in-for-his-personal-philosophy .

      Okay, so you admired the guy's prowess. Well, neato. But if I had to spend three weeks sifting through this nut's undocumented code so I could discover the nature of some arcane loop he'd written, I certainly would *not* got to management with some pseudo-romantic drivel such as, "Oh, I searched and I could not find it -- it was his brilliance you know -- there will never be another like him -- A REAL PROGRAMMER!"

      Believe me, I've met dozens of Mels. I wish they were rarer.

      --
      Chr0m0Dr0m!C
    53. Re:Somewhere in the middle... by line.at.infinity · · Score: 1

      OK, so maybe I was a bit harsh when saying that LOGO is horrible, but it's just an opinion. I just wanted to point out that LOGO isn't low level in the way that assembly is.
      From what I remember LOGO for DOS 2.0 didn't have for loops, while loops, arrays, and local variables. It wasn't object oriented, and recursion was waay too emphasized. Although I'm guessing newer versions improved on this. Even at v. 2.0 for DOS, LOGO was able to implement efficient tail recursion in a way that Java can't (or couldn't? not sure how it is with 1.5).

      Still, LOGO was fun. I was able to make some graphics animation, 3D stuff, fractal stuff, file manager, and games.

    54. 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.

    55. Re:Somewhere in the middle... by RobertB-DC · · Score: 1

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

      I have to agree. When I found the original story in the Jargon File, I passed it on to my mom -- a now-retired Old School programmer, with a Masters in Mathematics because there was no such thing as a CS degree in those days.

      She'd heard of Mel, and though I can't remember exactly what she said about him, I recall that there was a large amount of respect.

      That drum-memory computer with Mel's blackjack program ought to be in the Smithsonian... if it isn't already.

      --
      Stressed? Me? Of course not. Stress is what a rubber band feels before it breaks, silly.
    56. Re:Somewhere in the middle... by Anonymous Coward · · Score: 0

      What a sad state we are in when a university teaches mostly using Java. One could arguably go to a community college and learn Java... Far more cheaply too.

    57. Re:Somewhere in the middle... by NukeIear · · Score: 1

      The travel site Orbitz is the current poster boy for doing something in scheme. So, yes, it's rare, but it has been used in enterprise.

    58. Re:Somewhere in the middle... by zuzulo · · Score: 1

      I sure hope the average CS grad knows more about the inner operations of the computer than the average medical grad knows about the internal functioning of the human body, considering we actually are still only scratching the surface of what there is to know about the human body.

      In fact, i suggest that it will be a red letter day when we can attest to an understanding of the human genetic code that even approximates our understanding of the relationships between high order, assembly, and machine languages.

      Especially considering that one is a completely human creation and the other is not. ;-)

      --
      "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
    59. Re:Somewhere in the middle... by maita · · Score: 1
      Give me any language and I can guarantee I'll be churning out useful code in a VERY short amount of time.
      OK, here we go: 1. http://compsoc.dur.ac.uk/whitespace/ 2. http://www.muppetlabs.com/~breadbox/bf/
  5. Ouch by Anonymous Coward · · Score: 1, Funny

    This is akin to learning medical science by practicing on yourself :)

    1. Re:Ouch by Anonymous Coward · · Score: 0

      This is akin to learning medical science by starting with learning biology :)

    2. Re:Ouch by Anonymous Coward · · Score: 0

      This is akin to arguing by bad analogy.

  6. Not necessarily the mark of a great programmer by aligma · · Score: 1

    The best programmer I know knows C, C++, and Java. He got Class 2 Dvision 1 honours (UOW, Australia) in his degree for programming a digital watermarking system in C++ ... Pretty much a genius, but I don't think he knows assembly.

    1. 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.
    2. Re:Not necessarily the mark of a great programmer by Anonymous Coward · · Score: 0

      but i bet he understands computers at a very low level.

    3. Re:Not necessarily the mark of a great programmer by Anonymous Coward · · Score: 0

      He's talking about computer science, not programming. Anyone who has only used those 3 tools, is missing a lot of knowledge. Stuff like: how do malloc() and free() work? Does does gcc actually do?

    4. Re:Not necessarily the mark of a great programmer by Anonymous Coward · · Score: 0
      ps. Don't make them learn x86 assembly. I think that's banned under the Geneva convention.

      Man, you deserve +5 for that line.

    5. 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.

    6. Re:Not necessarily the mark of a great programmer by Wire+Tap · · Score: 1

      I am curious about why you think 68000 is better to learn first then x86? I happened to learn them in that order, too, but don't have any great love for the 68000. In fact, I thought it was a pain in the ass.

      x86 was much more lean and clean, and I could do more with it in less time.

      What's your beef, so to speak?

      --

      Man is born free; and everywhere he is in chains.

    7. Re:Not necessarily the mark of a great programmer by s20451 · · Score: 1

      In the 68000, you have address registers and data registers, and the commands always treat them as such. It's been a while, but I think they are numbered: D0, D1, ... for data, and A0, A1, ... for addresses. Aside from that the commands treat them equally. Also, memory is flat (a problem with 68000-era x86 chips, though probably not anymore).

      The register structure under x86 is byzantine. The registers don't have particular significance and keep swapping roles, which will bite you in the ass if you're not meticulously careful. I'm sure others can say more; like I said, it's been years for me.

      --
      Toronto-area transit rider? Rate your ride.
    8. Re:Not necessarily the mark of a great programmer by Yunzil · · Score: 1

      x86 was much more lean and clean, and I could do more with it in less time.

      Are you hopped up on the goofballs? :)

      68K assembly is a dream compared to x86. Flat memory space, more registers to play with, and some elegant instructions. 68K assembly flows like a gentle stream; x86 assembly flows like a mudslide down a canyon.

    9. Re:Not necessarily the mark of a great programmer by fitten · · Score: 1

      As others have said, the 68k has 8 data and 8 address registers. All commands that allow a data register as an opperand will allow *any* data register as a legal operand. The same is for the address registers (and in fact, for many operations you can use the address registers as general purpose). There simply *is no* with instruction XYZ I have to have my operand in registerA and my destination in registerB. This allows a lot more flexibility in where you can do your temporary calculations and such. For example, you need to add two values from memory to get an intermediate value in the middle of your main calculation loop? On the 68k and most load/store architectures, simply pick a data register not in use, use it to calculate the intermediate, then apply that result to your ongoing result. On the x86, depending on your calculation stream, you may have to save the contents of a particular register out to memory because the next instruction you want to use to calculate your intermediate must use a specific register for its operand(s) or result and you are already using that register because your outer calculation must also use that exact register. For some calculations, you effectively have only one register you can use and you have to shuffle intermediates to/from memory much more than if you had real general purpose registers

      Also, the 68k has a flat memory model. You want to much around with 64K + 1 byte of data? there's no difference in addressing array[0] or array[65536]. You can even do them back to back with no other instructions in between. 2MBytes? same thing. In the x86 segmented memory model, either of these two scenarios become quite a bit more painful.

      Basically it comes down to the orthogonality of the ISA between the two. The 68k family had a much higher degree of orthogonality than the x86 family.

      Things are even better on most load/store processors where you typically have 31 (or more) registers that are completely general purpose and the ALU instructions are almost completely orthogonal and memory is flat.

  7. 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 addaon · · Score: 1

      A* isn't so bad in assembly. RB is more of a pain. Working on a rendering engine (well, geometry generator, rendering in HW) in assembly now.

      --

      I've had this sig for three days.
    2. Re:Programming or CompSci by Charvak · · Score: 1

      Computer Science is about algorithms. In fact science in CS is a misnomer as CS is a branch of mathematics.

    3. Re:Programming or CompSci by RAMMS+EIN · · Score: 1

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

      Actually, not _that_ much different from doing it in C or Java. The algorithms are reasonably simple. Once you code the simpler algorithms, you can proceed to imeplement more complex procedures. High-level languages add some syntactic sugar, and libraries implement many of the more basic algorithms for you.

      I love assembly (especially for RISC machines, x86 assembly is messy), and I like coding it, but if you want to get some visible work done, you are better off with very high level languages. If you want to understand how computers work, or like creating the very basic building blocks of systems, then assembly is for you.

      --
      Please correct me if I got my facts wrong.
    4. Re:Programming or CompSci by Sebastopol · · Score: 1

      "Actually, not _that_ much different from doing it in C or Java."

      Hmmm... I'm not certain I agree. Assembly programming is very tedious, having done it for many years writing device drivers for Windoze. Sure, you can decompose any problem into bite-sized routines (that's the thrill of coding!) but ASM quickly turns into a lot of pieces. The abstraction of a slightly higher level language like C (not to mention tool support) really takes a load off.

      The only advantage to assembly is the ability to tune code to the microarchitecture, write extremely tight code, or make low level hardware configuration calls (like going into protected mode on x86).

      But still, if you look at the assembly created by g++ on Intel CPUs, it already comprehends architectural latencies fairly well.

      --
      https://www.accountkiller.com/removal-requested
    5. Re:Programming or CompSci by Anonymous Coward · · Score: 1, Insightful

      I'd take it a step further and say that Computer *Science* is about doing research in topics such as Systems, PL, AI, Algorithms, or the Theory of Computation. Being a great programmer is something else, although you have to be a fairly good programmer to make it in many tracks of CS grad school. (But programming doesn't matter as much for theory or algorithms students. But it's key for systems people)

      But yeah... I'm not writing support vector machine code in assembly. It's so not happening. (But learning assembly as an undergrad was worthwhile and I'm glad I did. But I'll probably never program in it again because it's not terribly valuable for an AI grad student. If a high level lang is too slow for an inner loop, I'll ask my advisor for a faster machine. If a faster machine won't cut it it's probably because the complexity makes the problem intractable for large datasets)

    6. 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.

    7. Re:Programming or CompSci by Anonymous Coward · · Score: 0

      Okay, I know what a red-black tree is (and binary search trees in general), but what the heck is an A* search?

    8. Re:Programming or CompSci by Sebastopol · · Score: 1

      "I think it's a good idea in comp. sci. *because* it's a pain in the ass."

      Hah hah! That's funny, but I completely agree.

      No pain no brain!

      --
      https://www.accountkiller.com/removal-requested
    9. Re:Programming or CompSci by Sebastopol · · Score: 1

      a-star search. the first thing you learn in AI-101. its a shortest-pass search algorithm.

      --
      https://www.accountkiller.com/removal-requested
    10. Re:Programming or CompSci by stephanruby · · Score: 1

      Someone mod the parent up. As a kid, I didn't know this basic difference. The real CS schools are creating researchers, not programmers. Programming is just an unwanted side-effect, a tool, and something you have to learn before the first week of class.

    11. 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

    12. Re:Programming or CompSci by Anonymous Coward · · Score: 0

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

      I wrote a B-tree database in Z-80 assembly for the Kaypro 10 in the 80s. The end result was exquisite, very satisfying, and the quality was very high.

      Sure, it was a pain in the ass. All complex programming is. However, it was infinitely easier and more productive than dealing with the arbitrary and convoluted languages, libraries, and OO crap that companies try to pass off as technological innovation these days, when what they're really doing is designing development tools with an agenda to try to lock people into their proprietary technologies. I would prefer to write a BSP-based graphics engine in assembly language for the 386 or 68000 than in something like C# for .NET any day.

      Realistically, I use straight C for almost all complex programming tasks nowadays, but my methods are the same as when I coded using assembly. It's a pain in the ass, as all serious commercial software production always has been and always will be.

    13. Re:Programming or CompSci by Anonymous Coward · · Score: 0

      And how are you going to choose the right data structure without some understanding of the hardware it will run on?

      While a simple, powerful recursive algorithm written in Scheme may seem elegant to a mathemetician it might suck ass on a real processor because building all of those stack frames can be expensive.

      CS departments grew out of either EE or mathematics departments and you can see an inherited bias. CS departments that grew out of EE departments focus more on hardware, assembly and architecture while ones that grew out of math departments tend to focus on algorithms.

      Mathemeticians tend to want to abstract away the hardware, but ignoring that nasty little reality is costly. It is this tendency that leads the trend to teaching introductory CS in Java and VB.

      EEs tend to want to map everything directly to hardware and end up with suboptimal solutions either because they take too long or because they focus on optimizing a handful of instructions instead of realizing that a more powerful algorithm might have bigger gains.

      CS is =not= math and it =isn't= engineering. It's a hybrid and it has to be treated as such.

      Here is some suggested reading. Maybe it will help explain why it is critical to understand how real machines work.

    14. Re:Programming or CompSci by bcd · · Score: 1

      In college I had to write a program in MIPS assembler to parse and evaluate a numeric expression. Both input/output in Roman numerals :)

      IMHO, assembly language should be required but it does not make a good first-year CS course. The entry level classes already do a good job of weeding out many students, and I don't think difficulties with assembly should be the basis for that.

      I've always taken a more practical view towards CompSci and felt that students should be taught more things that will actually help them get a job and do that job well. Fundamentals like data structures and tight logic are what's really important (whether C, assembler, whatever language). Today, there are very few places that need assembly language programmers.

      That said, I think a new asm book is overdue. I read Peter Norton's book on x86 assembly language back in high school and it certainly did help me understand what was really going on inside the silicon.

    15. Re:Programming or CompSci by Anonymous Coward · · Score: 0

      Assembly is an important part of Computer Science. Data Structures ultimately boil down to "how to I represent this 'thing' in a 1 dimensional array".

      A "programmer" does not require any knowledge of assembly. You could go your entire life only knowing how to program in BASIC (and then Visual Basic), or some other higher level language. That's the beauty of abstraction.

      Now, if you're a computer scientist, but you don't have a clue about instruction sets, or computer architcture then you are never going to understand Operating Systems. I don't see how you could hope to really understand compilers either. Now, what kind of Computer Scientist would that make you?

      Computer Science is about understaning a lot of abstraction layers. The high level AI stuff is important, but so is the low level. A Computer Scientist should understand conceptually what is going on when a Lisp program is run -- all of the interactions between the OS and the program, if the program is interpreted vs. compiled, how the program actually executes using a basic set of instructions which are specific to the architecture, how there are a fixed number of registers, how the registers and the ALU and other components function, all the way down to gates, how gates are built, to semiconductors, and down to solid state physics.

      A computer scientist doesn't need to be an expert at all of these levels, but I would contend that the difference between a "programmer" and a "computer scientist" lies in part in the ability of the computer scientist to jump between these layers of abstraction.

    16. 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!

    17. Re:Programming or CompSci by Brandybuck · · Score: 1

      Piffle. I had to write a graphical pinball game for the PDP-8. Kind of cool actually. You learned all sorts of useful things, like how to do floating point arithmetic with 16 bit integers, while having fun at the same time.

      --
      Don't blame me, I didn't vote for either of them!
    18. Re:Programming or CompSci by Anonymous Coward · · Score: 0

      Yuck nobody deals with data structures that way. They use MACRO assemblers.

      You can write perfectly good OO code in ASM any day, but what you end up doing is implementing your own language out of macros, kind of an STL for basic operations.

    19. Re:Programming or CompSci by Anonymous Coward · · Score: 0

      Soon there will be an Eclipse plug-in that replaces people like you.

    20. Re:Programming or CompSci by Kupek · · Score: 1

      Tell me you're not currently in a CS program.

    21. Re:Programming or CompSci by sir99 · · Score: 1

      It's a little difficult to ask google about something which consists of just a letter and an asterisk, with no context, even if you know it's pronounced "a star." Unless you know something about google I don't...

      --
      The ocean parts and the meteors come down
      Laid out in amber, baby.
    22. Re:Programming or CompSci by Vintermann · · Score: 1

      You probably learned to appreciate all the conveniences of higher level languages, too! That's why I think Bartlett's book is a good idea. I downloaded it and commented on it when it was in an early stage. Perhaps I'm even in the readme? :-)

      --
      xkcd is not in the sudoers file. This incident will be reported.
    23. Re:Programming or CompSci by Anonymous Coward · · Score: 0
    24. Re:Programming or CompSci by songbo · · Score: 1

      Well, Computer Science has to do with COMPUTERS. And understanding how they actually WORK, thus, should form part of the Computer Science education. Assembly language, which were orignally designed as a replacement for the machine language written in hexadecimal, is close enough to the machine that it can be used to teach about the way your programs, presumably written in some high level language, is translated into a series of ADD, AND, OR, PUSH, POP, MOV, etc. operations. And this would make you a better computer SCIENTIST, and will let you design better algorithms. How else are you going to design that next generation caching algorithm for the next Intel chip? That said, maybe someone would write a book teaching people to code in hexadecimal, and describe how THAT is utilized in the processor's FETCH-EXECUTE cycle and translated into a series of electron movements. That aspect of computer architecture should also be something that computer scientists and engineers have to understand.

      --
      There are 10 kinds of people in the world - those that know binary, and those that don't.
  8. Not new by El+Cabri · · Score: 2, Informative

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

  9. 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 Anonymous Coward · · Score: 0

      1. Encourage starting CS students in assembly
      2. The I-wanna-learn-Visual-Basic-so-I-can-code crowd drops out after first semester, lowering the density of IT employees
      3. There is no ???
      4. Profit!!!

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


      Your Bad Idea is actually the better idea. It's called a weeder class for a reason.

      --

      This sig is a good sig

    3. 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"
    4. 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
    5. 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.
    6. 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.
    7. Re:Good idea, Bad Idea by Anonymous Coward · · Score: 0

      "Imagine the retention rates once my CS100 class is taught in assembly"

      Some of us "old timers" call that job security.

    8. 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.

    9. Re:Good idea, Bad Idea by lake2112 · · Score: 1

      Some very good points. I guess I still believe in the naive statement "The Strongest survive". This obviously not the case, as all of a sudden in my workplace over 50 folded up boxes magically appeared. "The Man" tries to keeps layoffs as quite as possible, yet they do such silly things as practically giving 20% of the workforce and empty box to hold on to "in case they need it."

    10. Re:Good idea, Bad Idea by Anonymous Coward · · Score: 0

      not the Big Buck$(tm). As recent economic events have shown, too many of latter is a Bad Thing(tm).

      So remember folks, don't learn anything and by no means even try to make money with what you learn.

    11. Re:Good idea, Bad Idea by Anonymous Coward · · Score: 0

      Imagine the retention rates once my CS100 class is taught in assembly.

      Yes, imagine that. Throw a little bleach in the gene pool.

    12. Re:Good idea, Bad Idea by Eneff · · Score: 1

      There aren't too many "gods" out there. There is quite a bit of software to be made.

      The bigger issue is that there are only a handful of people who have been programming professionally for more than a decade. People don't become gods overnight; I can program four to eight times more quickly than when I started programming professionally two years ago, for example. I am still learning (and relearning on occasion) tips and tricks daily. My officemate seems to have really become steady in his fifth year outside of college. (I classify him as pre-god -- he's really good)

      People are having to write production code too quickly without strict review and bad habits are being learned. Younger programmers aren't getting necessary feedback (you certainly don't get the right kind of feedback in academia!) and people are moving to their second careers by the time they finally become useful.

      The problem isn't what they learn first.

    13. Re:Good idea, Bad Idea by pjwhite · · Score: 1

      I agree that assembly is a simple language, and a good thing for all programmers to know.

      But what language to learn first is really a question that depends on what the student's ultimate goal is. Someone who wants to go on and program only high level computer programs could get by with little or no training in assembly programming. Someone who wants to program DSPs and embedded microcontrollers must know assembly, even though C compilers exist for many small devices.

      Personally, I do about half assembly and half high-level programming. When programming for a 8-bit microcontroller with 256 bytes of RAM and 4k bytes of ROM, C or Java programming is pretty much not even an option. On the other hand, when writing a Windows or X program to display a graph on a computer screen, where there are basically no memory limitations, it would be kind of silly to write in assembly.

      A student who doesn't know where his education will lead him, should learn assembly programming, by all means.

    14. Re:Good idea, Bad Idea by ScottSpeaks! · · Score: 1
      Assembly is actually one of the simplest languages around.

      In fact, assembly is so simple that (with a little pre-processing by an "assembler") even a CPU can understand it.

      Any frosh/soph CS student who can't follow assembly should find a different major. Quickly.

    15. Re:Good idea, Bad Idea by Anonymous Coward · · Score: 0

      It depends on how you learn. If you learn by looking at an example and "repeating" it then a high level language is much easier. If you're like me and you learn by understanding then assembly is a lot easier to learn.

    16. Re:Good idea, Bad Idea by Zan+Zu+from+Eridu · · Score: 1
      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.

      If you only count mnemonics in an assembly language, you should only count keywords in a higher language (this of course means ignoring operators and syntax). The thousands of library functions are generally wrappers for os-calls you're going to have to make also to write a non-trivial program in assembly.

      With every task you're going to accomplish, you'll be more occupied with the complexety of the system if you use assembly. You'll have to worry about the intricacies of the CPU and the parameter layout of os-calls for example. Then there is the fragmentation of your code into tens of thousands of subroutines which are one hell to manage, keep coherent and free from side effects, or the irrisistable temptation to start optimizing right away and getting yourself bogged down in endless ant-fucking.

      Don't get me wrong, I think every CS student should know assembly in one form or another, but I can't agree with you on assembly being easier than HL, especially for the non-trivial stuff.

      As for the teaching of (virtual) assembly to people that have no or very little concept of algorithmic processing ("what is a loop?"); I've witnessed that myself some 20 years ago, and I can assure you it has your desired effect. Our course started off with about 25 students of which about 15 quit in a period of 6 weeks. After a year there was only 2 of us left. Needles to say that was the only year that course was given, no-one in his right mind is going to sign up for course with a chance of 2:25 of succesful completion.

    17. Re:Good idea, Bad Idea by geekoid · · Score: 1

      first, there isn't anything cryptic about assembly

      second, if someone can't get through assembly in a cs100 class, I don't want them in the industry.

      sorry, but I've spent too much time fixing problem from people who don't really understand what the hell there doing.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    18. Re:Good idea, Bad Idea by 706GL · · Score: 1

      I'll go against the grain and agree with you...
      I'd rather see the intro courses taught in a high level language so the students can focus on the algorithms presented rather than getting bogged down with difficult to read assembly code. Getting to know the algorithms and theory is why we call it a science instead of ITT Tech.

      I think it's better to teach assembly along with Computer Design so you can get a feel for what exactly the assembly code is doing. I loved the exercises where you converted a command to binary, then followed the 1 and 0's through the processor.

      Plus if you want a weed out class try Functional Languages. Ick.

      --
      ...
    19. 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....

    20. Re:Good idea, Bad Idea by RAMMS+EIN · · Score: 1

      ``One problem that I've found with many CS programs is that they put the knowledge ahead of the motivation for the knowledge.''

      I actually think this is a problem with education in general. They teach you lots of things, most of which appear at most remotely useful. It would probably be more motivating for many if they were faced with real problems to solve, which are then decomposed into pieces, after which solutions for those pieces are presented. This may not always be possible, though.

      ``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.''

      Aye, but that's not the point of science. They teach you fundamentals and generics, so that you can apply them to *any* problem. Some of these can be expressed in high-level languages, but you don't get a real grip on how the computer works until you do assembly. For many applications, you don't _need_ to know how a computer works, but it can always help. For example, the problems with conucrrency and instruction interleaving are very easy to understand if you know how things work at the machine level.

      --
      Please correct me if I got my facts wrong.
    21. Re:Good idea, Bad Idea by Anonymous Coward · · Score: 0

      Assembly is actually one of the simplest languages around. There is little syntax, and hardly any magic words that have to be memorized.

      That, um, depends on your definition of "magic words". If "goto" is a magic word (as it must be, because it's a keyword), then so is JNZ; but if JNZ is a magic word (as it must be, because it means "goto") then so must LDA be, because it has exactly the same status as JNZ; and therefore all opcodes are keywords, and ASM is the most complex language known to mankind. :p

  10. The Art of Assembly book by Anonymous Coward · · Score: 1, Interesting

    AoA, a worthwhile read

  11. Whatever by QuantumG · · Score: 1

    What we need are programmers that are taught software process.

    --
    How we know is more important than what we know.
    1. 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.

    2. Re:Whatever by $0+31337 · · Score: 1

      And don't forget whitespace. Best coding language ever!

    3. Re:Whatever by QuantumG · · Score: 1

      Ahh.. no. Following a proper defect tracking procedure is even more important during maintenance than during development. Students don't get taught anything about defect tracking. They also don't get taught how to read software and understand big systems, two skills that are imperative to a maintenance programmer.

      --
      How we know is more important than what we know.
    4. Re:Whatever by jhoger · · Score: 1

      Well yeah. How could you have software development without some kind of workflow management tool? Of course a piece of paper and a pencil or a spreadsheet will do for small stuff. But I hardly consider it something that takes more than 5 minutes of 'learning'

      As far as larger systems, well, I guess you could try teaching that. But if you just gave an intelligent programmer the equivalent of the hippocratic oath "fix it but try not to break anything else" that's about all you can do. After that it's sink or swim and you'll find out very quickly who is worth their salt.

    5. Re:Whatever by QuantumG · · Score: 1

      How many companies have you worked for? How many of those companies had a decent workflow? How many of these companies could tell you how many bugs they fixed last year or which programmer consistently hit their productivity estimates? The problem with the sink or swim method of running software companies is that everyone is sinking and the people who are swimming are dragging them along.

      --
      How we know is more important than what we know.
    6. Re:Whatever by jhoger · · Score: 1

      Actually sink or swim works pretty well. Hire the person, let them sink or swim, fire them if they sink. Real easy. What would you want to drag them along?

      And who gives a crap how many bugs person X fixed last year? This isn't a tech support call center. It's engineering. Are you seriously telling me that without some statistics you can't tell who on your team can pull their weight and who can't? It's not rocket science. In fact it's not a science at all. And the sooner you disillusion yourself the sooner you can see your way to reasonable budgets and timelines instead of overinflated corporate boondoggles.

      Do you work in aerospace by any chance? Maybe that is where your distorted view arises from. Try a startup now and then to see work getting done at a pace that will get your product to market before your competitor instead of 3 years later...

  12. 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.
    1. Re:New? by thogard · · Score: 1

      Do you want someone wasting their time remembering what is being stored in what register
      No, but I want them to have a good idea of what is likely to be stored in registers and I also want them to have a good idea of what is going on behind the higher level statements. All it takes is a quick search of c++ constructors to show that most modern programmers don't seem to understand what the cpu has to go through to get their code done.

      I'm glad this book as come out. Maybe now people can start learning to program in assembly as their 1st language again and we can cut down on much of the stupidity that makes the IT field look like its run by a bunch of morons.

    2. Re:New? by Alien_Phreak · · Score: 1

      Not sure if this is relevant...

      But I would have much rather learned Linux x86 assembler or any x86 assembler then the MVS IBM Mainframe Assembler (os/390) which I was forced to learn.

      ASM does give you a good basis for understanding low level machines. But the x86 at least has the remote possibility of being useful.

      If i'm not mistaken, x86 assembler comes in handy in graphics/game coding (though it's starting to get fased out by extremly efficient graphic libs)

      anyhoo...my 2cents.

      asm is a good idea, but I wouldn't start out incoming freshmen on it. (unless you enjoy seeing horified traumatized young men screaming in terror....on second though, start out with ASM)

      ok...enough rambeling...i'm out

      Alien.

    3. Re:New? by tswann01 · · Score: 1

      Not sure I agree w/ your premise. How may times have we heard complaints about no one in Redmond being able to write a decent browser?

      Steve Gibson espouses the use of assembly language even today.

      I'm a former ALC programmer, but not a CS guy.

  13. well, by ak3ldama · · Score: 0, Troll

    for one thing, it would certainly knock a lot of people out of the profession if the first language that they tried to learn was assembly ... though this might mean that eventually the only people writing code at least know what they're doing, therefore producing better products for the users

    --
    "but money is the God of Algiers & Mahomet their prophet." - Rich. O'Bryen June 8th 1786
    1. Re:well, by webmonarch · · Score: 0

      though this might mean that eventually the only people writing code at least know what they're doing, therefore producing better products for the users

      knowing how to write good code, and writing better products for the user are completely two different skills. In my experience, making it work just like the user wants it to is a back-and-forth process that rarely requires coding skill, but more listening and interpreting skills.

    2. Re:well, by An+Onerous+Coward · · Score: 1

      I disagree. The five people left in the field of programming will be under a lot of really tight deadlines.

      --

      You want the truthiness? You can't handle the truthiness!

  14. What, no Real Programmers anymore? by Anonymous Coward · · Score: 0

    I thought schools, at the very least, would teach assembly as introductory!

  15. Wussies by mikeophile · · Score: 4, Funny

    Real programmers learn machine code.

    1. Re:Wussies by blueforce · · Score: 1

      Real programmers have a shunt and plug-in...

      --
      If you do what you always did, you get what you always got.
    2. Re:Wussies by unix+guy · · Score: 5, Funny

      Real programmers learn machine code.

      REAL programmers use cat > /dev/kmem

      --
      "Straddling the sword of technology..."
    3. Re:Wussies by Anonymous Coward · · Score: 0

      Well, real manly programmers program bit slices.

    4. Re:Wussies by jhoger · · Score: 1

      I suppose you use a 2 digit hex display, a jog dial and an enter-key to program with?

    5. 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.

    6. Re:Wussies by prostoalex · · Score: 1

      Real programmers buy silicon in bulk and make their own CPUs and Assembly languages instead of sending a check to the man.

    7. Re:Wussies by Anonymous Coward · · Score: 0

      Wussies? Is that a cross between Wusses and Pussies?

    8. Re:Wussies by Anonymous Coward · · Score: 0

      Real programmers use a magnate to manual change the bits on their hard disks :P

    9. Re:Wussies by Anonymous Coward · · Score: 0

      >Real programmers learn machine code.

      49 20 49 20 63 6F 75 6C 64 6E 27 74 20 61 67 72 65 65 20 6D 6F 72 65 !

    10. Re:Wussies by bigberk · · Score: 1
      Real programmers learn machine code.

      Oh yeah?? Well B4 09 BA 09 01 CD 21 CD 20 66 75 24!!!!

      sigh i need to get laid
    11. Re:Wussies by dpilot · · Score: 1

      You mean you got to do machine code?

      For my first job, I didn't even get machine code, I did microcode.

      Seriously though, I learned Algol, Fortran, PDP-11 asm, and 8080 asm in college. (a few year^H^H^H^decades ago) In my first job, I was involved in semiconductor memory test, and spent a fair amount of time microcoding test patterns.

      Two things in particular made me appreciate cycle-by-cycle performance - coding a bit-banging UART on an 8080, and memory test patterns where every single cycle had to be correct - and validated.

      --
      The living have better things to do than to continue hating the dead.
    12. Re:Wussies by Anonymous Coward · · Score: 0

      Amen!! If you don't know machine & assembly langauge you ain't a programmer.

    13. Re:Wussies by Anonymous Coward · · Score: 0

      Real programmers get promoted into project management.

    14. Re:Wussies by rthille · · Score: 1

      Real programmers use some wire into the j-tag port...

      --
      Awesome furniture, accessories and cabinetry in Santa Rosa, CA: http://humanity-home.com/
    15. Re:Wussies by Anonymous Coward · · Score: 0

      Real programmers learn machine code.

      0F3F2C9B 52FBC3E0 AE0E73F3

    16. Re:Wussies by Anonymous Coward · · Score: 0

      Real programmers learn machine code.
      REAL programmers use cat > /dev/kmem


      REAL programmers do:
      cat core > /dev/dsp
      when debugging a core dump

    17. Re:Wussies by tjb · · Score: 1
      You mean you got to do machine code?

      When I started my current job, the compiler for one of our processing engines was only kinda-sorta done. Common instructions were supported, but most mode settings and some other things weren't. (Un)Fortunately, the compiler did let us hack in the correct opcode, leading to code like this:

      ------------

      ...stuff I can read... //I'll put a useful comment here

      ...stuff I can read... //and here

      ...stuff I can read...

      0x6782; //comments?

      0x9567; //we don't need no stinking comments!

      0x8102;

      ...stuff I can read...

      0x7230; //It should be completely obvious what this does, no comment here

      ...stuff I can read...

      ------------

      Even as somebody who *prefers* to program on the metal, I would never want to revisit that hell.

      Tim
    18. Re:Wussies by Anonymous Coward · · Score: 0
      Actually:
      B4 09 BA 09 01 CD 21 CD 20 66 75 24 21 21 21 21
    19. Re:Wussies by ScrewMaster · · Score: 1

      REALLY real programmers write microcode.

      --
      The higher the technology, the sharper that two-edged sword.
    20. Re:Wussies by pedro · · Score: 1

      You haven't lived until you've actually prototyped monitor code on an 8 bit micro in precisely that way.

      --
      Brak: What's THAT?
      Thundercleese: A light switch.. of TOTAL DEVASTATION!
    21. Re:Wussies by jtra · · Score: 1

      No, real programmers do:

      cat > program_name-release1.0.tar.gz

      and for extra credits they do also
      cat > program_name-release1.0.tar.gz.md5
      cat > program_name-release1.0.tar.gz.asc

      --
      -- Wanna textmode user interface for ruby? http://freshmeat.net/projects/jttui/
    22. Re:Wussies by Anonymous Coward · · Score: 0

      57656C6C2C2074686174206469646E2774206D616B65207365 6E73652E2E2E00

    23. Re:Wussies by Anonymous Coward · · Score: 0
      REAL programmers use cat > /dev/kmem

      REAL programmers need a life.

      jk

    24. Re:Wussies by GerritHoll · · Score: 1
      REAL programmers use cat > /dev/kmem

      REAL programmer's don't use those weak tools like, say, keyboards, or monitors.

    25. Re:Wussies by dpilot · · Score: 1

      As I worked on the tester code, I tried to put in comments, as best I could. Still, there were a number of "B.I.T." comments. "Because It's There" - places where the tester had some hardware oddities that the designers apparently kludged through.

      I moved on to a new position, and even years later my replacement would see me in the halls, mentioning seeing a "B.I.T." in the code.

      --
      The living have better things to do than to continue hating the dead.
    26. Re:Wussies by Jacek+Poplawski · · Score: 1

      This is not portable code, it requires Microsoft operating system (DOS or Windows). Try again.

    27. Re:Wussies by PurplePhase · · Score: 1

      Sounds like MIT's 6.004 class - at least 1 of the problem sets was that way. Are they still including that?

      8-PP

  16. 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 klui · · Score: 1

      When I was playing on Apple IIs, microcomputer hobbyists say you're either an 8er or a 6er. The 8ers liked Z80s, and 8008s, which eventually became the Pentiums that we hate or/and loathe. If you're a 6er, you preferred 6502s and 6800s which were influenced by the DEC PDP-11. In college, we studied and wrote in PDP-11 and 68000 assembler for our assignments. These architectures are quite a contrast to 8086es of the time because there was actually a nice correlation to the opcodes and operands in how they were laid out. Of course, it only made sense when you looked at each opcode in binary. 'Course, am a 6er but most of my coding is in C and the like so it doesn't matter unless I have no debug info.

    3. Re:Your book? by Anonymous Coward · · Score: 0

      oh man thanks for pointing that out.. and i was about to hit Checkout, this is sneaky

    4. Re:Your book? by tim1724 · · Score: 1

      Yeah, 6502 is easier to learn, because it's so simple. Of course, students aren't going to want to write code for an Apple II or a C64, but give them a good NES emulator, documentation, and an assembler, and they'll have a lot of fun coding for the 6502. (although I must admit, the NES is a weird little machine. The PPU's oddities might cancel out the 6502's simplicity. :-)

      Once you know the 6502 it's easy to learn the 65816 (SNES or Apple IIGS) or any of the other popular 70s or 80s microprocessors.

      I learned SPARC assembly in college. A very elegant machine (with only a few oddities to learn, such as filling that delay slot after a branch instruction) which teaches you lots of stuff about modern computer architecture. Last semester they used 386 assembly language instead, which the students (and instructors!) found much more difficult.

      --
      -- Tim Buchheim
    5. Re:Your book? by Anonymous Coward · · Score: 0

      That's a very good point. Sadly, I don't think there's any way of protecting against that; johnnyb could easily have used another name/account, or even had a friend post it, had he thought far enough ahead. The real question, though, is whether that would have made a difference- do you think the response a slashdot post would have differed if it read "my new book"? Perhaps some more direct criticism of the writing, but no difference in terms of exposure. The guy wanted hits, he got them. Would your support really change?

    6. 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.
    7. Re:Your book? by wiredbuddy · · Score: 1

      How about a 6802 ?? http://www.carrollsweb.com/dougrb/pics/6802.jpg. Found this somewhat of a coincidence that I just dug this out of my bench a week ago after building it almost two years ago. It flashes the LED's left and right ala Kit. Lost the source ASM so read out the hex code from the eprom and reconstructed the assembly. Anyway, the IBM PC was just coming out in my 3rd year of college (BSEE) and the assembly language classes at the time were on PDP-11's. Since the IBM's were around the teacher I had gave us the option to work on them instead of the PDP's. I LOVED that stuff and dove right in. I think the deeper understanding on what's going on has helped me tremendously. But then I do work in industrial controls with PLC's, which can be a lot of bit banging.

    8. Re:Your book? by Anonymous Coward · · Score: 0

      To his credit, he didn't pass it off in the book review section. I was really wondering why not when I was reading the post (before I noticed the author). If he had done that, it would have been really pathetic.

    9. Re:Your book? by Anonymous Coward · · Score: 0

      Or, you could give credit where credit is due. The book is open sourced under the GFDL.

    10. Re:Your book? by Anonymous Coward · · Score: 0

      YOU ARE AN IDIOT!!!
      I'm going to buy this book since I think it is a real good book. If he woulnd't have promoted this book, I probably wouldn't have found it.

      BTW, you are a DOUBLE IDIOT. His book can also be downloaded for free.

    11. Re:Your book? by Mr.+Darl+McBride · · Score: 2, Informative
      I'm put off too.

      I'll download it for free myself.

    12. Re:Your book? by ocooch · · Score: 1

      The 6502 is a very good processor to use for learning about computer hardware and assembly language programming. It is eazy to "hand wire" projects using this processor. You can look at the logic using a $20 login probe and a low end O-scope . See 6502.org

    13. Re:Your book? by Anonymous Coward · · Score: 0

      386 Assembly language would be a bear to learn for a first course in assembly language. SPARC or 68000 would be better for a first time student I'm sure.

      I know that turning on the compiler option to generate assembly code listing from my 'C' programs certainly helped my coding abilities.

      Using a simple language ( e.g. 'C' ) and a processer with a nice, regular instruction set would definitely be the best way for a student to see what's going on with the compiler and what the code being executed by the processor looks like.

    14. Re:Your book? by FreshFunk510 · · Score: 1

      You remind me of GWB. ;) Yeah, sure, the WMDs just haven't been found yet. Yeah, right.

      The last thing we need here is more FUD.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    15. 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.

    16. Re:Your book? by mdw2 · · Score: 1

      6502 is a great processor to learn assembly for, it's simple enough not to be confusing, but still quite useful in learning the ins and outs of assembly. the fact that you can use that knowledge to makes NES tech demos doesn't hurt either, though it isn't exactly useful :)

      --
      This sig intentionally left blank.
    17. Re:Your book? by infochuck · · Score: 1

      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).

      Hate to 'me-too' this (these) post(s), but I was so going to buy this book before discovering the author was (as an above poster so eloquently put it) 'pimping his warez' here without any kind of disclaimer indicating he may have been slightly biased. When I found this out, the author lost all chances of my ever buying this book. Maybe in a year or two, used, for $2, on eBay, so that he sees none of my money. We need good computer books, especially low-level ones. and this one may have fit the bill, but I'll support less ethically-impoverished authors, thank you very much.

    18. Re:Your book? by Anonymous Coward · · Score: 0

      Supposedly this is published under an open license (see the web site) - unless HIS books are the exception - so we should be able to get a digital copy somewhere, right ?

    19. Re:Your book? by FreshFunk510 · · Score: 1

      Actually, I initially didn't think you were "tricking" anybody. I merely said that I wouldn't choose to support an individual who did this in this situation. It was only the responses by the trolls here did I get defensive.

      In my original response I clearly say it's not personal, just something I wouldn't support simply because of the conflict of interest. If there's an indication that a favorable response is given because of the affiliation then at least I feel there's more honesty behind what the person is selling.

      Maybe you didn't intentionally do this but you have to admit that if people see it as trickey or deception that's completely justified. It's the same reason why Cheney is suspect of pushing the war because of his affiliation with Halliburton who just happen to be rewarded all of this lucrative contracts.

      It's the same reason why news channels disclose their affiliation with parent companies or subsidiaries whenever they report news on them.

      You didn't offend me. The jackasses here who think I'm trolling, however, do offend me because I'm clearly here trying to advocate fairness for everyone.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
  17. 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?
  18. 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.

    1. Re:Assembly language IS EASIER by Sigma+7 · · Score: 1
      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.
      That's assuming that the person can actually understand what is going on for each instruction. This is extremely important if the person is very young, where knowledge of computers is limited to what appears on the screen.

      Your four-year-old offspring will not be able to understand assembly or machine language, because there is no sufficient assoication between individual instructions and their actions. On the other hand, they will see and understand the BASIC instructions such as "LET SUM=5+10: PRINT SUM", becuase the language provides an obvious association between commands and their results. Assembly language is harder to understand, since there is no obvious association with the command and result.

      I am saying this from personal experience. I turned away from assembly when I saw that I had to type 6-8 lines of code to draw just one character on the screen (including it's color), when Basic only needed 2-3 lines (one POKE for the character, one POKE for the color, and one optional END or RETURN.) It took until Borland C++ 3.0 before I could understand assembly was a direct translation into machine language, as opposed to interpreted code like BASIC.
    2. Re:Assembly language IS EASIER by Anonymous Coward · · Score: 0

      I learned assembly long before I learned how gates are used to perform operations (like addition, for example). I'm convinced that I'd be better off if I learned about logic and gates sooner rather than later. Ah well.

  19. Development cycle by rteunissen · · Score: 1

    If i start getting a program together i want it to do what i want, and i don't want to spend to much time on hacking it together. Sure using assembly to create a program will make it faster (when used correctly) but it will take ages to develop. A language which takes this out of my hand and makes my development cycle shorter so i have more time for design and testing is more preferable over the time consuming task of programming it in assembly. Especially since most time spent on software is in design and testing, implementation needs to be as fast as possible. And with the new computers having processing power beyond anything even imaginable 10 years ago the use for assembly is quickly deminishing.

    1. Re:Development cycle by Anonymous Coward · · Score: 0

      Nobody is claiming you should develop new software in assembly, just that you should start learning with assembly.

    2. Re:Development cycle by johnnyb · · Score: 1

      Assembly language is useful for knowing how the pieces fit together, not necessarily for direct coding.

  20. Been there by Anonymous Coward · · Score: 0

    I go to the Milwaukee School of Engineering as Computer Science... One of the first things we had to learn was Assembly and we have to build an OS using it for a small car project before the end of our junior year. In addition, we have several courses dealing with the MC68HC11 processor that are helpful.

    Assembly should be known by anyone programming a computer, otherwise you can never really know what your code is actually doing.

  21. Obvious.. by appleLaserWriter · · Score: 0, Offtopic

    This assembly language, it speaks Hindi?

  22. Highschool Systems by HappyCitizen · · Score: 1

    should look at this book. At the highschool level, atleast around here, Algonquin (one of the better public high schools in Mass), does barely any Computer Science beyond the basics. They teach enough C++ to print messages on the screen and write files. I doubt they get to the API although they may. The also have your basic Java and VB courses. I think, not only should they teach low level programming, but our public schools need better and more programming courses. For example, you shouldn't be required to take C++ 1 Printing the screen to take C++ 2, etc. You should be able to start at your own level. Sorry if I'm ranting, I'm just annoyed at the schools CS courses and think that they should have more in the way of that. Especially assembly. I think this book would be great for it.

    --
    http://www.beyourowneviloverlord.tk
    http://www.frozenchickenthrowing.tk
    http://www.killercamel.tk
    1. Re:Highschool Systems by eriksarcade · · Score: 1

      just be thankful your school system uses a language that might help the students. My HS uses a horrible language called "Turing". Its pretty much BASIC with added slowness and instability. http://www.holtsoft.com/turing/intro.html It runs like shit, crashes whenever it wants, and the first time you try to complile, it will always give bullshit errors that dont show up when you try next time.

  23. Re:Assembly Language by Anonymous Coward · · Score: 0

    lol. only a low slashdot id can get away with posting that as a non-AC.

    got modded up to boot.

    ahhh. today's been a good day. didn't even have to use my A-K.

  24. Here this India? by airrage · · Score: 0, Offtopic

    Please learn Assembly, we need it.

    Thanks,
    America

    --
    "This isn't a study in computer science, its a study in human behavior"
    1. Re:Here this India? by The+Ape+With+No+Name · · Score: 0, Offtopic

      HEAR this Americans: we speak English too.

      Thanks,

      India

      --
      Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
    2. Re:Here this India? by Anonymous Coward · · Score: 0

      Well done.

    3. Re:Here this India? by Anonymous Coward · · Score: 0

      Please learn to spell, you need to.

  25. Hooray!! by Anonymous Coward · · Score: 0

    Bloody time students learn the basics before building horrid Java 2 Swing GUIs. Not that the easy interface builders and very high level languages aren't nice or useful (Perl lets you get many complex things done in a hurry).

    This is a book for the home library as well as University book stores!

  26. 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.

    3. Re:Probably a bad idea by Anonymous Coward · · Score: 0

      I can't understand all that phychology gobbledy-gook, or the quagmire of economics (macro and micro). I don't use either for my job of computer network tech. But you are required to take classes on them while at university. That is one reason I haven't finished my college course. I would rather work than sit through those classes.

      At least an assembly language class would give me a greater understanding of the basic tool I use to make a living. And, hell, it's only one class, out of twenty or more that are required for the computer oriented majors. Not like it's going to bog a student down for four years.

    4. Re:Probably a bad idea by Dukael_Mikakis · · Score: 1

      2) Job practicality

      What?!?!?

      1) .CODE
      start: invoke LearnAssembly,null
      2) invoke _???, null
      3} .WHILE TRUE mv eax, Profit!!!
      .ENDW ret

      Sorry, my assembly's a little rusty.

    5. Re:Probably a bad idea by pla · · Score: 1

      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.

      Ah! Thank you. EXCELLENT analogy.

      If I had mod points at the moment...
      And you hadn't already hit "5"...
      And I hadn't already posted on this topic...

      Well, you get the idea. :-)

    6. Re:Probably a bad idea by Futaba-chan · · Score: 1
      99% of CS grads aren't going to use assembly in their day to day jobs.

      You're kidding, right? Leaving aside embedded work for the moment (which there's a lot of here in upstate New York), haven't you ever had to track down a weird and subtle C or C++ bug by looking at the disassembly window? (Or BCEL'ed into the bytecode that javac produced, for that matter?)

    7. Re:Probably a bad idea by Anonymous Coward · · Score: 0

      "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."

      So my time would be infinitely better spent cuddling up to the people with actual business problems that I should be solving instead of trying to out-program the herd of Indians/Pakastanis/Malaysians who can also program computers, with or without a deeper understanding of the languages based on assembly.

      Ringing endorsement, thanks!

    8. Re:Probably a bad idea by Ieshan · · Score: 1

      Psh. Latin literature is some of the finest stuff around. As a Latin and Greek student, I always find it funny that people assume no one ever wrote in these cryptic languages I study. The main point, for me, at least, isn't to study the languages to know lots of vocabulary, but rather to learn the languages so I can read some of the finest literary accomplishments in their actual tongue.

    9. Re:Probably a bad idea by drmike0099 · · Score: 1

      That is a good analogy, but I'll use it to make a slightly different point. I can read most Latin and figure out what it means, but I've never taken any course in it. I did, however, already know English (I know, not that useful) and learned both spanish and french, and then went into medicine (which has a lot of Latin naming schemes, if you didn't know). Knowing all these derivations basically made me pretty good in Latin.

      Now I'm not suggesting that by learning Perl, PHP, Java, C, C++, VisualBasic, etc you will ever get to a point where you can understand assembly, but I think if you have a broad exposure to all of those derivations of assembly you can learn the same thing, which is how to code good code in a way that makes sense. I don't know assembly, but I have a pretty good feel for what it does by having broad experience at a higher level.

    10. Re:Probably a bad idea by daveinthesky · · Score: 1



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

      This is a great analogy, but I think you miss one simple point.

      The best way to learn about programming languages is to work in a programmable programming language. And, you aren't going to really learn the high level concepts unless you use a truly high level language.

      >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.

      And this is where the analogy is most true. If you really want to be a good coder, getting down the nitty gritty is good, but learning the high level concepts is even better. Now, a choice like LISP over asm for learning CS is probably a much better choice. LISP is to Latin as asm is to (insert simple but underexpressive language here)

    11. Re:Probably a bad idea by infochuck · · Score: 1

      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).

      Huh? Sure, algorithms don't change, but do I really need to remeber them? That's what reference material is for. Know that there's an algorithm to do something, here's where you can find it, and bam, you're done.

      Learning assembly gives one a deep understanding of HOW THINGS WORK at a VERY low level - one that can, IMO, only be gleaned by manipulating registers yourself.

      By simply momorizing some algorithms, you are no better than the luser who takes a crash-course in MCSEism, memorizing verious things, and learning just enough to pass the test, without REALLY understanding ANYTHING. Learning assembly forces you to understand. Rote memorization is... well, rote. And memorization. You don't really learn anything. It's attitudes like yours that are churning out a generation of 'IT' people that don't know jack shit.

    12. Re:Probably a bad idea by infochuck · · Score: 1

      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.

      Great analogy! And not only does it help you with other languages, but with science as well! Where do ya think all those genus/species/phylum names came from?

  27. No Way! by Spaceman40 · · Score: 1

    Hey, this is what I've been saying: Learn ASM structure (x86, but MIPS would be easier) Learn High-Level structure (C/BASIC/Pascal/etc) Learn OOP structure (C++/Java/Python) Instead of this stupid data structures core all the colleges are going with. Then set up a bunch of in-depth language classes, ex. on Perl, or Lisp, or whatever to actually learn the languages. They were teaching Pascal a little while ago in CS, but who ever uses it now? Why teach a language that is going to be obsolete when you could teach the structure, making learning the languages easier later on. Every job I've had has required me to learn a new language: I had to learn VRML (remember that?) a couple years ago, and I haven't used it since. Hmm.. Should probably read the article now, huh?

    --
    I [may] disapprove of what you say, but I will defend to the death your right to say it.
    1. Re:No Way! by Futaba-chan · · Score: 1
      Instead of this stupid data structures core all the colleges are going with.

      A solid understanding of data structures and algorithms isn't stupid -- it's fundamental.

      Then set up a bunch of in-depth language classes, ex. on Perl, or Lisp, or whatever to actually learn the languages.

      Better yet, have one good course on programming languages that teaches how to go about learning programming languages, good properties thereof, and whatnot. A student who has mastered such a course can thereafter learn any desired language independently, or as a side effect of other coursework.

      But yes, students should learn assembly, and block-structured imperative languages, and OO languages, and functional languages, among other things. Which is why a solid programming languages course is essential.

  28. Whatever by The+Ape+With+No+Name · · Score: 1, Funny

    If it isn't worth doing in Brainfuck*, then it isn't worth doing.

    *Author's note: Brainfuck can be replaced with Perl.

    --
    Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
  29. 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

    1. Re:Available under GNU FDL by Anonymous Coward · · Score: 0

      Considering that his page sells it, I am puzzled why he omitted that fact, too.

    2. Re:Available under GNU FDL by Hal+The+Computer · · Score: 1

      Well he probably didn't mention this because he wrote the book. Free downloads don't earn nearly as much in the way of royalties.
      Yes, as many other people are pointing out, johnnyb probably should have mentioned that this "amazing new book" is his own.

      --

      int main(void){int x=01232;while(malloc(x));return x;}
    3. Re:Available under GNU FDL by cfuse · · Score: 1
      I don't know why he didn't mention that this is a free documentation project

      That would be because he's pimping out his book.

      C'mon, you know that assembly will make you into a real man. What a load of crap!

      Everyone knows that the best programmers are the ones who:

      1. Take the time to pass on their knowledge
      2. Document their code
      3. Use the best tools for the job
      4. Aren't "I know assembly" wankers
    4. Re:Available under GNU FDL by julesh · · Score: 1

      Confidence inspiring. I've just downloaded the latest version from that projecct and there's a typo in the URL for downloading PuTTY (For anyone interested, s/chiart/chiark/ should fix it). Things like this should have been checked & fixed before publication.

      Furthermore, I'm not entirely convinced by the choice of the horrendous AT&T syntax for beginners. Traditional Intel syntax is much easier to understand, IMHO, and its not as if there aren't free tools for working with it.

  30. 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.

    1. Re:Knowing assembly language is vital, mostly by Anonymous Coward · · Score: 0

      I have the sentiment that using the word "maketh" maketh you soundeth liketh a fucking dork. ...

      eth

    2. Re:Knowing assembly language is vital, mostly by dysprosia · · Score: 1

      It's a reference to an old proverb. Manners maketh the man..

  31. 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.

  32. Oracle DBMS via Assembler by ackthpt · · Score: 1

    ...Must strangle self...before too late...

    --

    A feeling of having made the same mistake before: Deja Foobar
  33. Re:Assembly Language by Valar · · Score: 0, Redundant

    That's a low ID? Youngins'

  34. 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
    3. Re:From the linked page by kryptkpr · · Score: 1

      Assembly will get panties off her faster once you've finished implementing the algorithm.. but by that time, she'll be asleep.

      --
      DJ kRYPT's Free MP3s!
    4. Re:From the linked page by Anonymous Coward · · Score: 0

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

      Absolutely! Assembly language is fast!

      All you need is a few "mov" statements to get close to her, a couple "shr" to shift her panties down, and a few system calls to "finger" to get to "know" her a bit better.

      What could be simpler?;-)

    5. Re:From the linked page by dakan · · Score: 1

      Yeah. Give my GF a book on Linux Assembly programming. That should get those panties off in a hurry.
      Really? Now that's my kind of girl!

      --
      -This sig has been discontinued after a sudden realization.
    6. Re:From the linked page by geekoid · · Score: 1

      yeah, just not for you.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    7. Re:From the linked page by Anonymous Coward · · Score: 0

      Please. Pimply-faced 14 year olds don't have girlfriends. Go back to your computer and delete that porn before your mom finds it. You wouldn't know panties if they were on your head. Backwards.

    8. Re:From the linked page by Anonymous Coward · · Score: 0
      Hell - she's got a present!

      Don't matter what it is - them panties will be round the ankles, and she'll lie back and think of Linus.

  35. What about the non-developers? by lake2112 · · Score: 1

    What about all the engineers who may need a basic understanding of CS for whatever applications they may have to modify, use, etc.? Engineers need very little knowledge of machine code as they often just need to create some Excel Macros, small scripts, etc.? Assembly would provide no benefit in this case, only prolong the learning process. Just because I use a car doesn't mean to drive it I have to be a mechanic ....

  36. self published, no review?DO NOT BUY THIS BOOK by Anonymous Coward · · Score: 0

    wtf?!?! There is no review here of an unread unreviewed book. This whole article is a sham. Do not buy this book. This book is the submitter's self published ego project!! Warning!!

  37. Re:Assembly Language by Anonymous Coward · · Score: 0

    For some reason this tired joke always makes me laugh.

  38. 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/
  39. Hey! by fiannaFailMan · · Score: 1

    There's nothing wrong with AppleScript!

    --
    Drill baby drill - on Mars
  40. 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.

    1. Re:A good idea by smallpaul · · Score: 1

      BASIC??? BASIC is a terrible learning language. If you find a BASIC with good libraries (so students can do fun stuff) it is almost certainly going to be a convoluted bastard BASIC like Microsoft's. On the other hand if you can find a pure BASIC, it will hav a library that basically consists of "print" and "input". Classic BASIC teaches a variety of terrible habits. Remember that "goto" is a central flow-control structure and global variables are the default.

      For the 21st century, there are many better choices. My favourite is Python but it is not the only one.

    2. Re:A good idea by swtaarrs · · Score: 1

      I guess you're right about BASIC being a flawed language, but that's not my main point. If you can teach higher level concepts with python or perl or php or something, that would work just as well, most likely better.

  41. That's good and all but... by ejaw5 · · Score: 1

    It's good to know assembly to understand the operations of a computer, but assembly isn't practical for production use. You could design your system with a specific microcontroller and write your microcode with assembly. But if for some reason you have to change chips, you may have to re-write your code. On the flip side, if you used C or some other portable language, you could compile it to other chips...perhaps with just a few chip-specific changes.

    --

    $cat /dev/random > Sig
  42. Why not just use an HP calc? by teambpsi · · Score: 1

    if you really want to teach them, start even simpler -- RPN arithmatic is pretty much all you need to know about pushing and popping :)

    --

    Old age and treachery almost always overcome youth and skill.
  43. I was in a Intro CS course... by Anonymous Coward · · Score: 0

    at the University of Michgan that started off with a description of logic gates, moved up to the ISA, and then started us programming in actual binary (yes, we manually programmed the memory with 1's and 0's).

    We then (quickly, thank god) moved up to assembly, and finally a bit of C. Our last program involved writing it first in C, and then acting as the compiler and translating the code into assembly.

    It wasn't on x86, but a much simpler ISA that ran in simulation on a PC. It was pretty cool, figuring out hacks to re-use registers and cut down code.

    Alas, the year I took the class was the last year they offered it. Now all CS majors and engineers start off with C++ and Matlab, taught in a hackneyed fashion.

  44. 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.

    1. Re:For the record by bluGill · · Score: 1

      Software engineering is nothing without the CS behind it. Your suggestion is like asking someone to learn Mechanical engineering without learning physics, or even statics. Those form the basis of everything you do latter on. Sure no mechanical engineer would ever calculate both Ms in the gravitational equation, but you need to know they exist. (I can't even remember what the standard letter is for the equation now, maybe G?) On earth you can assume 9.8m/ss, and the attraction of the top of a bridge on the bottom is in significant. In space, maybe that isn't true, I don't know, I don't deal with space craft, if I did I would find out, but I need to know that I could ask that question.

      Likewise you cannot do software engineering without alogrythms and data structures. Perhaps you don't have to go into figguring out the O for each algorythm, but you need to know how to do it, and you need to know how a O(n) algorythm differs from a O(n!) one. In other words there is room to dumb down CS a little but, but in the end you need to pick up any programing language quickly, and you need to know a lot of algorythms so you know which to choose.

      In these days I'd add design patterns into the list of things you should know to get a CS degree, but I'm not sure how.

    2. Re:For the record by El · · Score: 1

      I beleive at Stanford University, "Computer Science" was considered part of the Philosophy Department, not Engineering! After all, boolean algebra has it's origins in philosophy.

      --

      "Freedom means freedom for everybody" -- Dick Cheney

    3. Re:For the record by pclminion · · Score: 1
      Sure, you're absolutely right.

      But an engineer doesn't take a whole physics workload. He/she takes the basic classes, and then some classes more specific to their engineering field. A mechanical engineer would probably take a class on the physics of vibration, for example.

      Similarly, software engineering would be based in computer science but would focus on engineering itself -- designing large systems, fault tolerance, working as a team, and things of that sort. I can attest that many incredibly intelligent computer scientists don't have any idea how to write a coherent large program! Just checking for error return codes seems too much of a bother for some :-)

      I say all this as a person who considers himself foremost a "computer scientist" but who is stuck doing software engineering for the moment.

    4. Re:For the record by Roger_Wilco · · Score: 1

      The university of Waterloo has a fairly new software engineering department. Hopefully it will help keep some of the code monkeys out of CS.

    5. Re:For the record by Lost+Engineer · · Score: 1
      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.
      The delay is simply a clever way to get in another instruction, and often it can save you a jump in a simple if-then-else situation. If you dont want to use it you can always just put a nop there every time. How hard can sethi possibly be? Certainly having to use it is worth all the other RISC goodness.
    6. Re:For the record by bluGill · · Score: 1

      Return codes... Unfortunatly to really do error handling you can't complete any assignments. Remember Fred Brooks? To go from a working system to something you can sell takes 9 times the effort? All those error codes are part of the reason. Sure I should check for malloc failing, but what if it does? exit(-1) is the only answer that can be implimented in 2 lines of code, true robust error handeling takes far more effort.

      There isn't time or ability to do it in a 1 semester class, so professors are forced to hand wave over it, which I recall them all doing. The assignments all said "ignore errors unless otherwise noted" because there just isn't time to write the program. They put that clause in hoping that everyone will think of this as an exception. (I know I ignore error handling too much myself)

      Sure it would be nice to get software engineering seperated, with big projects. However you still need all those alogrythms before you can do it.

      Worse, proper error handeling (exit -1 is not proper error handeling) obscures the code. I can write quick sort in a few lines of code, and demonstrat I understand it. Error handling means that it is much harder to see what the code is doing, a big consideration when you are teaching 40 kids.

    7. Re:For the record by Anonymous Coward · · Score: 0

      Agreed.

      "Computer Science is as much about computers as astronomy is about telescopes." -- Dijkstra

    8. Re:For the record by Anonymous Coward · · Score: 0

      I'm with you on this one. I am 10 months away from a CompSci degree. I began the program with the assumption that I would leave as a quality programmer. This was reinforced by the first 3 classes being mostly about programming, with the exception of the occasional flavor of 'big O' sprinkled into a few lectures.

      Now, I am glad that I am getting a CS degree, but I lucked out. Many 'hackers' that want a programming degree at my school end up in the MIS program instead. At least the MIS dept. teaches practical programming -- that is, programs that are more significant the HelloWorld & inserting and deleting random numbers from a data structure.

      As for the whole assembly arguement, yes it is important. So are many other languages. Being a quality programmer is more about knowing the minutiae of one language, but rather understanding the nuance of many languages. This is somewhat akin to a carpenter using a hand saw, not because he doesn't know how to use an electric saw, but rather because it is the right tool.

      so there.
      -Lanced

    9. Re:For the record by Recluse · · Score: 1

      And they will, over time. I hear the same expectation/need from the other side all the time - the engineers actually building the hardware have good practices beaten into them as they're coming off the college factory line; the programmers coding for the hardware wouldn't know "good practices" if it hit them in the face. And it usually does, repeatedly, until they learn or decide it's not what they thought they'd be doing. Programming - software engineering - is becoming more of a discipline over time, but we're still years and years away from where the old engineering teachings are.

      And don't even get me started on "computer engineering". Most of the schools I've seen fail to teach any of computer science, software engineering, or generic engineering to the kiddies in that major. The premise is good, the output lacks.

      --

      --
      Look ma, I'm a .sig
  45. real programmers by lethalwp · · Score: 2, Funny



    real programmers do:
    copy con myprogram.exe

    1. Re:real programmers by bloggins02 · · Score: 1

      Are you suggesting that real programmers use DOS? I see......

  46. So if I read that by Anonymous Coward · · Score: 0

    can I pass my MCSE?

  47. No, but... by Svartalf · · Score: 1

    ...it's a way to make better programmers out of the ones that aren't prodigies.

    If you understand how the CPU does things and understand something about how that compiler for your preferred higher-level language does things to the CPU, you're likely to produce vastly better code than someone that doesn't understand WHY it's not as good an idea to increment a number in C/C++ with something like:

    i = i + 1;

    as opposed to:

    i++;

    assuming that 'i' is an 'int' sized integer...

    --
    I am not merely a "consumer" or a "taxpayer". I am a Citizen of the State of Texas
    1. 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.

    2. Re:No, but... by AndroidCat · · Score: 1

      If your compiler produces different code for i = i + 1; and i++; then it should be shot. And unless you've looked at the output, you have no business wasting time trying to second guess the optimizer.

      --
      One line blog. I hear that they're called Twitters now.
    3. Re:No, but... by Anonymous Coward · · Score: 0

      Uh, and once you learn about compilers you'll learn that any half-decent compiler will turn both of those expressions into exactly the same code (typically something like "incl %eax" on x86).

    4. Re:No, but... by paganizer · · Score: 1

      Now THAT is insightful.

      I just wrote an immense diatribe that involed Linus, VB for DOS and Fortran, then realized it was silly, and deleted it.

      --
      Why, yes, I AM a Pagan Libertarian.
    5. Re:No, but... by scotch · · Score: 1

      A good (or merely ok) compiler will generate the same instructions for both "i = i + 1;" and "i++;" However, in the spirit of generic programming, one should typically get in the habit of avoiding temporaries explicitly, because if "i" is a user defined type, you'll want to use "++i;" to avoid the temporary if you can get away with it. This is obviously c++ I'm talking about here.

      --
      XML causes global warming.
    6. Re:No, but... by Anonymous Coward · · Score: 0

      The 1980s called. They want you back.

  48. 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.

    1. Re:Teach architecture, not assembly by Anonymous Coward · · Score: 0

      You have a very high user ID. You don't have the minerals to tell us what to do.

    2. Re:Teach architecture, not assembly by wan-fu · · Score: 1

      You have a very high user ID. You don't have the minerals to tell us what to do.

      And you have no user ID. You don't have the minerals to challenge me.

      I'm just presenting my opinion and suggesting how people might approach teaching CS. I don't tell you what to do.

  49. 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 Anonymous Coward · · Score: 0

      Welcome to Slashdot, where 3/4 of the conversation is correction of a previous statement by someone else, nearly always starting with "uh" "umm" or "actually."

    3. 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.

    4. Re:Syntax, OS interfaces... by quantum+bit · · Score: 1

      ...the other one that is more familiar to DOS/Windows x86 assembly programmers (which is used by the NASM assmebler).

      The 'other one' is the Intel standard.

    5. Re:Syntax, OS interfaces... by Archfeld · · Score: 1

      Man you are either dating yourself or have really eclectic tastes in reading :)

      --
      errr....umm...*whooosh* *whoosh* Is this thing on ?
    6. Re:Syntax, OS interfaces... by Un+pobre+guey · · Score: 1
      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.

      I'm missing something here. x86 syntax hasn't changed since the '60s? There were no microprocessors in the '60s.

    7. 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.
    8. Re:Syntax, OS interfaces... by madcow_ucsb · · Score: 1

      There were no microprocessors in the '60s.

      Ok, maybe not, but close enough. The Intel 4004 came out in '71. And there were *certainly* processors (ok maybe not MICROprocessors) back into the 30's (Mark I anyone?) I'm not sure when the idea of writing "mov ax, bx" came to be, but I wouldn't be surprised if it was in the 60's.

    9. Re:Syntax, OS interfaces... by irokitt · · Score: 1

      When I took assembly, our textbook used TASM and MASM almost interchangeably. Yes, the syntax is different, but each operation is the same, and most of the syntax is surprisingly alike (BTW, we used a combination of MASM and VC++ in the class itself).
      These two assemblers really should be considered as two different extensions of the same standard.

      --
      If my answers frighten you, stop asking scary questions.
    10. Re:Syntax, OS interfaces... by irokitt · · Score: 1

      Confusing, as in the "little-endian" binary storage format?

      --
      If my answers frighten you, stop asking scary questions.
    11. Re:Syntax, OS interfaces... by rbullo · · Score: 1

      You're forgetting about HLA. I hear it's great for beginning ASM programmers (never tried it myself, so I can't give a review).

      --
      OH NOES!!! IT APPEARS YUO DO NOT HAVE ENOUGH MONEY TO PAY FOR DIS HERE PIZZA! WAHT EVER ARE YOU GOING TO DO!?!?
    12. Re:Syntax, OS interfaces... by gweihir · · Score: 1

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

      Indeed. I learned with MC68000, and allways had trouble with dst, src afterwards. (Apart from the brain-damaged non-orthogonality of x86 assembler....)

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    13. Re:Syntax, OS interfaces... by CmdrTHAC0 · · Score: 1

      To those of us who learned M68K assembly with Assempro on our 1337 C= Amiga machines, where everything is done as "src, dest", it's a real PITA to switch to Intel's "dest, src" mode because we accidentally read instructions backwards from time to time. But then again, there may only be one of me.


      lea intname, a1 ; pointer to "intuition.library" in a1
      move.l ExecBase, a6 ; base address of core library in a6
      jsr OldOpenLibrary(a6) ; open library, unversioned
      move.l d0, intbase ; store base address of Intuition (high-level graphics)

      --
      __CmdrTHAC0__
      In Soviet Russia, Spanish Inquisition doesn't expect YOU!!
    14. Re:Syntax, OS interfaces... by menkhaura · · Score: 1

      It was before that. FORTRAN, deemed the first high level language (if you don't count Plankalkul) came in 1959.

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
    15. Re:Syntax, OS interfaces... by sam0ht · · Score: 1


      And just as Open Source software proceeds towards best-of-breed status one patch and bugfix at a time, /. proceeds towards truth in a process of gradual refinement and argument. Isn't it the best sort of discussion that progresses towards everyone having a greater understanding ?

    16. Re:Syntax, OS interfaces... by Anonymous Coward · · Score: 0

      Destination is always on the left..

      variable = "stuff"

      See, destination on the left. It wouldn't make sense any other way.

      "stuff" = variable

      See, now that just looks stupid.

    17. Re:Syntax, OS interfaces... by mikelambert70 · · Score: 1

      There's a new version of MASM (8?) which fully supports all pentium instructions. It's far from obsolete, a great tool which great macro capabilities. The great macros are one reason why Randall Hyde based his HLA on MASM. See www.masmforum.com for more.

      For something new, fresh and interesting, see Tomasz Grysztar's Flat Assembler (Fasm) at flatassembler.net . Available for DOS, Linux, Windows, Menuet (www.menuetos.org) and for anything you care to port in to.

      board.win32asmcommunity.net is a great resource too, I think Randall Hyde still calls this home for HLA discussion, although masm and fasm have since spawned their own forums.

      What is remarkable is that the asm community is getting more active all the time, there's a significant revival going on.

    18. Re:Syntax, OS interfaces... by Anonymous Coward · · Score: 0

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

      Would you say that of C?

      Asm is just another high-level language - just not very high level. Only a very very cheap assembler would require the parameter order to match the bytecode order. Any non-crap assembler can hold one instruction in memory at one time - enough to allow any syntax you fancy.

      Personally I can't imagine writing SRC,DEST but that's because I don't write 5 = a in C either.

    19. Re:Syntax, OS interfaces... by cheekyboy · · Score: 1

      Or if you know how C code gets compiled into ASM, why bother, and do it all in C code.

      Yes I started out in c-64 6510 code, and then 68000 amiga coding, then 808x CRAPOLA FROM HELL made by brain dead calculators upgrade to CPUs chips.

      The TMS RISC chip was nice, and so was 88000 by motorola which later the 880000 was merged with 68k tech to make the new funky PPC.

      AH the old days of having the raw CPU manuals with clock timings , full op code listings, each bit described, cycle timings the works.

      Hope you java coders realise theres more to that 2 byte java bytecode than one IF, its like 100 op codes of goodies, so your java will never be as fast as hardcore C/C++ gurus that can cut assem too.

      --
      Liberty freedom are no1, not dicks in suits.
    20. Re:Syntax, OS interfaces... by cheekyboy · · Score: 1

      NO lets take it the other way

      MOVE "STUFF" into VARIABLE.

      its more english orientated

      MOVE YOURASS to THE TOILET

      MOVE THECAR to THE ROAD

      now lets try intels

      MOVE to ROAD the CAR.

      Sounds more asian style english.

      Get my drift.

      Maybe brain ur not good.... sir.

      --
      Liberty freedom are no1, not dicks in suits.
    21. Re:Syntax, OS interfaces... by commbat · · Score: 1

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

      In case anyone is interested, this tradition started at least as far back as the 8080 (1974) and is a reflection of the binary opcode which, in turn, made sense at the hardware level.

      The ATT standard (used by gas) is src,dest

      Much more intuitive to this english speaker... "Move this over there" where intel would have us say "Move over there this here"

      --

      --
      'Intellectual Properties' are uncontrollable in the wild. To base an economy on them is just stupid.
    22. Re:Syntax, OS interfaces... by douglas+jeffries · · Score: 1

      SRC,DEST seems like useful syntax considering that on paper I often pseudocode like:

      3 + 2 --> a

      Clearly, this differs from the a = 3 + 2 syntax of C. However, this is a similar issue to (+ 3 2) verses 3 + 2.

      The order which is "naturally determined by the processor" does not seem to impact the way I'd like to think of it, and only seems to come up if you translate a lot of assembly to machine code by hand.

      This is an interesting issue. There is real benefit to assemblers presenting similar views of different machines, but there is also value in variety.

    23. Re:Syntax, OS interfaces... by douglas+jeffries · · Score: 1

      I like the way you explained that. I'll have to remember that reasoning the next time I get into a discussion about syntax.

    24. Re:Syntax, OS interfaces... by douglas+jeffries · · Score: 1

      is a reflection of the binary opcode which, in turn, made sense at the hardware level.

      It isn't obvious to me why it made sense at the hardware level. I don't see why any ordering would be better than another, except that related bits should be grouped. I can imagine that it depends on the physical interface of the register file, but I don't see what would require that to be any particular way either.

      If there is truth to what you say, I would certainly be interested in why one ordering makes more sense than another.

    25. Re:Syntax, OS interfaces... by bitRAKE · · Score: 1

      FASM - Flat Assembler. FREE, open source assembler developed for assembly language programmer by an assembly language programmer.

      http://flatassembler.net/

    26. Re:Syntax, OS interfaces... by Anonymous Coward · · Score: 0
      If yuu 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.
      Strange, I found it fun, but not useful! I have this nice assembly book that came with an old version of MS's assembler that has all the codes the 286. It's interesting reading. (For reference, I consider this to be the 'Old Testement', and my C quick reference guide to be the 'New Testement'.)
  50. 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.
    2. Re:Disclosure: The submitter is the Author. by Bas_Wijnen · · Score: 1

      When they're telling something about an other VA linux company, they do say such things. I guess in this case they didn't notice. There'll probably be an update about it soon ;-)

    3. Re:Disclosure: The submitter is the Author. by Anonymous Coward · · Score: 0

      it won't make us feel like we're being scammed into buying someone's book.

      Because as we all know, anyone who offers anything for sale is a "scam artist," and especially if they produced the product themselves.

      Can't get a job, and can't do business on yer own. Let's live in a plastic crate to make Slashdot happy.

    4. Re:Disclosure: The submitter is the Author. by FreshFunk510 · · Score: 1

      Cool. Good to know. :]

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    5. Re:Disclosure: The submitter is the Author. by Anonymous Coward · · Score: 0

      well... at least usually he's honest:
      >Let me be honest here. I'm fat. I was buff in 10th-11th grade. I also ate a lot. When I left sports, I didn't slow down my eating. When I went to college, I got fatter. When I got married, I got fatter. When my wife was pregnant, I got fatter. Now, with kids, I was getting even bigger.

      He must be huge by now!

      http://www.eskimo.com/~johnnyb/spiritual/Dieting .h tml

    6. Re:Disclosure: The submitter is the Author. by FreshFunk510 · · Score: 1

      When they offer biased reviews like he did and don't disclaim that they have an association with a product then, yes, they are "scam artists" in my book.

      I mean what's the difference between these guys and the companies in the previous story who try to trick Google into pointing to their site?

      Fool me once, shame on you. Fool me twice, shame on me.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    7. Re:Disclosure: The submitter is the Author. by Anonymous Coward · · Score: 0

      I mean what's the difference between these guys and the companies in the previous story who try to trick Google into pointing to their site?

      You know what? Some guys are just tryin' to make a living. After getting shit dumped on us for months in the "job market," you'll have to excuse people whose marketing techniques aren't advanced enough to include finely crafted disclaimers so as to avoid being unfairly disqualified as "scam artists."

      Maybe the guy is just trying to sell his book and pay the bills.

    8. Re:Disclosure: The submitter is the Author. by FreshFunk510 · · Score: 1

      And what makes his story different from every other person who is in his exact same situation but have to actually play by the rules? Does this guy (I'm guessing you're him since you're posting AC) deserve some sort of entitlement over every other author out there who doesn't resort to such unfair means to sell their own book.

      Look, buddy. Don't whine to me about trying to make a living or trying to pay the bills. I've been unemployed for over 12 months within the past 2 years. Just because you've got it tough doens't mean you can break the rules. Plus it's all a question of respect. If this person wants to resort to those means, go right ahead. Just dont' expect people to shut up and not say something about it. Like I said, it's nothing personal. Had anyone else done it I would've said the exact same thing.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    9. Re:Disclosure: The submitter is the Author. by Wise+Dragon · · Score: 1

      It's not really a review, you know. More like a Press Release emphasising the books's merits, probably hoping to provoke some debate on the pros and cons of his main ideas. And the difference between this guy and the googlescammers is this guy didn't submit his story AC. I'd still like to see disclaimers on this kind of stuff.

    10. Re:Disclosure: The submitter is the Author. by Anonymous Coward · · Score: 1, Insightful

      I'm guessing you're him since you're posting AC

      lol, whatever. No, I'm not "him." I'm another "him" and I don't have a book to sell. But I am forced to figure out a way to make a living on my own because the "job market" has made it clear that my 10 years of experience and college degree don't amount to FUCK. I wish this had been explained to me before I spent the 20 years and $20,000

      Don't whine to me about trying to make a living or trying to pay the bills. I've been unemployed for over 12 months within the past 2 years.

      Oh, please. I've been unemployed for three years straight. I couldn't get a job painting shit buckets after watching my "skills" and "experience" lightly dipped in piss batter and skillfully tossed into a shit swamp.

      The job market has found a perfect way to destroy human potential with nothing more than a resume. So that leaves us with somewhat fewer choices. And I'm FUCKING tired of seeing people who work their ASS OFF being called "scam artists" because they set up a cash register somewhere.

      Just because you've got it tough doens't mean you can break the rules.

      "Break the rules." What rules? Who made up the rules? Where can someone refer to them? I think it's "oh, it's got a price tag on it, therefore it's a scam."

      If this person wants to resort to those means, go right ahead.

      WHAT means? He says "here's a book about Assembly programming" and everyone screams "scam artist." It's a crock.

    11. Re:Disclosure: The submitter is the Author. by FreshFunk510 · · Score: 1

      Don't whine to me about trying to make a living or trying to pay the bills. I've been unemployed for over 12 months within the past 2 years. Oh, please. I've been unemployed for three years straight. I couldn't get a job painting shit buckets after watching my "skills" and "experience" lightly dipped in piss batter and skillfully tossed into a shit swamp.

      Perhaps I should've mentioned that I've only been in the work force for 3 years (instead of the 10 you've had to build up savings).

      And I'm FUCKING tired of seeing people who work their ASS OFF being called "scam artists" because they set up a cash register somewhere.

      Look, if you're not johnnyb I really don't see why you're mad at me. If anything you should be mad at HIM because he's trying to get an edge-up on you by promoting his own book on Slashdot. That's one less opportunity for you.

      "Break the rules." What rules? Who made up the rules? Where can someone refer to them? I think it's "oh, it's got a price tag on it, therefore it's a scam."

      Simple. People come here thinking that books that are reviewed are have open, honest and unbiased reviews. Clearly this review is questionably open or honest, and most definitely biased. Why? Umm perhaps because the person writing the review IS ALSO THE FUCKING AUTHOR. C'mon dude. Open your eyes. Quit being so blind. We know it's you johnnyb.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    12. Re:Disclosure: The submitter is the Author. by FreshFunk510 · · Score: 1

      No, it's not complete enough for a review. But he clearly, in the description, is trying to convince the readers to buy his book because "the key difference between mediocre and excellent programmers is whether or not they know assembly language."

      And, no, he didn't post his story AC but he also didn't disclose that he's the author. And, hey, I'm just one person. Everyone else has their right to buy (into) it if they want. I didn't bad mouth him. I simply said I don't buy things that are self-advertised when I find out on my own that the person advertising is also the person who made whatever it is they are selling. It's just principle.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    13. Re:Disclosure: The submitter is the Author. by Anonymous Coward · · Score: 0

      If anything you should be mad at HIM because he's trying to get an edge-up on you by promoting his own book on Slashdot. That's one less opportunity for you.

      Why would I be mad at him or anyone else? He's promoting his book. Good for him. I hope it makes the NY Times Best Seller List. I'm pissed when people look for shit to bitch about.

      People come here thinking that books that are reviewed are have open, honest and unbiased reviews.

      Well, then maybe someone should buy it and review it. Like that barrier to entry? If the guy opens his mouth, he's a biased scam artist. If he doesn't say anything (and nobody buys his book) everyone is happy. Spread the mediocrity.

      We know it's you johnnyb.

      Dude, I don't know who johnnyb is, and I don't know what you're talking about.

      By the way, this article isn't a book review anyway.

    14. Re:Disclosure: The submitter is the Author. by johnnyb · · Score: 1

      I don't see how there would be a conflict of interest, since Slashdot has an editorial review process (even if it is somewhat questionable at times...). My submission was to the editors. They should be able to base their judgment on the content no matter who the author was. Your comments apply to the editors of content, not necessarily to the submitters of it.

      I have no problem saying that I wrote the book, I just thought that the article's worth rested in it's content, not who wrote it. I decided to let the editors decide (and, frankly, was shocked that they posted it - I've posted about 10 stories to Slashdot and this is only the second one that has been posted).

    15. Re:Disclosure: The submitter is the Author. by johnnyb · · Score: 1

      I am sorry you think I am a scam artist. I did not and do not feel that I did anything wrong. My comments should stand by themselves no matter if it was by me, someone else, or an alien just landing on the planet.

      I did not, do not, and don't plan to ever disguise who I am (by the way, how did you find out that I was the author except by the fact that you looked up my user ID?). I don't even spam-hide my email address. I have exactly one Slashdot account, and cannot recall a time I posted anonymously. I just didn't see why who I am affected whether or not the editors liked my article.

    16. Re:Disclosure: The submitter is the Author. by julesh · · Score: 1

      Slashdot has an editorial review process (even if it is somewhat questionable at times...)

      The Slashdot editors generally don't bother to investigate the story they are submitting. They quote the submission verbatim without editing, and frequently without commenting.

      It was a little misleading, to be frank. It really wouldn't have hurt to add a note that you're both author & publisher of this book...

    17. Re:Disclosure: The submitter is the Author. by hesiod · · Score: 1

      The problem some people have is that this site is supposed to be a place for geeks to get news & information, not for someone to peddle his own wares. If someone else were to find your book, say "hey this book is f@#%ing great!" and then write a review, it would be different. Or, if you DO want to advertise, you can buy an ad on the site -- make /. a little money in the process.

      Please keep in mind that this isn't really my opinion, although I understand it. I don't care; I'm not a subscriber, so I haven't paid anything to read this, so the editors can choose to post whatever they want -- it's their site, if I don't like it, I can go read Kuro5hin *shudder, yeah right*.

    18. Re:Disclosure: The submitter is the Author. by infochuck · · Score: 1

      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/

      Not only is he the author, but it seems he's the PUBLISHER, as well! Double-non-disclosure. Booyah!

    19. Re:Disclosure: The submitter is the Author. by johnnyb · · Score: 1

      Thank you for your openness and honesty. I'm still wrestling with this question, and will keep your thoughts in mind. Personally, I don't see that there was something to be disclaimed, but it's obvious that at least some on this board do. Finding what is appropriate in all circumstances is always a hard battle, especially when addressing a crowd as diverse as Slashdot.

      Anyway, I appreciate you taking the time to advise me.

    20. Re:Disclosure: The submitter is the Author. by FreshFunk510 · · Score: 1

      Why would I be mad at him or anyone else? He's promoting his book. Good for him. I hope it makes the NY Times Best Seller List. I'm pissed when people look for shit to bitch about.

      Why should you be mad at him? Because clearly you're angry that the job market is shit. Right? So you should be mad when someone is trying to use the system, unfairly, to their advantage. What about all the other honest people who are trying to write books about Assembly and make a living but don't have a chance to sell it on Slashdot by writing an awesome review about their own book? The question of whether it is a "review" or not doesn't matter either. The point is that it's propaganda.

      You should be mad because there are people out there, like you, who are unemployed so you should be angry that this person is unfairly trying to get a leg-up on you.

      Anyway, if you look at my original comment I was "looking for shit to bitch about". If you seriously think that way you have a serious attitude problem and I really recommend (no joking here) you see a therapist. Obviously you have angst issues.

      Let me remind you what I said: I calmly wrote that Slashdot should write a disclosure in these situations. Did I say people shouldn't advertise their own books? NO. Did I say it was WRONG when they did? NO. I simply said that they should make it known to the readers that they are promoting their own book. PEOPLE DO THIS ALL THE TIME IN ANY INDUSTRY TO MAKE IT FAIR. They do it on news stations, they do it in the media, and they even do it here on Slashdot. They just didnt' do it with this book.

      In case you haven't noticed I have not ONCE written anything against people selling books here. I said that I'm against people who don't disclose their affiliation because it only serves to make people suspect. Really, who can trust a review/propaganda by someone who's also the creator of the work? Shit, we weren't born yesterday.

      If the guy opens his mouth, he's a biased scam artist.

      When you say something is totally awesome and worth buying and you don't reveal that you will benefit from the purchase, then YES he is a "biased scam artist". If you don't realize this I hope you never have to buy a used car.

      Spread the mediocrity.

      Son, in your case it's already been done.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    21. Re:Disclosure: The submitter is the Author. by FreshFunk510 · · Score: 1

      You may be right in terms of my comments applying to the editors. I'll accept that. But the thing is is that I've been reading Slashdot for about 7 years now and, in all this time, I've never heard much about the editorial review process. In fact I really didn't know there was much of one. I thought stories/books/reviews were posted whenever one of the main moderators (the ones who run Slashdot) thought it was interesting.

      That said, there's also no saying of your affiliation with the creators of Slashdot. I don't want to sound like a conspiracy theorist but it happens all the time, especially in media and especially when someone is trying to sell something.

      The article's worth does rest in the content. In this case the worth rests in the content of the book you wrote.

      Personally, I have nothing against you. I don't even know you. In fact I hope your book sells well if it's a good book so that people will become more educated. But I have this same sentiment towards every other person trying to write an assembly book and accomplish the same thing as you. And, because of this, I feel like it should be a fair playing ground. (But I understand that you thought you did nothing wrong. :))

      Anyway, next time this all simply could've been avoided had you noted, in one sentence, that you're also the author. I think people would heed that honesty and actually influence them to take a closer look at your book.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
    22. Re:Disclosure: The submitter is the Author. by FreshFunk510 · · Score: 1

      I don't think you're a scam artist. The other guy was just pushing my buttons with his nonsequiters and it pissed me off. :)

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
  51. Buffer Overflow by Supp0rtLinux · · Score: 1

    I've always wanted to know how a buffer actually works in terms of memory, etc. I just bought a copy. Perhaps I'll graduate to being a real hacker after all...

    1. Re:Buffer Overflow by somatose · · Score: 1

      For all your curious hacking/phreaking desires, try reading http://www.phrack.org. Issue 49 is the one harboring "Smashing the Stack for Fun and Profit." That will guide you through stack-based buffer overflows. There's another article in a later Phrack release that details heap- and static-based overflows. Go to!

  52. Most do require... by Anonymous Coward · · Score: 0

    Most accredited institutions do require atleast two or more semesters being exposed to assembly. I personally learned it at my univeristy (Univ. of Nebraska-Lincoln) during my second semester of college. First semester was basic Java, drawing pretty colored circles, string manipulation, console args, etc. Then moving to basic computer hardware/software interaction with a emphasis on MIPS assembly.
    I couldn't see how one could earn a degree at all without knowing assembly. How do you expect to grasp fully the ins and outs of computer programming in a high-level language without first knowing how all those ints, char and arrays are stored in memory and arithmetic moves around those values stored from processor to coprocessor, ALU, etc.

  53. real men by Anonymous Coward · · Score: 0

    Real men type in opcodes on a hex keypad. These assemblers kids use these days - pfah!

  54. Re:Assembly Language by Anonymous Coward · · Score: 0

    Low as in lower than 50% of the 'unwashed masses.'

    It's like a 102 year old calling a 97 year old a spring chicken.

  55. A nice exercise... by DrCode · · Score: 1

    An interesting thing for programming newbies to do is to write a small piece of code in C or C++, then study the assembly output.

  56. 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.

    1. Re:Great concept. by Oligonicella · · Score: 1

      "Anyone who disagrees with this probably doesn't have much experience coding in assembler to begin with."

      Screw you. I've been at this since the late 60's. Coding in assembler is fine for tinie, winie stuff, not applications which accomplish most of the world's functionality.

      "It also means...you'll have an understanding..."

      Maybe *you* needed it, but *I* didn't and don't.

    2. Re:Great concept. by tjb · · Score: 1

      Screw you. I've been at this since the late 60's. Coding in assembler is fine for tinie, winie stuff, not applications which accomplish most of the world's functionality

      Oh really?

      How about the computer that makes your car engine work efficiently? Assembly.

      The physical layer of virtually every communications device on the planet? Assembly.

      Avionics systems? Quite a bit of assembly.

      Higher level languages have their place - I use Matlab and C extensively - but in any system that is competing on cost (like modems) or has size/weight/power constraints (avionics, engines) assembly is the language of choice for production because it uses less silicon to get the same result.

      Oh, and the guys writing the compilers had better have a good grasp of assembly as well if they plan on making decent optimizations.

      Tim

    3. Re:Great concept. by Anonymous Coward · · Score: 0
      Tim,

      I'm not on the 'screw you' level, but I think you'll find that most of your counterexamples are actually coded in C in real life - I happen to have been involved with the coding for sattelite phones, and it was in C++ - similarly, most automotive systems ar programmed in C (or even Java, lately), since the cost of memory has come down to the level that efficient code makes no sense.

      I applaud you for your championing of assember, but view it similarly to my view on Latin - it's worth knowing, but not much use today.

  57. Bah by be-fan · · Score: 1

    A computer scientist doesn't necessarily know anything about computers. Computer science is about the theories of computation, not about the details of programming.

    Now, there is a certain benefit to knowing how the computer works at a low level, but its becoming less and less important. Especially considering that x86 assembly is completely different from how the CPU actually works at the lowest levels! I'd be much happier with a programmer who had a good grasp of the abstract theories of computation and didn't understand hardware at a low level, than one whose knowledge was the other way around.

    --
    A deep unwavering belief is a sure sign you're missing something...
    1. Re:Bah by netsharc · · Score: 1

      I think the ueber-CS-student should understand how Turing machines work and by extension would be able to understand how an implementation of it, in the form of programability upto the lowest level) works.

      --
      What time is it/will be over there? Check with my iPhone app!
    2. Re:Bah by be-fan · · Score: 1

      Yes, ideally, they'd understand both. But I was saying that I'd give more credit to having a good understanding of the high-level than the low-level.

      --
      A deep unwavering belief is a sure sign you're missing something...
    3. Re:Bah by Autonomous+Coword · · Score: 1

      Reminds me of the Edsgar Dijkstra quote: "Computer science is as much about computers as astronomy is about telescopes"

    4. Re:Bah by corngrower · · Score: 1

      A computer scientist doesn't necessarily know anything about computers.

      You can say that again. I've met more than a few of these during my programming career. They can screw up even a simple project so that it ends in failure.

    5. Re:Bah by be-fan · · Score: 1

      A computer scientist, the term used by the article author, is not necessarily a programmer.

      --
      A deep unwavering belief is a sure sign you're missing something...
  58. Believe it! by mgrennan · · Score: 1
    I'm one of those "Wizards". My first computer was a 4004. All I had was assembler. Today my resume reads "And me the right chips and I'll hand you back a general ledger."

    After owning my own computer company several years creating ZDOS (an OS) for Micronics Systems. I went to work for someone else and I was shocked to learn how little the programmers know about the systems they wrote for.

    I think besides learning assembler real programmers should design, or at least interface, a little hardware.

    --
    There are 10 type of people in the world, those who understand binary and those who don't.
  59. im taking asm right now... by drwhite · · Score: 1

    I am taking an intro course on asm and I am confused as hell...I started out w/ c++, then cobol(shudder) and now assembley...the book we r using is horrible plus we are using assembley on windowz...

  60. Grounding in the basics by Ra5pu7in · · Score: 1

    What's so amazing and revolutionary about this? Of course those cheap "get a degree in computer science" curriculums teach only specific languages at the expense of putting out truly capable programmers. But many regular colleges and universities have had more complete studies including assembly language all along.

    The only real positive I can see in this - a lessened dependence on the OS and pre-developed libraries to do all the work for them.

    --
    I was taking one day at a time, but then several days got together and ambushed me. (from a Rhymes with Orange comic)
  61. Assembly language is still relevant today by mpthompson · · Score: 1

    I learned 6809 assembly language on a TRS-80 Color Computer as a kid back around 1978 and I feel that an early start in understanding CPUs from the ground up has given me a leg up on many of my peers over the years. 25 years later I can still tell the difference between programmers who have a basic understanding of how assembly language relates to CPUs and higher level languages and those who don't. It may not make much of a difference when writing Perl scripts or Java apps, but it makes a world of difference in being able to write robust and efficient C code.

  62. self published, no review? Do not buy this book!! by Anonymous Coward · · Score: 0

    There is no review here of an unread unreviewed book. This whole article is a sham. Do not buy this book. This book is the submitter's self published ego project!! Warning!!

  63. Assembly has got nothing to do with cs by Erik+Hensema · · Score: 1

    Assembly programming is almost hardware programming. If you want to learn about programming real computer programs, you'll have to learn about algorithms. And algorithms are best implemented in higher level languages. Assembly is only used when all other options fail.

    --

    This is your sig. There are thousands more, but this one is yours.

    1. Re:Assembly has got nothing to do with cs by Anonymous Coward · · Score: 0

      But if all other options =do= fail, and they will, on what knowledge will you fall back? How can you debug if you don't understand the hardware on which you are working?

  64. Back in my day... by Colonel+Cholling · · Score: 1

    I can hear my dad now: "We didn't have these fancy-schmancy high-level programming languages... sure, there was FORTRAN, but that was just for the wimps who couldn't handle real programming. When I was your age I wrote assembly programs on punched cards, and it took three days just to feed "Hello, World" into the card reader. I had to push an IBM 360 uphill to and from work everyday in a snowstorm. Kids these days with their VisualBASIC and their HTML, they don't know what real programming was."

    I'm glad to see this. Today's web-server script kiddies won't have anything to be curmudgeonly about unless they learn to go under the hood.

    --

    I am Sartre of the Borg. Existence is futile.
  65. 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
  66. Depends on your needs by el-spectre · · Score: 1

    Whether or not you need to know assembly depends largely on your needs. May folks, such as web developers, never get really low level, so its not a needed skill. For us we rarely get closer to the hardware (or OS for that matter) than a high level language.

    Java/Perl/C++/etc. are more or less cross platform... we're not tied to a specific architecture.

    --
    "Faith: Belief without evidence in what is told by one who speaks without knowledge, of things without parallel." - A.B.
  67. 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.

  68. Ah, the good old days... by bennomatic · · Score: 1
    I remember writing assembly for my C64 when I determined that BASIC was just too darned slow for me. What's scary is that I got good enough at understanding the underlying binary code that I was able to detect a bug when typing in a machine language program from Compute's Gazette; I recognized the numeric pattern of a command that just did not make sense in one line out of hundreds in a program which just would not run as published.

    Any of you old C64 wonks remember what the following code would translate to? $20 $D2 $FF

    What would that do on a C64?

    So I say, forget assembler; it's too high level. Make those kids flip bits, for g'd's sake!

    --
    The CB App. What's your 20?
    1. Re:Ah, the good old days... by maxwell+demon · · Score: 1

      Where did machine code go on the C64?

      I got my first machine code experience on a ZX81 (with a very Hex-friendly charset: "A" came directly after "9" :-)). There machine code was usually put in a REM line at the beginning of a BASIC program (that way you could save it with the program). I still know the address of the first usable byte: 16514.

      Later I learned abut another possibility: There was a system variable (i.e. memory location) where the ZX81 stored the end of memory. You could poke it to a lower value and then do a NEW (the ZX81 equivalent of a reboot). Then that memory was "unknown" to the ZX81 and could freely be used for machine code. It even survived NEW (but of course not switching off power :-))

      --
      The Tao of math: The numbers you can count are not the real numbers.
    2. Re:Ah, the good old days... by bennomatic · · Score: 1
      There was about 4k that was guaranteed untouched by the system at $C000 (49152). But since the darn thing wasn't a multi-tasker, you could put machine code anywhere that didn't have a purpose. There were some special locations down near the bottom: I think the text screen was 1K starting at 1024.

      IIRC, the region just below $C000 was where the fonts were stored, and the region just above was "underneath" the ROM image of the BASIC OS. When the machine was booted, the OS was copied from ROM to RAM, and it was possible to modify the OS and restart, or modify the fonts, etc. It was also possible to do all this by accident, something I did often.

      $20 $D2 $FF, just to follow up was "jsr $FFD2", a Jump to SubRoutine which was the part of the kernel that printed whatever byte that was currently in the accumulator into whatever slot the cursor was currently in on the screen.

      --
      The CB App. What's your 20?
    3. Re:Ah, the good old days... by laejoh · · Score: 0

      Aah... good old RAMTOP (16388 and 16389)

      PRINT PEEK 16388+256*PEEK 16389

      Memories!

    4. Re:Ah, the good old days... by MonTemplar · · Score: 1

      Waitaminute! You wrote machine code on a ZX81? There's only one way you could have done that,

      Most. Stable. Work. Surface. EVAR! :-)

      [Your RAM-pack wobbled. Start again!)

      I got my first taste of machine code on the BBC Micro (6502). Helped that you could get books from Acorn with all the details of the OS system calls, memory organisation, and I/O ports. And all the more fun if, like me, you had the 6502 co-processor box. (Yep, dual-CPU computing circa 1984!)

      More recently, I've done x86 programming using Turbo Assembler to write software for PC-based tape and CD duplicators. Biggest problem was being stuck with those blasted segments! :(

      -MT.

      --
      -MT.
    5. Re:Ah, the good old days... by Anonymous Coward · · Score: 0

      Well, on my ZX81, the RAM pack was quite stable. I think it wasn't original Sinclair but third party.

      However, successfully saving on tape and later reloading was a problem.

      BTW, the ZX Spectrum (and possibly the ZX81 also) had even the possibility to do floating point in machine code: One of the rst's (I don't remember which) went into a floating point stack machine which started to read and interpret the following bytes as FP instructions, until it got to an end instruction from where it returned to normal Z80 machine code (i.e. the rst returned to the next byte after the FP end "instruction" instead to directly after the rst). I haven't really used this possibility, though.

      I don't know the BBC Micro. Does it have any relation to the BBC broadcasting company?

    6. Re:Ah, the good old days... by maxwell+demon · · Score: 1

      Oops, I didn't mean to post this as AC. Slashdot should warn you if you start writing your comment logged-in and then get auto-logged out before sending it :-(

      --
      The Tao of math: The numbers you can count are not the real numbers.
    7. Re:Ah, the good old days... by MonTemplar · · Score: 1

      I don't know the BBC Micro. Does it have any relation to the BBC broadcasting company?

      It certainly does. A potted history of how the BBC Micro came to be can be found here.

      -MT.

      --
      -MT.
  69. You'd be better off teaching them to speak Indian by Anonymous Coward · · Score: 0

    More chance of employment that way

  70. MOD PARENT UP by Anonymous Coward · · Score: 0

    kthx.

  71. Pish posh by Anonymous Coward · · Score: 0

    This is why the old-timers are often viewed as 'wizards': they had to know assembly language programming.

    All the "old-timers" I've ever worked with held complete contempt for us wacky kids and our crazy, new "fads" like OOP that would surely fade away and everyone would go back to COBOL and fortran like they did it in the "old days".

  72. Re:Assembly Language by fiannaFailMan · · Score: 1

    I'd imagine it's like learning Latin, and armed with that knowledge you then find it easier to learn modern European languages since that's what most of them evolved from.

    I'm a great believer in the idea that no knowledge is wasted and that learning specific skills is no guarentee that you'll be any good at a particular task. I found it easy to pick up programming at school thanks to me programming BASIC on a Sinclair ZX80 at home years before. I found it easy to pick up Spanish and French because compared to learning Irish, Spanish and French are dead ringers for English!

    I have zero experience with assembly language, but it's something I'd love to be able to do.

    --
    Drill baby drill - on Mars
  73. Am I that old? by Anonymous Coward · · Score: 1, Informative

    Have things changed that much since I graduated in 1999? Can you really get a degree in computer science without at least one course dealing with assembly?

    I know we had one course on computer hardware and assembly. There were at least one or two others that touched on the subject. It wasn't much but it was something.

    Knowing assembler doesn't help me too much at work where I am forced to write in VB6. It does help a lot with my projects at home that use microcontrollers. In that invironment, even if you can use C, you still need to know a lot about the hardware you are working with.

    1. Re:Am I that old? by RAMMS+EIN · · Score: 1

      ``Knowing assembler doesn't help me too much at work where I am forced to write in VB6.''

      Does anything help you to code in VB?

      --
      Please correct me if I got my facts wrong.
    2. Re:Am I that old? by rewt66 · · Score: 1
      A lobotomy?


      (ducks and runs...)

    3. Re:Am I that old? by BigBadBri · · Score: 1
      Does anything help you to code in VB?

      That, I believe, is what drugs were invented for.

      As the song by Jeremy Taylor goes...

      I smoke a lot of pot
      It helps me to keep sane
      I sometimes have a shot of cocaine

      Just a little puff
      Helps me to unwind
      But if I have enough, it really blows my mind

      --
      oh brave new world, that has such people in it!
  74. Loughborough Uni UK by Anonymous Coward · · Score: 1, Informative

    Here in Loughborough, on my course, it is one of the first things that you learn, after that you are introduced to C and Java, ofcourse I had knowledge of those before but some had their first taste of programming with assembler.

    Only straight computer science learnt assembler, however. Computer science with Business were learning VB, and didn't even look at c or java and I think that is wrong! Do u? :(

    Jimbob

  75. CS Fundamentals by ElDuque · · Score: 1



    Everyone here is talking about CS fundamentals this and that...I don't know what assembly is.

    College students should be taught CS basics like MP5 usage, burst firing, and not to camp.

  76. Buffer Overflows Explained by Anonymous Coward · · Score: 1, Informative

    http://www.cse.msu.edu/~miscisi2/security/pages/ex ploits/overflows.htm

  77. Not language choice, but lack of design/structures by neutron2000 · · Score: 1

    I feel (fairly strongly) that if a person hasn't programmed before they should first be taught an interpreted "write it, run it, no hassles" language like Scheme, say.

    Get the basics of structures and design down first in a language that's trivial to understand and highly interactive, whatever it is.

    While I guess I'm an oldbie (*sigh*), I don't think too many people need to know assembly any more, how the MMU works, etc.

    Can it help? Of course--as with anything, the more you know, the better off you are. But I'll take a well-trained Java programmer that doesn't even know assembly exists before I take a crappy coder that has memorized the x86 instruction set.

    They need to know how to _code_ and the web/MS jockies I see coming out of school now, in large part, can't.

    Dave

  78. I don't know about CS by Valar · · Score: 1

    But in EE, our first programing assignments were in binary. That's right. Ones and zeros. Then, as favor to us, they started letting us use an assembler. Wow, how thoughtful :)

    Seriously, though, I know of a lot of CS departments that don't teach memory management at all until third year. Up to that point, they use languages with garbage collection and say 'and then, when you are done, your memory just disappears. Magic.' That's not even the least helpful part. Most of the those languages have classes for just about any ADT you can think of, so no one has to write one themselves (which leads to questions in embedded programming/operating systems classes like "How do you create a hash table object in C?")...

  79. Further down we go.... by sheapshearer · · Score: 0

    When I took computer science, we learend Pascal, and a little bit of the art of structured, procedure-driven programming. Unfortunely, in high school 'ADT' only meant an alarm company. Then in college, we learned C. Again more procedure driven stuff. Sometime before I graduated, a teacher taught us C++. Needless to say, our programs weren't very object oriented, nor were they required to be so. The algorithms class we took (also in C), was also extremely lacking, and 'ADT' only became a fuzzy word for doing a lot of extra typing that didn't make sense. Unlike most of my classmates, I knew assembly language for several platforms already. This being said, if you start out, introducing people to programming with assembly language, most people will quit and become liberal arts majors. The few that do continue, may be able to make the jump to a procedure oriented language AND be able to trust what the compiler does behind their back. Those that don't even think about the compiler's affairs are highly suspect... They are really going to be baffled by object-oriented programming. Transistioning from the world of goto's, subroutines, and jump tables to virtual methods and multiple inheritance. This being said, what should be done is to teach assembly language in parallel with something like C. That way, people get a feel for the timing of things -- why floating point arithmetic is slower than integer arithemetic, why sequentially reading arrays is faster than linked-lists, etc. More emphasis also needs to be put on the operation of the memory and disk caches (for data structures), operating system scheduling (multi-threaded apps), and overhead of system calls. Imagine the horrors that someone would produce if they transistioned directly from assembly language to an object-oriented language! -- one class, one method, one program!

  80. Assembly vs. compiler speed by Debian+Troll's+Best · · Score: 0, Troll
    For the purposes of teaching computer architecture, assembly language may be just the ticket. But out there in the 'real world', assembly language is usually limited to 'embedded' type systems, and for small sections of absolutely performance critical code where a developer must make use of absolutely every last CPU feature and nuance to really wring extra oomph from their code. However, with a fresh crop of graduate students becoming more familiar with assembly, might we see a return to the 'good old days' where a lot more software was developed in assembler? Could anyone foresee a day when a major open source project, such as the Linux kernel or Apache, is recoded in assembly to really boost overall performance beyond those levels able to be achieved by compilers such as gcc? I for one would love to see an MMX/SSE optimized version of apt-get built in hand-tuned x86 assembler...vectorization of package installs would be the killer app for me.

    Could anyone comment on the use of assembly in major open source projects? Is there any now? Will its use increase to take advantage of vector units and the like? What about cross-platform assembler? Could we one day see an assembly dialect with the traditional 'raw' access to the machine which hard core developers love, coupled with a Java-like virtual machine for cross platform compatibility? I look forward to the community's response!

  81. I am not quite dead yet - sir. by northwind · · Score: 1

    I refuse to be an old-timer just because I know several flavors of ASM (Z80,masm,29K,PPC).
    What will the next be? That we can recognize a computer 8 out of 10 times....Geez
    Nobody expects the Spanish Inquisition (except the spelling control)

  82. 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.
    3. Re:MIXAL by red+floyd · · Score: 1

      Damn! You're right. Didn't have my copy of AoCP available to check it.

      --
      The only reason we have the rights we have is that people just like us died to gain those rights. -- Cheerio Boy
  83. Yes, hardly a new concept by Flexagon · · Score: 1

    Fundamental Algorithms, volume 1 of Knuth's well-known series, handled nearly all of the programming exercises in MIX, his "virtual" assembly language that modeled capabilities on a variety of real processors. There were and are a variety of simulators for it.

    Another one is this relic I have on my bookshelf: cardiac, "A cardboard illustrative aid to computation", by David Hagelbarger and Saul Fingerman of Bell Telephone Laboratories. It's literally a cardboard "computer" on which you write decimal instructions, move sliders around for addressing and opcodes, and use a cardboard "bug" (a ladybug) as the PC.

  84. 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 Wumpus · · Score: 1

      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.

      And this is what made it so much fun! Where's the challenge when you have a large register file, where instructions can use any register they damn well please, and you don't have a stack based FPU thrown in for good measure?

      The Pentium Classic was a fun CPU to optimize for. I recommend that anyone read Inner Loops, by Rick Booth, for a taste of what a capable programmer could do with this ugly architecture. If you can find a copy, of course.

    2. 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
    3. Re:X86??? OMG that sucks... by SJS · · Score: 1
      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.
      You can get worse, but it's right down there at the bottom among the "successful" CPUs. I'm convinced that learning x86 assembly too early will warp and twist your mind enough to permanently damage your judgement.
      Is it just me???
      You're not alone.
      --
      Pick One: http://www-rohan.sdsu.edu/~stremler/sigs/sigs.html (Note - disable Javascript first!)
    4. Re:X86??? OMG that sucks... by zhenlin · · Score: 1

      You have yet to encounter extreme-RISC instruction sets, I take it then.

      There is the subtract-and-branch-if-negative variant, that is probably much more painful than the x86.

      For systems programming, x86 is horrible. But for applications programming, it is OK. Application programmers don't have to fret over the insane layout of a GDT entry, or the virtual-physical address mode, or the A20 line, or the privillege ring, etc. Then again, with only 8 general purpose registers, it could be considered more difficult.

      Still, I believe a load-store (RISC-style) system architecture with a large register file (at least 32, of each type, or 64 if registers are orthogonal in use) is easier to program in.

    5. Re:X86??? OMG that sucks... by julesh · · Score: 1

      Just to pick nits - the A20 line debacle has nothing to do with the processor; it was IBM's ridiculous design flaw introduced to make the PC/AT backwards compatible with the PC/XT.

      How many programs assumed they could address 0000:x at ffff:x+10h I don't know, but I assume there must have been some otherwise they wouldn't have done it...

  85. Assembly... by thomas536 · · Score: 1

    is that a new object oriented language?

  86. Hear hear! by gerardrj · · Score: 1

    I agree. Teach these kids the differnce between a shift and rotate, make them understand what the CPU is actually doing.

    To those saying that time would be better spent learning higher level languages better or that development is faster/easier with C*, Java, etc, you're missing the point ot the article. He's not suggesting that more people program in assembly instead of higher level stuff, but that knowing assembly will allow people to program better in the higher level languages.
    Yes the compiler and assembler will make a lot of optimizations for you, but you likely could enhance the application's performance by making small changes to your code that aren't apparent unless you really understand how your processor does what it does.

    Most modern languages allow you to embed or link to assembly code, so you could have the best of both worlds, ease and speed ot high-level development with the speed and efficiency of assembly.

    --
    Article X: The powers not delegated... by the Constitution...are reserved...to the people
  87. Bah. by ProtonMotiveForce · · Score: 1

    There's nothing, absolutely nothing, that can be taught in assembler that can't be tought in e.g. C. And C is at least useful in your future life as a burger flip...I mean computer programmer.

    They should start with C, which is good at teaching basic procedural programming, move to Java, then go back to assembler to teach the student all the details that were glossed over in those other languages (e.g. what is a pointer really? What is the "stack"?).

    I loved assembler back when I was like 18-19 and you used to have to write MSDOS viruses in assembler with int 21 hooks etc... But otherwise it's a small subset of people that really need to know it, and it's easy enough to learn.

  88. The concepts in assembly can help by K.B.Zod · · Score: 1

    I was a teaching assistant for an undergraduate course in assembly language. (We happened to use the MC68000 as the processor, with those nifty little test boards hooked to dumb terminals for entering and running your code.) This was in the mid 90's. I still vividly remember trying to teach the multitude of indirect addressing modes that the MC68000 offers, like indirect, indirect indexed, etc., etc. By and large, the students, mostly second and third year computer science and EE majors, had a real rough time getting the hang of all of it. I tried to draw analogies with the way C pointer arithmetic works, but they were never taught pointers in their C++ course. I was pretty horrified at that. Like you can do anything in C++ beyond the basics without understanding machine addressing.

    Of course, the ones who had some experience with lower-level languages knew what I was talking about and had no problem with the concepts. They also tended to be the best performers and, in my opinion, seemed best cut out for the career they were aspiring to. I guess my point is that hardcode assembly may not be important in the very beginning, but I agree that being exposed to it can really help you understand how processors work, and I think can make you a better overall coder. The things you learn down low can't help but pay off when you get to the higher levels, because you can see why things up there are how they are.

  89. It's how I did it by Gyorg_Lavode · · Score: 1

    In college the Comp Sci's had to take assembly. (I took it for fun. Yeah. Fuh.) They spent a bit oh assembly, but much more time on computer and processor structure.

    --
    I do security
  90. why stop at assembly by ch-chuck · · Score: 1

    real EE's learn not only that but machine language, instruction decoding and control of sequential logic machines at the register transfer level, memory elements and logic gates, how transistors and CMOS works, the quantum physics and electrical properties of semiconductors as well as pulse signal propagation, transmission lines and impedances, etc.

    --
    try { do() || do_not(); } catch (JediException err) { yoda(err); }
  91. I'm not sure I buy that. by mindstrm · · Score: 1

    Though this sounds really interesting to me personally...

    I understand assembly language. I understand how the computer works on it's lowest levels, more so than most programmers I've met.

    Does that make me a good programmer? Hell no..at least not in anything other than assembly.

    Now.. learning some assembly and some low level stuff is GOOD for a programmer to know, to really understand what's up and take away the magic black box.... but it won't make you a good programmer.

    It doens't help me understand, say, java.
    Or C++.

    IT does make C and pointers a bit easier to understand.. as well as things like memory allocation.. but other than that, nope.

  92. 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

  93. 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.

    1. Re:emulator by Anonymous Coward · · Score: 0

      Ha. I forget the random course number, but Computer Organization at UB involves dabbling in MIPS assembly using SPIM to run the code. "1/25th the performance at none of the cost!" Heh.

    2. Re:emulator by Anonymous Coward · · Score: 0

      yes ... as psychiatrists.

  94. My high scoll curriclulum by tickticker · · Score: 1

    Back in the day (mid-80s), our computer curriculum went like this:

    1. Machine language (hex coding)
    2. Assembly
    3. Pascal
    4. There was no 4

    If you ask me, even though I didn't go into programming, by taking these courses (and understanding them) I am a better systems engineer, because I do know the low level stuff, and how that affects the systems I'm working on, be it infrastructure, network OS, or client side.

    (bad metaphor) It's like cars. There are end users who get stuck on the side of the road. High level programmers who can work on their cars and even put one together. Then there are the low level programmers, who can make a sweet car, know the mechanical tolerances and even do some under the hood innovations. A good mechanic can put an engine together, a great mechanic can pick the materials and the molds and work on indy cars.(/bad metaphor)

    --

    My sig sees you

  95. Elitist crap by alphorn · · Score: 1

    Most great programmers today have learned assembly - but that's just because they're older and assembly made more sense in the past. But that's no reason to look down on programmers who don't know it.

    I know assembly and it has zero influence on my programming style. It's even quite impossible to use modern languages like PHP and java in an assembly (un)friendly way. Algorithms are what counts.

    Of course there is a very small very high performance niche for assembly, but that's not what this book it promoted for.

  96. Predictors of success for programmers by Anonymous Coward · · Score: 0

    I agree with the premise that machine language knowledge makes a fundamentally better programmer.

    But it's only one of many factors to consider. As a predictor of success, there might be a stronger correlation with having a background in math.

    Try googling for "programmer" and "predictor of success". Quite a few papers turn up.

  97. Why should programming training differ... by riprjak · · Score: 1

    ...from training *Real* (read Mechanical) engineers.

    You begin with the basics; (drawing, CAD modelling, math, physics, fluid and thermodynamics) and then you move up to applying these techniques to more and more complex systems until you peak with project management, limit state design etc. Essentially you learn the fundementals, then learn how the tools are designed and built, then how the tools work then how to use the tools; now you know how to create solutions to problems no-one else has ever encountered because you understand the cause, not just the effect.

    I firmly agree that the only way to teach something is to start with the foundations and move up; although to critique all the programmers I know, they could benefit from a LOT more mathematics, particularly in the areas of numerical methods and non-linear differential equations.

    Teach people how to solve abstracted problems (ie: simply make on-paper mathematical soultions to problems); teach them how computers *actually* work and then teach them about how the tools (HLLs) are built and work; let them make their own choices from there. Why should a class teach "C++", shouldn't it teach object oriented programming and let students select which tool they feel is most appropriate??

    Hell, somethings are better done in Perl than C++, C++ than Fortran, Fortran than assembler, machine code; if you aren't trained to understand *HOW* tools work, you will never be able select the correct tool for a job or even design better tools. More importantly, if your training focusses on a specific tool or brand of tools, you wont know how they all work.

    Case in point, I, a mechatronic engineer, know far more languages than any one of my comp-sci/programming mates but still use them equally well, because I was taught not how to use a specific language but how to solve problems, the languages I taught myself since I already understood *how* they worked; I knew the grammar, I just needed the dictionary as such.

    Anyway, enough rambling...
    err!
    jak

  98. Forget Computer Science! by zoney_ie · · Score: 1, Troll

    Forget Computer Science, Computer Engineering is the way to go.

    First year starting with Digital circuitry, electrical stuff, engineering maths, heck, even physics. And concurrently? Teaching us how to program (not a programming language) with Pascal.
    --- Follow on to Object Orientated programming, a dash of graphics programming - all concurrent with more digital stuff (onto microcontrollers etc) and micro-controller assembly language. More horrific calculus. --- Onto Operating System architecture, file systems, software engineering (UML and all that horror), Hardware Description Languages. Oh yes, telecomms, networks, etc. --- Language Processors (compilers, parsing, etc.), Artificial Intelligence. More networking. Computer Architecture.

    That's some stuff - I've left out a lot. Not bad for 4 years. Basically everything from how semiconductors work and electrical circuitry, and most steps through to high level software design and object orientated programming. Plenty of side routes too like Digital circuit design, microcontrollers and using HDLs.

    It's all been good bar the calculus. Oh, and the UML stuff - i.e. waffle for waffle's sake.

    --
    -- *~()____) This message will self-destruct in 5 seconds...
    1. 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.
    2. Re:Forget Computer Science! by madcow_ucsb · · Score: 1

      Yes yes yes! CEs represent.

      There was no more satisfying moment in college than getting the MP3 player board I'd designed back from the fab, powering it up and being able to use the bootloader in the flash to load on its first test app (a basic shell running over the serial port). Except maybe when we finally got all the firmware working...

      After doing that I really felt prepared to dive into the real world. And so far I can say that my UCSB education that everyone loves to make fun of is serving me quite well.

    3. 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.

    4. Re:Forget Computer Science! by blueworld · · Score: 1

      Wow. The Computer Science/Software Engineering program at my school requires 15 comp sci courses, 6 math courses, and 3 physics courses. The Computer Engineering program is actually a specialization within EE, requires and 4 comp sci courses, 12 EE courses, 8 math classes, 3 physics, and one mechanical engineering. So on the whole, only about 2/3 of the classes overlap. And of course, add up the credits in these degree programs and you will get 175 to 185 credits required, out of the 180 credits required for graduation.

    5. Re:Forget Computer Science! by sewagemaster · · Score: 1

      i agree with you.

      it's like people calling themselves software engineers...
      every computer science major's start calling themselves that.

      so not only are they computer scientists, they're now promoted to engineers.

    6. 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.

    7. Re:Forget Computer Science! by sydb · · Score: 1

      Language theory is linguistics.

      Complexity theory is mathematics.

      The study of mental phenomena is psychology.

      'Attempting to find algorithems' is 'problem solving'.

      Numerical simulation is modelling - part of mathematics.

      Computer Science is a pick'n'mix - precisely because it is not a science, but a discipline built on top of many sciences.

      Using your logic I can study the way people prepare food and call it domestic science. Oh wait...

      --
      Yours Sincerely, Michael.
    8. Re:Forget Computer Science! by Sumocide · · Score: 1

      Bzzt, wrong. Your definition is that of the natural sciences, while math and CS are structural sciences.

    9. Re:Forget Computer Science! by Anonymous Coward · · Score: 0

      What nonsense. I work in computer games and a major part of my job (I'm low-level and senior) is to perform experiments against pieces of hardware (game consoles) to empirically determine models of their operation. It's real science, and it takes real scientific discipline. Of course, the "maker" of the machine is a person, not God, but in either case, without blueprints, scientific investigation is your only option.

      Furthermore, what about heuristics? These are not logical, nor proven in a mathematical sense. They are much more akin to statistical scientific knowledge than hardcore logical fact.

      To say computing is not science is to take a specific view of computing and say something blindingly obvious about that limited view. It's not true in a broad sense. It's a very unscientific statement :-)

    10. Re:Forget Computer Science! by Kardamon · · Score: 1
      Maths is a branch of logic.

      Hilbert's program on the consistency of mathematics was based on this idea that math is logic. The same goes for Frege's "Begriffschrift" and Russel's/Whitehead's "Principia Mathematica".

      Goedel's theorem "on formally undecidable propositions" ended the Hilbert program by proving (inter alia) that math cannot be reduced to logic.

      --
      -- Qu'est-ce que la propriété intellectuelle? It is thought control.
    11. Re:Forget Computer Science! by Perl-Pusher · · Score: 1

      Our CE & CS are both part of the 'Physics and Computer Science' department. They were actually alot harder on CS than other colleges, requiring higher math and physics then many colleges do. Many colleges allow "calculus for business" and 2 semesters of general science for CS. The CE degree is ABET accredited, but the university does not have an EE major. So I'm sure they really only meet the minimum for CE accredidation. They also only require 136 minimum credits for CE and 120 minimum for CS.

  99. Intermediate course by Anonymous Coward · · Score: 0

    Why don't they teach Brainfuck at first ? Not so far from asm, not so far from a "real" language. Oh, well...

    Do you wanna say "Hello World" ?

  100. You know are a wizard... by sleepingsquirrel · · Score: 1

    ...when you can contribute to a project like Verified-L4. Where they're applying formal verification to a 2nd generation microkernel. I'd say that pretty much covers the territory from bare-metal up throught theoretical math.

  101. Abstraction by tttonyyy · · Score: 1
    Well, I'd have to agree and disagree on that one.

    Knowing some assembler is great if you're programming embedded microcontroller applications where every cycle counts (for example, programming PICs). But when it comes to large scale processors it's almost entirely irrelevent, mainly because of their incredible comparative speed and complexity. While it's easy to optimise assembler for a simple PIC, optimising assembler for an Athlon XP would be mind-blowingly complicated, and hence best left to compilers. C translates fairly easily into assembler - most embedded software engineers can visualise how to implement for, while, if etc. constructs in assember. C just saves a lot of time and effort. "Computer Science" is all about layers of abstraction - there really is no need to understand every little detail in order to implement a modern application. Only us nerds take pleasure in knowing-it-all (tm).

    --
    biopowered.co.uk - catalytically cracking triglycerides for home automotive use since 2008. Just say no to big oil!
  102. double-edged sword by ummit · · Score: 1
    It's true that knowing assembler is a boon to really understanding how the machine works, and therefore to writing better code. Unfortunately, it's also a boon to knowing too much about how the machine works, tempting you to write overly machine-specific, nonportable code.

    Some days it's seemed to me that there's so much unnecessarily machine-specific code about (i.e. that so many programmers have succumbed to the temptation) that learning assembler should be discouraged. Other days it seems that you're doomed to writing cripplingly inefficient bloatware if all you know is a handholding HLL. Striking the right balance -- knowing the innards, but using that knowledge only for good, not evil -- is tough.

  103. 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.

    1. Re:It depends where you want to go in CS by Anonymous Coward · · Score: 0

      "There are a million fields in CS-- "

      • Burger flipping
      • Retail assistant
      • Car wash monkey
      • Toaster repair engineer
      The list goes on and on...
  104. Tail Wagging Hound? by TexVex · · Score: 1
    I've found that the key difference between mediocre and excellent programmers is whether or not they know assembly language.
    So, the question is, does learning assembly make you a better programmer, or do better programmers tend to learn assembly?

    I submit that the latter is the case. In this day and age, "programming" is rapidly giving way to "software engineering". Software engineering is about your development process, which includes requirements gathering, prototyping, technical design, implementation, peer review, and finalization. What you want out of a good programmer is the ability to write standards-compliant code that meets the specified requirements. The good programmer needs to know his libraries and be able to apply the correct algorithm for each particular situation (i.e. use the STL instead of re-inventing the wheel constantly).

    I also say that cross-platform software engineering is becoming more important. Assembly is not nearly so cross-platform as practically any high level language you care to mention. Assembly is also not object-oriented.

    A good programmer picks up new languages easily, because programming is all about breaking a task down into steps and implementing each step. The process -- the required understanding of logic and math, the ability to translate a requirement into the steps software must execute in order to meet that requirement -- is what the programmer needs. By all means, include assembly language in the curriculum. But educate them top-down, not bottom-up.
    --
    Fun with Anagarams! LADS HOST, SHALT DOS. HAS DOLTS. AD SLOTHS, HATS SOLD. ASS HO, LTD.
  105. 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.
  106. Re:Assembly Language by mrcparker · · Score: 1

    I took a few years of Latin (forced by my school) and I can say that it was one of the most useless classes I ever had to sit through. While it might be interesting to someone studying languages, I am convinced that it is used to make parents feel like their children are getting a better education from their expensive private school. Teach spanish - people actually know what the language sounds like and it is useful.

    I pretty much think the same way about assembly. For someone who really wants to understand how a computer works - great. For most of the developers out there who are going to be writing desktop or web applications it is overkill. Learn data structures.

  107. 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

  108. Re:Assembly Language by AJWM · · Score: 1

    That's not a low ID. This (19027) is a low ID.

    (I know, there's still lots lower than that. That's what I get for lurking so long before registering.)

    --
    -- Alastair
  109. 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?
  110. 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

    1. Re:Languages I sudied for my CS degree... by Peyna · · Score: 1

      1st Year: Introductory CS courses, Calculus, Advanced Programming
      2nd Year: Systems Programming, Discrete Math, Programming Languages, Data Structures
      3rd Year: Computer Architecture, Operating Systems, Automata and Formal Languages + CS electives
      4th Year: Software Engineering, Senior Project + CS electives.

      I probably missed a few things, but you get the general picture.

      --
      What?
  111. 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.

  112. 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.

    1. Re:Ugh... x86 by kyoko21 · · Score: 1

      Yeah. I aggree. Pick up something simple and start from there. There are a lot of simple ASM that actually can do a lot, like the Motorola 68HC11 (hooray tech writing from VT) which even has an onboard Digital to Analog converter which has a lot of applications. Then after you are comfortable, you can move up to X86... then if you are real good... go into protected mode! Oooooo....swapping and paging... in assembly :-) Now that's where the real fun is.

  113. Assembler and the dragon book ... by Ulbrekt · · Score: 1

    (Compilers by Aho, Sethi and Ullman) is what thought me how to program. I really think you need to understand how a processor works and how a compiler works if you want to be a good programmer.

    1. 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. What's this guy trying to do? by l33t-gu3lph1t3 · · Score: 1

    Yeah. See...

    Are you on crack? Sure, "real" programmers know assembly and lowlevel languages. Isn't it funny how these people are few and far between? This isn't because the other programmers weren't exposed to assembly. It's because assembly is so damned HARD to work with that programmers would simply rather NOT learn it.

    The only possible result of forcing students to learn assembly first is lower enrollment. God...trying to become a programmer by starting with assembly is like trying to learn linux by typing "man bash".

    --
    ------- "From bored to fanboy in 3.8 asian girls" ----------
  115. 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
    1. Re:Good Idea, not appreciated by PHB's, tho by Anonymous Coward · · Score: 0

      And in business computing, that is exactly what should be emphasized. People cost a heck of a lot more than faster hardware. Why should a business be forced to shell out big bucks to pay the wages of a talented programmer when a mediocre one with fast hardware will do?

    2. Re:Good Idea, not appreciated by PHB's, tho by Rotten168 · · Score: 1

      You know, slashdot can be so mindless sometimes... what the fsck do the PHB's have to do with collegic learning? This is learning low-level code before you learn higher level code so the code you produce for the PHB's is better.

    3. Re:Good Idea, not appreciated by PHB's, tho by studerby · · Score: 1
      Because a mediocre programmer will write code that's both slower and more expensive to maintain. In fact, a huge percentage of internal programming projects are *still* total failures, with absolutely no return on the investment.

      In other words, cost is irrelevant, cost/benefit is what matters.

      --

      .sig generation error:468(3)

    4. Re:Good Idea, not appreciated by PHB's, tho by sjames · · Score: 1

      Because throwing money at bigger hardware rather than at good code is a strategy that can backfire big time.

      What do you do when it's Nov 30th, and the machine you have is choking on the load but your budget is essentially coasting through December awaiting new allocations next year?

      Throwing hardware at a problem does make sense in some cases, in particular, when you have code that works well for it's purpose and has no active maintainer. However, for new code, you'll be a lot better off making that new code really GOOD code. That way, 2 years later you don't get stuck between a bad choice (spend the rest of the budget on a bigger server, knowing all too well you'll get stuck with that bill again in another year) and a worse choice (spend even more money on a rewrite ETA 1 year, meanwhile productivity dies the death of a thousand cuts).

      Consider the results if a few really GOOD programmers spending a few man years on your most important apps allow you to skip a single upgrade cycle for your PCs. If that upgrade is to 10 seats, it's won't pay off. If you have 1000 seats (at $2000 each) it certainly WILL pay off.

      In truth, though, the well written code is more likely to allow you to skip every other upgrade cycle for the life of the application. Of course, that assumes that management can see past the end of the quarter.

  116. 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.

  117. Quick contest by rongage · · Score: 1

    (mythical) 5 points to the first person who can identify both the processor (by make/model) and the machine that the processor resided in for the following snippet of code. Bonus if you can identify WHAT this code does...

    ld hl,3c00
    ld de,3c01
    ld bc,03ff
    ld (hl),20
    ldir

    Ok, so it's been a few (tens) of years since I have had to do this, so I may have the declaration of the memory address wrong. Just for clarification, the values are all in hex.

    --
    Ron Gage - Westland, MI
    1. Re:Quick contest by fgb · · Score: 1

      Well, it's obviously zilog z-80 code. The machine it runs on? I'm going to take a wild guess and say that it's a radio shack trs-80.

      I think the code itself clears the screen by using an overlapped block move to propagate a space character placed into the beginning of the video buffer.

      Am I close? I'ts been over 20 years since I touched z80 code and never on a trs-80.

    2. Re:Quick contest by rongage · · Score: 1

      Absolutely correct - you win!!

      What you win, I am not sure, but you DO win!

      for whatever it's worth! :)

      --
      Ron Gage - Westland, MI
  118. Know what you're working with by PaulWay · · Score: 1

    I'd agree with this - in principal.

    If you look at some of the nifty and speedy C work - like Duff's device - implicit is the knowledge that you're working on an actual machine. Look at K&R's string copy code - the while (*s++ = *t++) also generates much more efficient assembly code than keeping a separate counter for your position in the string. I know (because I've programmed some 8086 assembly myself and used this instruction) that there's a specific instruction that makes such a piece of code execute in about two instructions!

    If you'd programmed that without knowing what architecture you were working on, you probably wouldn't use such a construction because you wouldn't be sure that the compiler could optimise it. The flipside of this is that knowing what architecture you're programming on can, and should, affect your code.

    The compiler might have a good idea of what registers it's used, and the chip itself might have branch prediction and clever pipeline filling logic, but you as a programmer (should) have a much better idea of how your code works than either.

    However, this shouldn't stop people programming in high-level languages - the rich feature set and the portability more than makes up for the machine-code-ambivalence. And since a lot of OS projects end up executing on different architectures anyway, sacrificing portability for speed is not necessarily a good idea. But, fundamentally, I think knowing what architecture you're running on is highly important to writing good, slick code.

    The same applies for file systems and other hardware. Try to write a program that can insert arbitrary quantities of data in the middle of the file without overwriting the surroundings using standard C operations - it just isn't possible. But if you know how the file system works and have the API handles, you can do it (somehow).

    join('',map programmer{$_}, @world).

    Paul

    --
    --Reason is a tool. Try to remember where you left it.--
  119. Re:Democratic Party Platform by Anonymous Coward · · Score: 0

    I laughed my ass off when I read that. I can summarize the Slashdot argument right now. Here's an example of a common reply to any post or story on Slashdot. It doesn't matter what the post or story is about, they all say the same thing really:

    Story: Learning Computer Science via Assembly Language.

    Slashdot Poster: WMD, Haliburton, tax cuts for the rich, selected not elected, racist, sexist homophobe, jobless recovery.

    Story: Remotely Crash OpenBSD

    Slashdot Poster: Haliburton, WMD, Haliburton, WMD, Haliburton, Haliburton, Usama, jobless recovery, Haliburton, tax cuts for the rich, sexist, racist, seperation of church and state.

    Story: MySQL: Building User Interfaces

    Slashdot Poster: Ashcroft is evil, bad patroit act, Haliburton, tax cuts for the rich, WMD, WMD, Haliburton, racist, no blood for oil, Haliburton, sexist, racist, war monger, Usama, WMD, Haliburton, jobless recovery.

  120. The knowledge is still necessary by jkabbe · · Score: 1

    Even with today's higher level languages it is still sometimes necessary to know assembly or, at least, how high level code gets compiled into smaller instructions.

    The best example of this is the famous "Double-Checked Locking is Broken" situation with Java. If you don't understand how the language is compiled you can run into trouble.

  121. Doesn't seem like a good idea by An+Onerous+Coward · · Score: 1

    First point: if you're going to teach assembly, RISC assembly is downright elegant compared to the horrid kludge that is x86. x86 is more popular, but if the goal is to get the student into a computer's head, I think RISC is much more straightforward, and there's no shortage of VMs for it.

    Second point: There's no faster way to stimulate a person's curiosity about a subject than to let them accomplish something substantial from the get-go. In the same way, there's no faster way to kill curiosity than to keep people from doing anything meaningful until they have a complete grasp of the theory behind it. It is difficult to write even a marginally sophisticated program entirely in assembly, and a lot of people will lose interest long before they've gotten a glimpse of what computers are capable of.

    And what is up with the submitter also being the author? Can you say, "shameless self-promotion?"

    I'm willing to be convinced that the author might be onto something, but my first impression is that this is a step backward.

    --

    You want the truthiness? You can't handle the truthiness!

  122. Everything old is new again by Asprin · · Score: 1


    Back in the day, the CS major course sequence went like Pascal I, Pascal II, IBM 360/370 Assembly, Write your own OS, THEN higher level languages like C, Snobol, Cobol, PL1, ADA, etc.

    Yeah, I'm all for this. I think programming has become so abstracted that the abstractions don't correspond with anything but other abstractions anymore. I also think network engineers and administrators should be required to take programming, too, just because it'd be good for them.

    Sincerely,
    Kickin' it old skool

    --
    "Lawyers are for sucks."
    - Doug McKenzie
  123. 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 UserGoogol · · Score: 1

      You think you had it easy? In my day, we had to make electromagnetic relay switches by hand before we could even think about logical gates. We could only use vacuum tubes on Christmas, and even then we had to share the three vacuum tubes with the rest of the town!

      --
      "Never attribute to malice that which can be adequately explained by stupidity." -- Hanlon's Razor
    4. 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. :)

    5. Re:Not the point! by theparallax · · Score: 1

      I am way too lazy to think it up or write it out, but the OR is unnecessary. All logical gates can be constructed out of XOR gates. It is champion of all the gates.

    6. Re:Not the point! by mowo · · Score: 1, Funny

      Uphill...BOTH ways!

    7. Re:Not the point! by Anonymous Coward · · Score: 0

      Speed too.

      AND = 2 x NAND

      XOR = 4 x NAND

      So on one hand you have 2 NAND gates, on the other around 10.

      More costly *and* slower.

    8. Re:Not the point! by LnxAddct · · Score: 1

      XOR gates are expenisive and slow. All gates can be made from a combination of AND gates and NOT gates and life will be happier.
      Regards,
      Steve

    9. Re:Not the point! by cheerios · · Score: 1

      also referred to as NAND gates as the grandparent post already stated. ;) 3, count em 3, transistors to make a nand. wire both inputs to the same signal and you've got an inverter! any SoP circuit can be converted to all NAND gates to save space on the chip, and PoS can simlilarly be converted to NOR circuits. and now, having fully DESTROYED the joke that started all this, we return you to your regularly scheduled slashdot discussion.

    10. Re:Not the point! by SkunkPussy · · Score: 1

      you insensitive clod!

      --
      SURELY NOT!!!!!
    11. Re:Not the point! by bob65 · · Score: 1
      When I was in school, we had to take a computer architecture class which included using AND gates to make counters and such.

      Not much has changed, really. Computer Science curriculums still include an architecture (sometimes combined into one big course with a an intro to discrete math course) as an important part of the core. Basics of digital logic design using gates, machine representation of data, architecture (basics of registers, arithmetic logic units, buses), and assembly language are all still standard material in any CompSci curriculum. They way it's taught however, might be slightly different. There seems to be more of an emphasis on tying theory with applications (teaching discrete math and digital logic simultaneously), and hands-on experience with actual circuit boards.

    12. Re:Not the point! by harlows_monkeys · · Score: 0
      The point is the understanding of the workings of the machine

      Well...to understand the workings of past machines. Modern machines are RISC. Even x86 is RISC, with a microcode layer that translates the x86 instructions into the "real" code for the processor.

      I don't know if this affects the educational value or not.

    13. Re:Not the point! by SkoZombie · · Score: 1

      Yep, for intro to electrical & computer engineering we had to make all the basic functions (AND, OR, XOR) out of NAND gates. From memory you make a NAND out of two transistors. It was obviously the most 'edge of the seat' exciting experience I've had ;) We were also told that there's whole books entirely dedicated to optimisations based on NAND logic units. *shudders*

    14. Re:Not the point! by neurosis101 · · Score: 1
      Um... some schools do this for their CS majors.

      The university I attend has a mandatory lower division class that teaches SPARC assembly, and a Digital Design class that teaches how to make things like registers from flip flops (and flip flops from gates).

      Anyone wanna give me a job?

    15. Re:Not the point! by Anonymous Coward · · Score: 0

      No, they can't.

    16. Re:Not the point! by BananaJr6000 · · Score: 0

      Correct! I have taken electronics, computer architecture, and programming classes. When you want to create clean, efficient code, it helps tremendously when you understand what is happening under the covers.

      Unfortunately, this is becoming a lost art except in embedded systems or specialty hardware. Modern systems with GHz CPUs and gigs of RAM more than 640kB RAM allow really inneficient programming. ...not that there's anything wrong with that...

      --
      Your mother was a toaster

    17. Re:Not the point! by kcim · · Score: 1

      No the hex inverter is, in ttl (transister transister logic) the not and (nand) is next I think. The 14 pin ttl has 6 inverters on a chip. Now I want to dig out my bread boards :-)

    18. Re:Not the point! by Bizounours · · Score: 1

      That was easy... In my days, we had no electricity and our radio was working out of oil lamps.

    19. Re:Not the point! by satguy · · Score: 1

      NAND is the cheapest to make in silicon, but AND and OR preceded it in the initial vacuum tube-based developments in binary (Boolean) switching. Assembler is just a GUI to make CPU opcodes easier for the programmer - and old phartes like me get a chuckle watching modern programmers' reaction to that statement ;)

    20. Re:Not the point! by God+of+Lemmings · · Score: 1

      Not to make another "Uphill, both ways" joke, but my school is rather anal about CS majors having to not only take a digital logic course (covering gates, counters, proms, 8086 assembly, etc), but we also have to take a soul rending processor design course where we have to design a stack based processor in vhdl. Unfortunately, the only real asset this class provided was enough basic knowledge to write an emulator...assuming I had any interest at all in doing so. The school does offer an assembly language course for processors in the 68000 family, but this course is typically for students who are computer engineering majors, go figure.

      --
      Non sequitur: Your facts are uncoordinated.
    21. Re:Not the point! by Inspector+Lopez · · Score: 1

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

      I once found a compiler bug which I was able to demonstrate to the compiler vendor with three lines of C code. The bug was weird. Although simple to state, it took me many months to (a) realize that it was a compiler flaw, and (b) to succinctly identify the flaw. In this case it was remarkably simple: a global float which was initialized when declared was set to the absolute value of the RHS --- it could never be negative.

      It was not necessary to understand any assembly to identify this bug. This is not to say that an understanding of assembly is irrelevant to identifying compiler flaws. However, as my example shows, it is not necessary to understand assembly to identify all compiler bugs.

    22. Re:Not the point! by Anonymous Coward · · Score: 0

      NOR also...

    23. 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
    24. Re:Not the point! by Dark$ide · · Score: 1
      Luxury.
      In my day we built a counter out of two transistors for each flip-flop stage.

      --

      Sigs. We don't need no steenking sigs.

    25. Re:Not the point! by Anonymous Coward · · Score: 0

      why do old people always say assembler? I though assembly was the language, the assembler translated it into opcodes or something. I dunno, just wondering why old people say assembler....

    26. Re:Not the point! by mc6809e · · Score: 1

      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].

      The most primative gate is the inverter. It only takes two transistors. The NAND gate takes 4.

    27. Re:Not the point! by mc6809e · · Score: 1

      I am way too lazy to think it up or write it out, but the OR is unnecessary. All logical gates can be constructed out of XOR gates. It is champion of all the gates.

      Actually, it's not possible to create all gates with XOR gates.

      Now if you can use both XOR and something else like NAND or NOR or AND or OR, then you have a complete basis.

      Of course, just NAND or just NORs will also let you build all the other gates. ANDs or ORs by themselves won't do it.

    28. Re:Not the point! by mc6809e · · Score: 1

      also referred to as NAND gates as the grandparent post already stated. ;) 3, count em 3, transistors to make a nand.

      Actually, it's 4 transistors for CMOS: 2 in parallel on the Vdd side and 2 in series on the ground side.

    29. Re:Not the point! by douglas+jeffries · · Score: 1

      Being able to read the assembly output by compilers has helped me several times to find compiler bugs. Embedded compilers are sometimes really buggy, especially for new processors, and sometimes have trouble with some of the subtleties of C.

      When I see code that doesn't work, but seems like it should, the first thing I look at is the assembly output. It is usually easy to trace through, since there is usually enough debug information to match the C code to the generated assembly. Some problems become obvious at that point.

      Of course, there are also many cases like the one you suggest, where a high-level view is still enough to determine the general problem with enough understanding to present it to the compiler maintainers.

    30. 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
    31. Re:Not the point! by Anonymous Coward · · Score: 0

      Ahem...NAND is the universal gate for all you youngsters...(I learned to program on keypunch machines...Ibm 360 assembler...anyone else out there familiar with that? :-))

      Check it out: Universal gate

      And I definitely agree that only those who understand (not necessarily use) assembly are the ones who truly understand how a computer works...today's "programmers", raised on high level languages, produce mainly junk (exemplis gratis - MS Windows :-)...I rest my case :-))

      CdnYoda (too lazy to login :-))

    32. Re:Not the point! by Anonymous Coward · · Score: 0

      I had to do a short computing course many sols ago. First practical example was writing a simple programme in PDP-8 machine code. Second was in Assembler for a different computer (FM-1600 as I recall).

      Now I write VHDL for a living...

    33. Re:Not the point! by H*(BZ_2)-Module · · Score: 1

      This is considered a standard portion of a CS curriculum. Every CS grad should be expected to have had some exposure to those topics. Here is the the ACM guidelines showing coverage of digital logic and architecture. I think Patterson and Hennessy covers most of this, except maybe for digital logic.

    34. Re:Not the point! by stonecypher · · Score: 1

      The most primitive? No. It's the most complex. You don't build other gates out of it, you reduce it to other gates.

      --
      StoneCypher is Full of BS
    35. Re:Not the point! by Smallpond · · Score: 1


      The transmission gate is also only two transistors.

      You can make muxes out of just transmission gates and inverters, and from muxes you can build any logic.

      and don't get me started on JK flip-flops.

    36. Re:Not the point! by Anonymous Coward · · Score: 0

      in ttl nand is simpler than nor but not much

      in cmos they are exact mirror images or each other

  124. 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.

  125. Totally correct by Atario · · Score: 1

    Assembly language of some sort should be part of any programmer's experience. Granted, you're not going to accomplish anything wonderful -- you'll be doing well just to implement a sort or even multiplication (assuming your CPU doesn't have such instructions -- mine didn't (6502)).

    But once you get the grasp of how things "really" operate in the machine, and see the limitations of dealing directly with the CPU, you'll appreciate more (and, with luck, grok) how things work in general, even in very high-level languages: even if you don't know exactly what machine code gets generated by a given statement when compiled, you'll be able to guess a bit better where something may be going wrong (or slow), what takes a computer longer or shorter to do, what conceptual misunderstandings may arise on your part, etc.

    Go, assembly language!

    --
    "A great democracy must be progressive or it will soon cease to be a great democracy." --Theodore Roosevelt
  126. 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!

    1. Re:This is BS by hsoft · · Score: 1

      You got it! That's a great analogy. Who's silly enough to plant seeds one at the time. If you need to grow a plant that need a lot of attention, THEN you will do it. Otherwise, think big! After you seeded you whole field with the big machine, you can look at it, check if there are parts which aren't seeded correctly, and seed it by hand (You know, use ASM for the critical parts of your high-level project). And even then, farming machines today are so well designed that the need manual seeding is extremely seldom.

      I think the skill of a programmer comes from his ability to make abstraction of the machine. I mean, a good programmer will build a very well designed class tree, which is modular, well commented and easy to understand for the whole dev team, thus generating a lot less bugs than a messy, huge bunch of ASM commands.

      A good design for a quick sort algorithm, even if badly implemented is much better than an optimized ASM implementation of a bubble sort algorithm. Thus, it is not because you're an ASM wizard that you are a good programmer. I know a kind of low-level wizard, and after taking a glimpse at his code, I wouldn't want to work in his messy code!

      --
      perception is reality
  127. teaching csci through assembly language by Clod9 · · Score: 1
    The book is not about "teaching computer science through assembly language". It's about PROGRAMMING. There's a huge difference. See for example Djykstra's essay, "On the cruelty of really teaching computing science". It's a great read: http://www.cs.utexas.edu/users/EWD/ewd10xx/EWD1036 .PDF

    I really learned a lot about computers by learning assembly language. Of course, I really learned a lot by building a Z80 mainboard, too...learn all you can! The more you learn, the better you'll be.

  128. CS Curriculum by SlySpy007 · · Score: 1

    I think there are bigger problems with most CS curricula than whether or not to teach assembly first. When I was in school, the only thing I learned before learning assembly was Pascal (which is equivalent to nothing). In fact, assembly was really the only language I was taught in school - I taught myself C, C++, perl, etc. It's not clear to me that learning assembly first is necessarily a better path, but I do believe that following to be true: - Any CS'er should know at least SOME assembly - Any CS'er should be familiar with how the machine works (which, sadly, many do not) - Any CS'er should be familiar with the low-level interaction between SW & HW (which, sadly, many do not) I see this as more a fundamental problem of the super-specialization of science majors. I double majored in both CS and EE, so I got the best of both worlds; however with just a CS degree I would have had very little experience with anything related to hardware. Seems to me that these days CS programs are just programmer factories, churning out loads of mediocre programmers who know a lot about Java but little about much else. For the most part, programmers are one-trick ponies, and I suppose that's OK since the need for them will not diminish anytime soon. The sad part about that is until we as an industry begin to aggressively pursue alternative methods for software development, we're going nowhere fast. The traditional, high-cost, time-consuming development processes really are our glass ceiling.

  129. If you really want to learn what's going on... by Rorschach1 · · Score: 1

    Start out on the bare metal - no operating system, BIOS, or anything else between you and the hardware. We did a little bit of this in some CS classes when I was in school, but not much. I do a lot more of it now as a hobby.

    Most of my work is with Motorola HC08 series microcontrollers. There's nothing like being limited to 192 bytes of RAM to make you really stop and think about what you're doing.

    Yes, that's BYTES, not kilobytes or megabytes for you PC programmers. And your stack comes out of that same 192 bytes, so you've got to keep that in mind every time you jump to a subroutine. That return address isn't stored by magic!

    Now get off my damn lawn.

  130. New?!? by marktwen0 · · Score: 1

    One name, Donald Knuth, and the original classic, The Art of Programming, Volume 1.

  131. Then what? by agslashdot · · Score: 0

    Score:-1, Offtopic.

    So you learn Linux x86 Assembly.
    Then what ?
    Are there jobs in Linux x86 Assembly ? If yes, where ? Out here in the US, or someplace in India ?

    Or are you suggesting people learn x86 Assembly for kicks ? That's cool too, but you know, its a bad economy...have you looked at the recent unemployment numbers...people live with rising debt, record number of bankruptcies, the country struggles with 500 billion deficit....not exactly a bright time for polishing my x86 skills...what do you think ?

  132. Re:Assembly Language by betis70 · · Score: 1

    This is a high ID.

    Its like gym class over again, except this time I'm gettin the wedgie.

    Damn geek bullies.

    --
    I forget...are we at war with Eurasia or East Asia?
  133. I couldn't agree more by Anonymous Coward · · Score: 0

    But before we get to all that, we need to train people how to use light switches. We've got people wandering around all over who don't know a thing about high-energy particle pysics, and yet they see themselves as fully qualified to use light switches. "Well you just flip it on and off" they say, but HA!!! How little they KNOW!!! ... Can they detirmine the fitness of a test of the speed of transmission? The magnetic flux produced by different types of wiring? The optimum UV conversion of phosphor bulb coatings? Edison was called a "Wizard" because he had to know how to do all those things. Perhaps it's time that learning about light switches gets back to starting with the basics....

  134. any decent compiler by SHEENmaster · · Score: 1
    Any decent compiler damn well better swap i=i+1; for i++; during optimization. Let's test it with GCC3.3 on my UltraSparcII

    i=i+1; generates:
    • ld [%fp-20], %g1

    • add %g1, 1, %g1
      st %g1, [%fp-20]

    while i++; generates:
    • ld [%fp-20], %g1

    • add %g1, 1, %g1
      st %g1, [%fp-20]


    The latter method might feel better, but there's no difference in the resultant compiled binary. The compiler isn't stupid.
    --
    You can't judge a book by the way it wears its hair.
  135. Not Either, but Both by DynaSoar · · Score: 1

    "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."

    My first two computer books were the "Green Apple" book, a very detailed accounting of the Apple II, and an Osborne book on CPU and computer functioning.

    I learned them in parallel, making sure I understood what was really going on at all levels, from my BASIC programs, down through interpretation, into the machine code, and the actions taken by the machine all the way back out to the output device. Every level took part and needed to be accounted for. The Apple book told what the Apple did and how it did it to some extent. The other book wasn't even about the 6502, so I had to learn to understand what was happening, and how that differeed from how it was being accomplished.

    From that I gain a very deep understanding of the similarities under all machines, and ended up with essentially zero learning curve when having to switch between apps, OSs or even fellow geeks (when they tended twoards a certain focal technology).

    A person who knows how it works is far better equipment to handle any eventuality than a person who just knows how to make it go.

    --
    "I may be synthetic, but I'm not stupid." -- Bishop 341-B
  136. 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.

    1. Re:Teaching assembly good, but perhaps not x86... by multipartmixed · · Score: 1

      Stick with the 6502 -- you're right, it's close to idealized (I cut my teeth on the VIC) for this type of learning.

      The advantage of going with this CPU is that there is *lots* and *lots* of documentation out there on it. Ditto for assemblers, and C compilers. You could avoid reinventing the wheel.

      Other good choices:
      - mc6809
      - mc68hc11
      - mc68000 (odd-byte memory addressing may confuse newbies)
      - MIPS

      MIPS is kind of interesting, we did an entire 4th year compiler project using only 24 instructions.

      --

      Do daemons dream of electric sleep()?
  137. 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.

    1. Re:Assembly is an impediment by djmurdoch · · Score: 1

      A fake machine language (called Hypo) was the first computer language I learned in high school (about 30 years ago). It was useful for learning because it introduced the idea of building something complicated out of very simple pieces -- which is the essence of programming.

  138. Re:Democratic Party Platform by Anonymous Coward · · Score: 0
    The rest:

    You are an idiot
    You should drink a bullet

    Don't you have something better to do? I bet your boyfriend would appreciate a blowjob.
    I hear there is updates available for Safari and Java, have you gotten them yet?
    Have you called your mom lately? She probably would like to hear from you.

  139. 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!
  140. For the poor like me here is the download by Stalin · · Score: 1

    http://www.eskimo.com/~johnnyb/ProgrammingGroundUp .pdf

    1. 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/

  141. In other news... by iamacat · · Score: 1

    A driving school that teaches students to move the car by manually injecting fuel into the engine and shifting gears by pulling on things under the open hood.

    Admitedly, one can not seriously use C++ without knowning assembler for debugging purposes. A corrupted virtual table pointer, for example, produces behaviour that can hardly be explained by language semantics.

    Also, "production use" VM languages like Java or C# do not break down in the same way, but even the shortest possible program requires way too many things that will distract beginners - like a class, method calls like System.out.prinln, or even requirenment to declare the main function.

    But these are not the only choices. BASIC is still pretty good. "input a,b,c : ? (-b+sqrt(b*b-4*a*c))/(2*a)" gives an introduction to sequential execution of program steps without too much unneccesary red tape. Algebraic notation could be better though. AWK, Python or Javascript would all be candidates for the first language that shows people how to use if statements and loops.

    Then, once students know how to parallel-park an automatic car, they can go and learn stick shift and hand-tuning the engine if whatever they are trying to do requires such efficient driving. Or if they have to drive a car that keeps crashing because of slight driver errors and requires extensive poking under the hood to discover what went wrong.

  142. 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

  143. college by minus_273 · · Score: 1

    funny, my school has MIPS assembly and MIT scheme in the intro level courses. I don't see any other way of doing it.

    --
    The war with islam is a war on the beast
    The war on terror is a war for peace
  144. Perhaps, or perhaps not. by raytracer · · Score: 1
    ... Perhaps it's time that computer science curriculums start teaching assembly language first.

    Or, perhaps not.

    Computer science and programming aren't the same thing. Computer science is knowledge. Programming is a skill. They reinforce each other, but it is a mistake to confuse them as being the same thing.

    Higher level languages hide irrelevant details from us. They are a good thing: they allow us to concentrate on the task that we are trying to achieve. What parts of a machine are irrelevant? Most of them.

    Don't believe me? Consider how many lines of code are in the Linux kernel, and compare the differences between say a PPC port of Linux and the X86 differences. Not very many differences compared to the raw number of lines, is it? That's because most of the machine differences are irrelevant.

    Sure, you could clutter your mind with instruction timings, rules for cache invalidation or pipeline stalls. But it's almost certainly a waste of time, and it will get you no closer to understanding Computer Science.

  145. why not make assembly higher level? by Nick+haflinger · · Score: 1

    With the comming advent of 64 bit processors the potential size of the instruction set will be able to vastly excede any reasonable limit. the hardware could implement RAM as a database w/ SQL to get info and have C or C++ or java VM or python interpreter or even all four implemented in silicon. I realize you'ld want the base instruction set to be pretty damn mature but imagine the advantages of writing a fourth gen language that was machine code.

    1. Re:why not make assembly higher level? by Anonymous Coward · · Score: 0

      In 6502 assembly, I've created quite a few macros.

      It's basically like creating your own instructions.

      I don't think any CPU is going to be able to run C code or anything other than assembly natively, that sounds pretty far-out. It's gonna have to be compiled into something, otherwise you just end up with some slow-ass intrepreter.

    2. Re:why not make assembly higher level? by idries · · Score: 1

      Assuming that what you mean by "the potential size of the instruction set" is the number of opcodes (i.e. ADD, MUL etc. think 'function') that are available in the instruction set. I think that you might have misunderstood what a 64-bit processor is.

      The 'bitness' of a processor has NO relationship to the number of opcodes. A 64-bit chip will not have 2^64 opcodes (or even the possibility of such a thing).

      The 'instruction-size' of a given architecture may be a constant size (i.e. 32-bit) however, this refers to the size of a complete instruction. That is the encoded opcode and the operands (i.e. register0, #0x01 etc. think 'parameter'). Some architectures (such as ARM) have a constant instruction-size (all ARM instructions are 32-bit). Others, such as x86 have a variable instruction-size (x86 instructions can vary from 4 to around 11 bytes).

      Current CPU design methods call for a reduced number of opcodes. This is because the number of opcodes is limited by the fact that each opcode requires an actual physical piece of silicon to execute it. So more opcodes = more silicon and more silicon = hotter (which can mean slower) and more expensive chips.

      x86 has alot of opcodes, however, these are not 'real'. The x86 architecture is a 'micro-architecture' which means that each instruction is actually decoded into a number of smaller operations (called micro-ops). In the case of micro architectures, there is a smaller piece of silicon to decode the opcode into micro-ops, and then several other pieces of silicon to execute the resulting micro-ops, however, these are shared between many opcodes. This allows x86 to have a large number of opcodes for backwards compatability, without a crippling chip size. The extra silicon needed for each opcode is relativly small but the whole set of opcodes can be implemented by a much smaller number of micro-ops.

      The downside to this is that a number of the opcodes are very slow, as they decode to alot of micro-ops. These opcodes are not really used by modern compilers/programmers because they can normally be replaced by a sequence of several other instructions that are faster (as they decode to less micro-ops or 1 micro-op in some cases).

      What a "64-bit processor", normally means is that the GPRs in the processor are 64-bit. The main advantage of this is that larger integers can be represented by the GPRs which also means that 'larger' pointers can be held in them. Hence a larger memory space can be directly addressed by the machine (i.e. the machine can have more RAM).

      64-bit processors also normally come with 64-bit architectures so the memory bus etc. is wider.

      There's really no way that a "higher-level" language could be implemented effectivly in hardware. It doesn't make any sense. C++, C and Java are all compiled anyway, and the python interpreter is way to complex to put into hardware. There is a chip that executues the Java byte-code instruction set in hardware. But that's the closest that you're going to get, and really, coding in Java byte-code is both painful and pointless.

      Anyway, to say something slightly on topic. I have found that going back and learning alot of asm has definatly made me better at my job. I haven't read the book, but I believe that it's a sound approach if you want to work in a field where performance really matters (like games) to look at asm first. However, if you're going to be a database programmer or make business tools or somthing, you can probably find better things todo with your time.

    3. Re:why not make assembly higher level? by Anonymous Coward · · Score: 0

      There's really no way that a "higher-level" language could be implemented effectivly in hardware.

      Well, the hardware could be designed to run higher-level languages more efficiently - think a tagged architecture for efficient lisp execution, say...

  146. Yes! I agree! by ibullard · · Score: 1


    Yes, please throw all those who know nothing about programming directly into assembly language programming! That way less people will be interested in programming, thus less Comp Sci graduates, thus solving the problem with exporting programming jobs!

    I'm glad SOME of us are thinking ahead. I for one welcome this initiative for keeping our jobs.

  147. 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.

  148. The value of Assembler by Anonymous Coward · · Score: 0

    Well, if you've ever written some trivial program in a high level language (Fortran or Cobol or whatever) and then disassembled it, you know the value of Assembler. There's nothing quite so convincing as seeing your program broken down into Assembler to appreciate how much garbage is included by a high level language compiler/linker and get one to thinking how one could extensively clean it up using assembly code. Ah, the good old days, when program size and speed were at a premium .

  149. Duh... Computer Organization? by leoxx · · Score: 1

    Learning about how a computer actually does what it does is referred to "computer organization" and any University that offers a computer degree without a course or two in organization is (IMHO) severely lacking.

  150. 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.

  151. Learn x86 assembly - realize x86 is a bad platform by Anonymous Coward · · Score: 0

    I had been programming for years in assembler under various platforms from minicomputers to microcontrollers: PDP8, PDP11, Motorola, Zilog, NEC, Intel's microtroller family 8051s, and then I tried the processor family from hell: x86 family.

    It felt like I knew nothing cause the whole x86 platform on the PC is interrupt driven as opposed to memory mapped. Any time you wanted to do anything, you talked to a software interrupt. And then your memory is segmented into four segments: data, code, stack and misc. You can only talk in small chunks of memory (soemthing like 64KB because of backwards compatibility to the old 8 bit processors IIRC) and are forever swapping out. Not to mention the 640KB limit. Aaagh!

    The x86 family is based on the 8085 family which was based on the 8080 family and so on. The built on the core of the previous processor which sounds like a good idea but in fact, it added the previous generations limits into the design. It's a perfect example of how not to design a processor.

    Program in assembler on a Zilog or Motorola processor and you can see engineering brilliance at work. Things were well thought out and done with a purpose and not because a deadline had to be met. I'm sure that most of the Zilog and Motorola design engineers had hands on experience with Intel first and new what not to do.

    I can't say little enough about the x86 platform on a PC. I pity anyone who has to program assembler on it.

  152. That the worst idea ever by PissingInTheWind · · Score: 1

    As a graduate compsci student being also a teaching assistant for classes on programming language, I think that's a really bad idea.

    People need to abstract from the computer hardware to develop means of reasonning, creating abstractions, solving interesting problems and writing understandable programs.

    Introducing someone to computers by learning him assembly won't help their development at all. Low level development is tedious, it is not something that should be used to teach people how to reason about programming.

    Also, how many people writes assembly in their day job? The only assembly I produce comes out of my compiler's code generator. I'm not stupid enough to go write it myself.

    Definitively, assembly has its use, but it is not for teaching basics of programming. Using it with that goal in head is a very bad case of premature optimization.

    --

    A message from the system administrator: 'I've upped my priority. Now up yours.'
  153. object oriented assembly? by Freedom+Bug · · Score: 1

    I've written object oriented assembly code before. Very possible, and not particularly difficult. There's a little bit of setup work involved, you just can't jump in: but that's true in all pure OO systems: hello world's are larger in OO systems than in structural languages.

    Assembly language OO is certainly easier than structured language OO. Take a look at GNOME for an example of the latter.

    In a similar vein to the FP, writing OO assembly makes you a much better coder. For instance, before I wrote the project, I didn't have a good idea of the difference between a class and an object. I definitely do now!

    The only thing OO assembly doesn't give you is protection, and that's no loss. Python doesn't have a "true" protection scheme either for it's objects, and it's a better language for it.

    Bryan

    1. Re:object oriented assembly? by Anonymous Coward · · Score: 0

      Writing OO assembly is possibly thing I've ever heard of. You want tight OO code - use inline assembly in your goddamn c++ FFS. Assembly doesn't guarantee you shit - meaningful type system, abstraction, everything is just gone.

      I don't want to call you an idiot... I want to shout it from the rooftops...

  154. 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.

  155. +5 Informative ??? by Anonymous Coward · · Score: 0

    WTF? Assembly language for an architecture is
    the same regardless of the OS.

    The Parent post is mis-informed.

    1. Re:+5 Informative ??? by Anonymous Coward · · Score: 0
      Only if you don't intend to have your assembly language program do anything useful, like input/output.

      Well, I suppose you could have it pause when it's complete, and read some results out of memory with a debugger...

  156. I dont think you can compare 1980's to now by doormat · · Score: 1

    Back in the early 1980s, you had a text prompt and that was about it. Maybe a mouse. Learning Computer Science via ASM was possible because there was a small subset of function the computer would accomplish. Today, I think its drastically different. There are a billion things one piece of software does, especially software with a GUI, API calls, etc. I would think that its so convoluted it would be hard to pick out one consistent stream of thought from inside the software.

    --
    The Doormat

    If you're not outraged, then you're not paying attention.
  157. Why don't you ask him? by Anonymous Coward · · Score: 1, Insightful

    Most programmers who know assembly don't use it much.

    Why would you make a claim like this without checking it?

    1. Re:Why don't you ask him? by Anonymous Coward · · Score: 0

      Thats a stupid comment and I can't believe it was modded up. This guy is one of my best friends I've known him for years.

  158. This is not BS, it's CS by forkboy · · Score: 1

    Let's leave this assembly crap, and it is crap

    What exactly do you think your C compiler is written in? How about very good portions of the Linux kernel?

    You don't need low level programming languages for every application, or even MANY applications, but understanding machine code is the difference between a trained monkey and a Computer Scientist.

    Your farming analogy blows, by the way. A more apt analogy would be Farmer Brown doesn't know shit about botany or genetics, he just buys the seeds Monsanto tells him to and plants them the way his "paw" taught him. Farmer Jones however understands botany and plant physiology as well as a bit of meterology. He understands how plants work, what fertilizers to use and in which conditions to use them, and when to change his planting times/methods. Farmer Brown will have a harder time adapting to conditions outside his skill-set. Farmer Jones is less likely to run across conditions he can't handle.

    Besides, understanding how the machine interacts with the software goes well beyond writing assembly code.

    --
    This message brought to you by the Council of People Who Are Sick of Seeing More People.
    1. Re:This is not BS, it's CS by djmurdoch · · Score: 1

      What exactly do you think your C compiler is written in?

      Most likely it's written in C.

      Some compilers have been written in assembler (e.g. early versions of Turbo Pascal), but most are written in high level languages.

    2. Re:This is not BS, it's CS by p_millipede · · Score: 1

      Most lanuguage's first compiler is written in either assembly or in another language. The language is not normally considered "complete" until you can write and compile a compiler for it, in it. And then re-compile the compiler with the output of itself.

  159. fundamentals by munkinut · · Score: 1

    I thought that's how all computer science and engineering learning starts out?! With the fundamentals of the computer itself and how it is controlled? Is that not true any more? I learned the fundamentals primarily by programming the 6502 on an EMMA training board (anyone remember those?) using a hex keypad and an 8 digit LED display.

    --
    re-invent wheels ... you never know
  160. Pointless by beelsebob · · Score: 1
    It's boring using assembly language - you can understand how a computer operates on a low level by doing studying it - learning ASM is pointless... The only time you need to know ASM is when writing a compiler - and then you just need the big reference sitting next to you.

    From a research point of view it's far more interesting to look at new (or emerging) programming paradigms like Functional Programming, or mathematical models.

    Anyway, if you really want to go low level, go learn how a turing machine works :)

    Bob

  161. Fools! by Anonymous Coward · · Score: 0

    You think that cpu's are really doing exactly what you tell them to do when you program them in asm? What about hyperthreading and pipelines and pre-fetching and all the other insane stuff modern CPUs do? I hate to break it too you but even ASM is now a higher level language.

    http://arstechnica.com/paedia/c/cpu/part-2/cpu2-1. html

    There's more there then just that one article, this one just seemed like a good place to start people at.

  162. 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?

    2. Re:To be a programmer without ever... by parksie · · Score: 1

      It's spelt carburettor over here.

    3. Re:To be a programmer without ever... by tehcyder · · Score: 1

      I think it's a US v. UK spelling thing

      --
      To have a right to do a thing is not at all the same as to be right in doing it
    4. Re:To be a programmer without ever... by poot_rootbeer · · Score: 1

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

      *sheesh*

      car-bu-re-tor

      If you're going to stoop so low as to make a SPELLING FLAME, at least make sure you're right before making it.

    5. Re:To be a programmer without ever... by PissingInTheWind · · Score: 1

      If you're going to stoop so low as to make a SPELLING FLAME, at least make sure you're right before making it.

      That would take all the fun out of it.

      --

      A message from the system administrator: 'I've upped my priority. Now up yours.'
  163. Any real numbers? by sholden · · Score: 1

    In my (granted not extensive) teaching experience the assembly programmers are the worst of the bunch when it comes to doing CS. Followed closely by the basic programmers. Then followed by the other "Prior Programming Experience" folks. Prior programming experience seems to make people think that CS is about programming, and not about math - which of course means they don't do so well. Of course maybe the blurb is incorrect and the book isn't about CS, but is about programming, which the title of the book indicates. But since the blurb author is the book author the point still seems valid. So is it about programming, or about CS?

    "Old-timers" are often viewed as "wizards" because they have knowledge and experience, that they know assembler doesn't seem so important - they probably will know at least one flavour of assembler because of their experience of course.

    So have you got some numbers to back up the "I've found that the key difference between mediocre and excellent programmers is whether or not they know assembly language" statement? Or is it anecdotal (which of course doesn't mean it isn't true)? Experience needs to be considered - if the assembler programmers have more years of experience then you would expect them to better programmers (that's what I would expect to explain the observation, since assembler use has declined over time, so people with experience in it probably started earlier...).

    Of course a book which teaches programming and not a specific language is a good thing, provided it is well written, edited, and tech reviewed.

  164. 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

  165. Assembler is good by kiwirob · · Score: 1

    Assembler is good to know how to program in.

    When I started programming as a job I was trained as a IBM s370 mainframe assembler programmer. I did it for a little over 2 years before I was asked to apply for a COBOL job at another company by my old team leader.

    Being quite young at the time I just did what was asked and went along to the interview. They asked me how well I knew COBOL and I said I didn't. My old team leader said "He's an assembler programer, he will pick up COBOL is a couple weeks". And I ended up getting the job.

    When I started the job I didn't even get any COBOL training, but I IBM CDROM on COBOL and access to the bunch of programs I had to work on. Given a few weeks I didn't have any problems.

    A few years later I was getting sick of the mainframe and wanted to get into client server or PC related stuff. So my team leader gives me the job of re-developing the IVR (Interactive Voice Responce) system that was used for our banks Telephone banking system. Again I was given a couple manuals, access to the system and told I have 2-3 months to redevelop the system to intergrate into the new backend. And I did it.

    Soon I got sick of working in a corporate environment. So I threw in my job and started doing web work. I've programmed in Miva Script, PHP, Python, Perl and javascript on various projects. I've never had a lesson in any of the languages. I just searched the web for a manual and started coding or hacking away at code I could find that did simular stuff.

    My point is that I honestly believe without my assembler traning and experince I doubt I could be as felexable a programmer today as I am.

  166. Untaught Golden Rule Of Assembly... by snatchitup · · Score: 1

    Write just enough of it to accomplish what you are doing.

    Call this code from a higher level language.

    More and more, assembly is not needed except for embedded systems, and I've even used C sprinkled with inline asm for embedded code.

  167. Elitist argument. by Vellmont · · Score: 1

    I've always felt this whole "assembly language makes you a tough guy" argument to be an elitist one. For the record I did study assembly in computer science. Did it make me a better programmer? Maybe, but then learning regular expressions probbably would also have made me a better programmer too (had to learn that on my own). What I have a problem with is this attitude that if you _don't_ know an assembly language, then you're just a mediocre programmer, or somehow a lesser mortal than someone who does.

    There's some specific instances where knowing how assembly works might give you some insight into strange esoterics like instruction re-ordering problems in certain multi-threaded atomic operations in Java. (That was a discussion one year at Java-One). But then what area of knowledge in programming doesn't have some specific instances where that special knowledge is extremely pertinent?

    I'm glad I know a bit of assembly, how processors work, instruction re-ordering, pipelining, etc. It's all damn cool stuff. But then there's all this other stuff I have little clue about, like bayesian filtering, fuzzy checksums, etc that would be helpfull to know as well. Are the guys who know a lot of assembly better than guys who know cool algorithms? I think they're just different skillsets, and people need to get over their zealotry for a particular skillset.

    --
    AccountKiller
    1. Re:Elitist argument. by Anonymous Coward · · Score: 0

      If your code spends most if it's time in one loop, optimize it in assembly. Huge speed increase with very little work.

      If you don't know assembly, you can't do some things like that.

      Ineffecient code is lame.

  168. 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.

    2. Re:It is not the language, it is the paradigm. by use_compress · · Score: 1

      Imperative languages are based on the Von Neumann machine.

      Functional langauges are based on the lambda calculus.

      Declartive langauges are based on some extension of propositional logic.

    3. Re:It is not the language, it is the paradigm. by voodoo1man · · Score: 1

      I'm not sure what Lisp you're referring to, but nowadays 'Lisp' is pretty much synonymous with the Common Lisp dialect. I'd have to lump that into object-oriented too (I don't think I've seen a single app written in the past couple of years that wasn't at least half based on multimethods and objects/structures).

      --

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

    4. Re:It is not the language, it is the paradigm. by Wolfier · · Score: 1

      Your classification is correct too - the reason I made my classification is that, it focuses on inside the mind of the programmer - while the imperative vs function focuses on the nature of the language itself.

    5. Re:It is not the language, it is the paradigm. by ameoba · · Score: 1

      Actually, the pure fuunctional languages are a subset of declarative languages, as are logic programming languages and constraint programming languages. Liberal use of !s in a Prolog program gives you very functional-like program flow.

      --
      my sig's at the bottom of the page.
    6. Re:It is not the language, it is the paradigm. by Animats · · Score: 1
      Imperative won. Functional and declarative lost. Give it up.

      I've written sizable programs in LISP and Prolog. I've used formal specification languages. That era is over.

      Even "makefiles", which were supposed to be a declarative language, have become an imperative language with some declarations. YACC and Bison are true declarative languages, as is SQL. But general-purpose declarative programming doesn't work.

    7. Re:It is not the language, it is the paradigm. by Myria · · Score: 1

      All hardware for the entire history of computing runs entirely imperative code. Imperative is clearly going to be the most popular because it related directly to what computers are capable of doing.

      SQL is really a hybrid of declarative and imperative. While it's true that you almost never say *how* to access the data in a database, you say *what* to do to the database imperatively.

      YACC isn't truly declarative, either. In order to use it successfully you need to understand the imperative internals of the parsing process.

      Melissa <3

      --
      "Screw Sun, cross-platform will never work. Let's move on and steal the Java language." - Visual J++ Product Manager
    8. Re:It is not the language, it is the paradigm. by lars_stefan_axelsson · · Score: 1
      I've written sizable programs in LISP and Prolog. I've used formal specification languages. That era is over.

      We love it when you think it is. It enables us to beat the pants of the competition. (Yes I also work for the Ericsson GSN division.)

      --
      Stefan Axelsson
    9. Re:It is not the language, it is the paradigm. by lars_stefan_axelsson · · Score: 1
      2a. Pure functional (Haskell/ML/Pure lambda calculus)

      Small nit (well, not so small if you're in the functional programming camp). ML (SML, O'Caml etc), are impure functional languages. I.e. they support assignement and mutable data (O'Caml is even object oriented). Haskell is about the only non-strict purely functional language around these days (though Miranda hasn't exactly died).

      If you're interested, check out O'Caml, which has a nice compiler producing code on par with 'C' for some benchmarks. Lots of good documentation (even a book) on line.

      --
      Stefan Axelsson
    10. Re:It is not the language, it is the paradigm. by Anonymous Coward · · Score: 0

      Don't forget unlambda ;)

    11. Re:It is not the language, it is the paradigm. by Anonymous Coward · · Score: 0

      Object orientedness and functional programming are orthogonal concepts. A language can be both oo and functional, like OCaml.

    12. Re:It is not the language, it is the paradigm. by lars_stefan_axelsson · · Score: 1

      :-)

      I'm more into whitespace these days though. :-)

      --
      Stefan Axelsson
    13. Re:It is not the language, it is the paradigm. by Anonymous Coward · · Score: 0
      to beat the pants of the competition

      They must have some pretty powerful pants, those guys. Anyway, you probably meant to say, "It enables us to beat the pants off the competition."

    14. Re:It is not the language, it is the paradigm. by lars_stefan_axelsson · · Score: 1
      They must have some pretty powerful pants, those guys.

      Well, come to think of it, shouldn't it be the other way around? If you can beat the pants of the competition, that's not much of an endorsement is it? Pants rarely put up that much of a fight.

      Then again trying to dress my 10-month old, I can almost swear that he's got his clothes somehow in on it, his pants in particular actively resisting. One such young boy shouldn't be able to put up that much of a fight on his own. :-)

      --
      Stefan Axelsson
    15. Re:It is not the language, it is the paradigm. by Anonymous Coward · · Score: 0
      The Eternal Flame

      I was taught assembler in my second year of school.
      It's kinda like construction work -- with a toothpick for a tool.
      So when I made my senior year, I threw my code away,
      And learned the way to program that I still prefer today.

      Now, some folks on the Internet put their faith in C++.
      They swear that it's so powerful, it's what God used for us.
      And maybe it lets mortals dredge their objects from the C.
      But I think that explains why only God can make a tree.

      For God wrote in Lisp code
      When he filled the leaves with green.
      The fractal flowers and recursive roots:
      The most lovely hack I've seen.
      And when I ponder snowflakes, never finding two the same,
      I know God likes a language with its own four-letter name.

      Now, I've used a SUN under Unix, so I've seen what C can hold.
      I've surfed for Perls, found what Fortran's for,
      Got that Java stuff down cold.
      Though the chance that I'd write COBOL code
      is a SNOBOL's chance in Hell.
      And I basically hate hieroglyphs, so I won't use APL.

      Now, God must know all these languages, and a few I haven't named.
      But the Lord made sure, when each sparrow falls,
      that its flesh will be reclaimed.
      And the Lord could not count grains of sand with a 32-bit word.
      Who knows where we would go to if Lisp weren't what he preferred?

      And God wrote in Lisp code
      Every creature great and small.
      Don't search the disk drive for man.c,
      When the listing's on the wall.
      And when I watch the lightning
      Burn unbelievers to a crisp,
      I know God had six days to work,
      So he wrote it all in Lisp.

      Yes, God had a deadline.
      So he wrote it all in Lisp.


      sung by Julia Ecklar on Roundworm
      Parody of "God Lives on Terra" , words and music by Julia Ecklar
      For more information and other parodies, see www.songworm.com
      Parody lyrics (c) 7/29/96 by Bob Kanefsky. All rights reserved. The copyright of the original lyrics and music remain with the holder(s) of the original copyright.

  169. New thing? by Shant3030 · · Score: 1

    I dont think this is a novel concept. When I started my comp sci degree, an assembly lang class was one of the first 3 classes.

    --
    100% Insightful
  170. Silicon is for sissies. by sleepingsquirrel · · Score: 1

    Real men go to the beach and grab a bucket of sand which they refine into silicon.

  171. I agree. by atheken · · Score: 1

    BY FAR THE BEST CS COURSE I EVER TOOK!

    http://www.cis.ohio-state.edu/courses/cis_syllab i/ 360.html

    We used "ISAM" which emulates sparc assembly while it is a little closer to a sandbox than "real" assembly...

  172. Get it to your valentine! by PissingInTheWind · · Score: 1

    On a more humorous note, there is a "Get it to your Valentine on time!" button on the book's page.

    Now, that a sure-fire way for me to get laid... (not!)

    --

    A message from the system administrator: 'I've upped my priority. Now up yours.'
  173. Unfortunately ... by krygny · · Score: 1

    ... the practice will never be widely adopted because it's a reversal of the trend. How many kids today are learning arithmetic without a calculator.

    --
    Research shows that 67% of those who use the term "research shows", are just making shit up.
  174. Pet peeve of the year (was Re:Linux x86 assembly?) by honestpuck · · Score: 1
    For the *vast majority* of software it is significantly better value to design and build a well architected OO solution

    Last time I checked an architect doesn't 'architect', she 'designs', therefore the past tense is 'designed' not that godawful non-word 'architected' that has sprung up here on /. several times recently.

    Tony Williams

  175. useless by Anonymous Coward · · Score: 0

    knowing assembly language to be a good programmer is like knowing the molecular composition of egg whites to make good cake. It's a waste of time and not needed

  176. This is a BAD idea by 11223 · · Score: 1

    Obviously the submitter has never attempted to teach introductory computer science with an eye towards theory. Teaching most languages has the effect of reaffirming in many students' minds that Computer Science is all about misplaced semicolons and curly brackets; it reinforces a cut-and-paste view of computer science. This is exactly what you don't want!

    But if we want to talk about returning to roots, why don't we teach computer science with the lambda calculus? Actually some schools do use an extended lambda calculus, Scheme. This is actually what teaching Computer Science is all about: abstraction with an eye towards a study of the computable. Not to say that graduates shouldn't also be rigorously trained in how to program, but the best starting point for a computer science degree is in computer science, not programming.

  177. 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.

  178. Not So New Concept Indeed! by ZahrGnosis · · Score: 1

    Okay, now this is the first thread that's made me feel old, and I STARTED college just last decade. C'mon, let me get out of my twenties before you act like my education was dead and now you're revitalizing it.

    To wit: based on a new concept - teaching computer science through assembly language [...] This is why the old-timers are often viewed as 'wizards': they had to know assembly language programming.

    I object to the use of "old-timers", first and foremost, and I secondly object to the thought that your book is a "new concept".

    Assembler may not have been the first thing I learned in my undergraduate CS curriculum, but it was darn near the first thing.

    All that said, understanding Assembler is a huge asset to learning general Computer Science. If you want to know how any other language works, you need a grounding in Assembler concepts. Still, this is nothing revolutionary, and CowboyNeal should be flogged for posting such a story without at least a review from someone other than the author.

  179. I know assembly. by Albert+Sandberg · · Score: 1

    .. on different machines and different sets. I started out back in the days when you had to use assembly to gain speed, and slowly changed it for c/c++ as time went by. I've been programming for years back, making mostly graphical application.

    Guess what? I'm a bricklayer.

    Albert

  180. In my school... by Anonymous Coward · · Score: 0

    Computer Science involves a lot more than just programming. Thus, I would have to say that I agree that I've never learned subjects such as computer architecture and algorithm design and analysis through a course regarding a programming language. Courses on programming languages are just that, courses on programming languages. They are not, by themselves anyway, the definition of Computer Science.

  181. Use an assembly language intended for teaching by Anonymous Coward · · Score: 0

    Why not learn using an assembly language that was intended for teaching like MMIX? I know there's always ``the Art of Computer Programming'', but it would be nice to have a shorter simpler book for beginners. The problem with teaching 80x86 is that it's already hard enough to get people to move on as it is.

  182. Is this anything new? by Covener · · Score: 1

    I think you're confusing "Computer Science" with "Programming".

    Every program I've heard of has an ASM course to lead into computer architecture classes. I think it's wise, but I do not think it's wise to have ASM as a 1st course in a Programming series.

  183. Hey. by Anonymous Coward · · Score: 0

    I first learned BASIC. Then I learned assembler. Now what's that you say about me being NERRRRRRRR?!?!

  184. Assembly teaches good programming practices by ca1v1n · · Score: 1

    Assembly language programming has done wonders for teaching me algorithmic efficiency. Before I started writing code in assembly, I would always use random-pivot quicksort (with insertion sort on small base cases) to sort large data sets, but once I started using assembly I realized that bubblesort is much simpler and more elegant. I've been using bubblesort ever since. I can't say that programming in assembly has done anything for my knowledge of computer architecture, but it's definitely helped me write more efficient code.

  185. Gratuetous 'when i was a lad' statement. by Anonymous Coward · · Score: 0

    OK, I think this whole thing is a great idea. Tired of seeing graduates with no clue.

    at 11 I was writing small machine code routines for the spectrum by manually translating the op-codes into decimal and entering them in data statements

    at 13 I wrote a forth style compiler in assembler (using machine lightning) for the speccy. the listing from the zx printer was around 20 feet :)

    at 15 i was writing assembler for my atari st, patching the operating system to provide a number of missing functions.

    after that i started programming GEM. that was too much of a pain in the ass in assembler so I turned to C - after that it was a long and slippery slope to PHP :)

    knowing assembler give you a massive insight. comparing your favorite compiler code generation to what you can write helps you to help the compiler

  186. 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.

  187. Something like MC68000 would be better by ishmalius · · Score: 1
    I'm not saying that x86 is bad. It is sitting on almost every desktop already.

    But if you want to be able to teach assembly with fewer architecture-dependent quirks, try something with a cleaner instruction set, like MC68k or PowerPC. Orthogonal, linear address space, elegant indexing, etc.

    But the theory of the article is right. Too many programmers are coming out of schools with little or no understanding of the hardware. They have too much tunnel vision in their narrow field of expertise. And I agree with Assembly first, other languages afterward. This is much like teaching Calculus. Teach them the hard way first, then the shortcuts.

  188. Plus ca change, Plus ca meme chose by UtilityFog · · Score: 1

    New, huh? When I took Intro Comp Sci back in 1972 we had half a semester of IBM 1130 assembly followed by half a semester of FORTRAN. IMHO, '86 assy is a rotten machine to learn (or program) on. The real classic, of course, was the DEC 10; but if I were teaching an intro course right now I might be tempted to use a PIC. Speaking of which, is there a decent DEC 10/20 emulator out there? That might make a useful pedagogical tool...

    1. Re:Plus ca change, Plus ca meme chose by voodoo1man · · Score: 1

      You probably mean the PDP-10 (the DECSYSTEM-20 was just a renamed PDP-10). Here is an exhaustive list of resources for emulation. I recommend you try out ITS; it's probably the best environment ever made when it comes to assembly programming.

      --

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

  189. I Couldn't agree more ... by Anonymous Coward · · Score: 0

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

    Which is the reason all the best software is written in assembly.

    In my experience, the key difference between mediocre and excellent assembly programmers is whether or not they know assembly language.

  190. For CS students, sure by ArchAngelQ · · Score: 1

    If this is for truely CS students, I'd have to agree. I wish the corses at my local collage would have done this, and been structured to really teach me programming as a whole, with a set thread of corses, rather than piecemeal. I personally had to teach myself project management, code orginization, and design techniques. The results have been varied, but a deffinate improvement from the folks that I know that kept going to that same school for CS. A sad thing indeed.

    On the other hand, there is the serious consideration that there are perfectly valid computer career choices that don't need low level languages at all. Can you say Sci majors that need computer programming to be able to do calculations more than anything? I can think of a few more, but I don't think all of them are that valid of career choices ;)

  191. high level languages are just tools. by vijayiyer · · Score: 1

    I wholeheartedly agree. Introductury computer science courses should teach students about computers rather than focusing on how to code. Assembly language is a great way to do this. Just like you wouldn't want to teach kids how to add using a calculator, people shouldn't learn how to program a computer using a high level language.

  192. Everything old is new again by snStarter · · Score: 1

    When I took my first programming course for EE computer folks at UC Davis our first course was in PDP-11 assembly language. It was a great way to learn both an environment and the up-close details of how to make a machine work.

    The PDP-11 has a great orthogonal instruction set which let the student explore a wealth of different addressing modes.

    It was a great WELL ENGINEERED place to learn to write programs since it was engineered and didn't grow up loaded with garbage the way the 86 has. The macro assembler was excellent and RT-11 gave a great little runtime environment.

  193. "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 Anonymous Coward · · Score: 0

      No shit, you don't optimize everything to get .0000001 seconds out of it, you optimize the parts of the programs where it really counts. Loops that are being run all the time, and such.

      If one doesn't know assembly, they can't even do that.

    2. 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.

    3. Re:"Tight" code not always necessary by rastos1 · · Score: 1

      While I agree that the ablity to quickly produce maintanable and reusable code is important, it is still true that understanding stuff helps. Get over it.

    4. Re:"Tight" code not always necessary by James+Lewis · · Score: 1
      Well, if you had said "C programmer" then maybe it would make a little more sense. First because C is usually used for applications that need to be fast, and second because it has very few layers between you and the machine, compared to other languages. But you said "programmer", and that could be anyone programming anything with any language.

      The entire rest of my post dealt with that, and that seems to have escaped you. While knowing assembly may help you with C, it won't with Java. Even with C, knowing tricks like what you just described is only going to help if that trick is used MANY times throughout the program and that takes a percievable amount of processing time.

      The faster computers get, the less "tight" code will matter in general. It doesn't matter if one way is 10 times faster if the program takes .0001 seconds to complete rather than .00001 seconds. There will always be niches where it is important, but only there. It used to be that "tight" code was necessary for EVERY application, but that has become less and less true over the years, and will only continue to do so.

      What I think is misleading to those new to programming is to teach them that that niche knowledge is vital to being a good programmer period. Which is exactly what you said when you said, "The difference between mediocre and star programmers is that star programmers understand assembly language, whether or not they use it on a daily basis." That is simply UNTRUE. If you don't have the need to use it on a daily basis, then the program you are writing obviously isn't going to benifit from it.

      And lastly, I think trying to introduce someone to programming with the most cryptic and basic of languages is a poor idea. Especially if you are trying to actually interest them in the subject. Honestly, I can't think of a better way of turning people off to the field than to force them to learn programming with Assembly. It's tedious, and the things you can accomplish with assembly in an introductory course are going to be basic and boring.

      That's not to say I don't think it is important to teach it in a Computer Science course. A CS program should be about exposing the students to as many aspects of computers as possible, and the low level aspects of the computer are still important. I just think that teaching it in the first class, and telling students that THIS is what really makes a programmer good, is both a bad idea and untrue.

    5. Re:"Tight" code not always necessary by Anonymous Coward · · Score: 0

      There are still a number of cases where tight code is needed, but knowledge of ASM programming isn't normally the answer. Normally the best speed-ups can be found by using better algorithms instead of ASM level tweaking of simple ones. This is the kind of optimization a CS major should be learning. Being an ASM guru doesn't help in learning higher level CS concepts like best and worst case algorithm performance and the speed tradeoffs of various data structures. Here, being able to quickly implement various data structures to learn how each works is useful, and here you don't want the language getting in the way. This is an area in which high level computer languages (or even pretend languages like Pascal) shine. And if you know what you're doing as far as data structres go, that high-level implementation will be fast enough 99% of the time.

      That being said, I did pick up 68K, x86, and PPC assembler in various classes, and I use PPC assembler all the time at work. But I do hardware test and debug, so I'm not a typical programmer.

    6. Re:"Tight" code not always necessary by infochuck · · Score: 1

      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

      Word up on that. I can't tell you how many hairs I've lost trying to decipher some previous employee's thirteen nested iif's - yeah, okay, he got rid of 30 lines of code, but at what price? Good god, man, at what price?!?

  194. Teaching assembly language by Tim+C · · Score: 1

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

    Maybe it would be better if some of the curricula started teaching basic English instead...

  195. Depends doesn't it? by Kitsune · · Score: 1

    Really need both. Can't really say which is the better order as long as eventually both are learned. The primary thing I've walked away learning is that no matter what you call it, all program seems to be about is just about shuffling data around in sometimes very creative ways.

    The difference between learning the algos vs the machine is that divide between the theory and the practical. Remember Tanenbaum and his infamous "Linux is obsolete" quote?

    http://www.oreilly.com/catalog/opensources/book/ ap pa.html

    It really depends on what you want to put out. It seems like programming as a field is changing as well, with so many layers of APIs, wrappers, systems, it's becoming almost a danger to do anything but the plodded path...

  196. i386 ASM core is not like C (abstract)... ;oP by Anonymous Coward · · Score: 0

    Currently I write several processor dialects in assembly (8, 16, 32bit systems)...
    Wholly cripes! I sometimes can still speak English too... ;o)
    It is much more restrictive a language on any system, when doing data abstraction I must confess I would rather see a nice graphical GUI, IDE, and good hardware documentation (ha ha lol). In terms of quick & maintainable Application development assembly was never a "good choice". Some parts of the language may lack in flexibility because of architecture restrictions. The restrictions are bad for applications (unless you write BIOS firmware). However, the language that is spoken in decompiler terms is unmatched when it comes to analysing security problems, stability issues, and forensic data.
    Perhaps the allusion to Linux OS (btw: multi-Platform OS means asm instructions unlike C based languages sometimes look completely different on other processors) refers to a black-screen-of-death or perhaps a core-dump post crash analysis. Ah yes, I keep forgetting that the legacy i386 based instruction core seems to beget further development of legacy i386 based instruction cores with "new" features and even "Newer" legacy technology.
    Unfortunately, It is a full-time job keeping up & on the "In" with hardware designers who hardly ever show empathy for application designers (embedded Java VMs were supposedly going to stop this trend ;o] but even sun seems to be in danger of following the M$ business model of infinite version release).
    The assembly language seems like more academic trivia, but it is far more useful in teaching good data abstraction technique then any of the high-level languages. Some compilers are now using low-level optimizations and compression that get very close to the same code space and efficiency (not O theory though, its all the same in terms of algorithm design... Crap code is Crap code....) Oh yeah, what ever happened to good data abstraction into a good algorithm design? The answer, what has advanced calculus got to do with computer science... =o)

  197. 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.

    1. Re:ASM is not the place to start. by Anonymous Coward · · Score: 0

      This isn't really a new idea. The text book one of my CS classes used took it a step further and taught logic gates before moving on to assembly, then c. This seems pretty common for CompE programs. It's not a bad text, but I don't think I would have liked it had it been my first computer science course.

    2. Re:ASM is not the place to start. by akuma(x86) · · Score: 1

      I disagree. It is important for even an architect or algorithm designer to understand how the machine works underneath.

      First you start with simple gates. Then you build simple combinational circuits with the gates. Then you build latches. Then you explain how to build sequential circuits. Then you teach how to control the circuits with sequences of control signals. Then you teach them to store the control signals in memory - AH-HA - your first stored program!

      This is an extremely general concept. It is important for CS people to understand that languages, algorithms etc... are an abstraction of a real machine.

      You can think of C as a shorthand for assembly. C is like assembly but it automates register allocation and facilitates the naming of memory location through an abstraction layer.

      By showing how tedious it can be to grind through all of the details that go on in the gates and circuits, you teach the student the true value of abstraction. You teach them what the right abstractions are and why they work. Once you've learned all of that, THEN you can go on to the object oriented design principles which are yet another abstraction on top of non-OO procedural code. Motivating the reason for abstraction is crucial.

    3. Re:ASM is not the place to start. by Anonymous Coward · · Score: 0

      Imagine if this approach was used to teach math elementary school students. First you'd teach the basics of our math :

      For all a in the set of real numbers :
      a + 0 = a
      a + b = b + a
      (a + b) + c = a + (b + c)

      Then help them derive

      if a = b, then a + c = b + c

      Then define negation :

      -a = 0 - a.

      And help them derive the basic rules for subtraction.

      Once they've done that, you can move on to more advanced topcis, like

      1 + 1 = 2
      1 + 2 = 3

      and so on.

      My point is that a lot of education is filtering out stuff that students don't need to know. For 1st graders, learning the algebraic framework that all of mathematics is based on is not necessary for them to learn how many apples there will be if Mary has 4 apples and Joe has 2. You start with the basics, such as memorizing math tables for single-digit inputs, and then show how to carry/borrow to add longer numbers, and so on. Once these basics are understood, then you can teach how they fit into the bigger picture, but trying to teach the fundamental theorem of algebra to 6 year olds isn't going to get you very many teacher of the year awards.

      Likewise, a 1st semester CS student does not need to understand the chemical reactions required to dope an N or P MOSFET in order to sort a list of numbers. This is what you're calling for, except that you stop the level of understanding at some arbitrary level of abstraction (the gate level in your case). If understanding how computers works without providing any levels of abstraction is important, as you claim, then they need to know the quantum mechanics which describe how electrons move in semi-conductors. Even this is a level of abstraction, but it's about as low level as you can get.

      On the other hand, if you agree that some level of abstraction is necessary, then you need to look at what level of abstraction is important for the level of the student. And in this case, teaching a 1st year CS major how to design a computer is only going to get in the way. It'll do nothing to help them learn how to design an algorithm or data structure, write a program, test it, document it, and so on. It's useful knowledge later, but just because it's the fundamentals of how a computer works doesn't mean that it should be the first thing a student learns.

    4. Re:ASM is not the place to start. by dinog · · Score: 1
      In many ways I agree with you, but the best programmers I know didn't start with anything in their comp sci courses. They already knew several languages. This is the big problem : programming should start much earlier than the university years.

      I'd say pascal is still a very good starting language. It teaches you not only how to code, but it also forces you to think about types and organization. You can also write very readable code in pascal, which is something too few programmers learn (particularly perl programmers. -ha ha, dont shoot me) Pascal even has pointers, so it can be used to teach stacks, queues, and other basic conceptes of comp sci. However this should be high school era, not first year comp sci.

      First year comp sci should be assembly and OO. The OO language doesn't matter. The course should pummel the students with the OO concepts. Student should not only write working programs, but be FORCED to defend their choices of stuctures and data types. This is something we see in other degrees, but sadly lacking in comp sci. Not only would this improve design level decisions, but it would also help a future programmer hanlde criticism in the real world, and also be able to distinguish constructive criticism from criticism of lesser value. Also lacking and very needed is a class where students don't write any new programs, but simply update and "maintain" old code written by other people. If you don't understand why readable and well organized code is important, then working with an poorly designed program with many separate modules will teach you this.

      At the same time, students should take digital combination logic. Learn how to build a serial port (for example) and you will have a much better understanding of what the driver is doing. Build a few reasonable complex circuits with nothing but registers, flip flops, and a few other basic parts will also be a good intro into more advanced circuit design, and also give programmers a better understanding of what is actually going on inside the CPU.

      Finally, I believe a compiler writing course or project should be mandatory. It may be at some schools, but certainly not all of them. This ties the knowledge of asm into high level languages.

      Dean

  198. i am a comp sci and was taught ASM by Anonymous Coward · · Score: 0

    You have to make the difference between schools like ITT, DEVRY and real Comp Sci schools that teach the real stuff such as system programming and other stuff. But again, you cant force anyone to go to the bottom. Comp Sci has been created to allow people to move to a higher level of abstraction. But you need people at every level. From people that have no clue of what a stack is to people that understand how the flip flops in his ram act to store his porn videos. It's all about placing the people at the right place. Computers spawn EE->CE->CS . If you want someone good with ASM, you re more likely choosing a CE person. Someone in CS will be more interested in Algorithms and other stuff that rely on the language API which is a trusted component (u assume people who write languages know their stuff). And also, ASM is fun, but its also chip specific. So what is important is the concept more than the application to the computer: stack, registers, memory addressing etc than the specifics of an X86.

  199. Knuth did this 30 years ago by treerex · · Score: 1

    Donald Knuth did this 30 years ago in "The Art of Computer Programming", by providing sample implementations of the algorithms in MIX, his assembly language. There is something to be said for this: he justifies its use in the preface to Volume 1.

    Certainly having to learn assembly language gives you a better understanding of the machine: I learned alot peeking and poking (no pun intended) around with the catridge-based monitor on my VIC-20 in 1981, which put me in good stead for when my Apple ][ arrived: remember when the assembler listing for the ROM was included in the box? Those were the days. Of course back then you didn't have much software to use, so you had to write your own. Now you don't have to.

    I'm an advocate of starting CS students with a very high-level language, like Scheme. That allows them to learn to _program_ instead of wasting time learning a _language_. Once you know how to program, languages can be picked up relatively easily. As long as the students are exposed to lower-level languages later, things are good. People coming out of good schools knowing Java and Scheme only are in for a rude awakening when they hit the real world.

  200. And the problem is? by Optical-i · · Score: 1

    What's the problem with getting people interested in CS turned off by assembly language? Those individuals are most likely the students taking the major because back in the 90's they heard there was "big money in computers." They're 50% of the people bitching about not having jobs because they never cared enough about computers and how they work to get the best understanding of them.

    Now I expect to hear complaints from people saying "I don't have a job, and I know [x], [y], AND [z]." I'm not talking about you.

    At my school I watched the students who had no interest in computer or electronics drop like flies as we took basic classes in logic gates, digital circuitry analysis, etc. I was happy to see these students leave because they were not only wasting their time, but my time any money as well by asking their foolish questions. These were the students who complained, "But why do we need to know this? We won't use this in industry."

    Perhaps you won't use much Assembly in industry, but as stated above, it sure as hell will make you a better programmer and a worth-while employee.

    *steps of soapbox.*

    my two cents.

  201. 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

  202. asm training is essential by presearch · · Score: 1

    I spent a year in the late 80's on a three person team writing a paint package entirely in assembly for Truevision.
    It all ran on the TI graphics chip on the frame buffer. The result was fast, tiny, and surprisingly versatile,
    fast or faster than Gimp does today on your average Linux box, which is surprising considering the CPU speeds at the time.

    I think that every CS student needs at least a couple semesters of asm before they can call themselves
    a computer scientist. There's no better training to teach you how to avoid bloatware and feature creep and
    how to approach things with simplicity in mind.

  203. Cool by mnmn · · Score: 1

    There was a time when obscure objects (C++) was cool. That led to bloated designs, spending too much time on reusable code that wasnt really reused, memory leaks and of course highly unoptimised binaries.

    Programming with abstract objects is no fun. Its like youre sitting on a machine and have NO clue what its gonna do with your typing. Youll be a slave to the IDE and the language. Good code comes from the pride of developers that are pefectionists, a lot like the BSD developers. They didnt develop much over a long period of time, but spent time making it perfect from the ground (hardware) up.

    I enjoy developing for embedded chips for the same reason. Youre given hardware whose specs you know exactly and its functions are 100% predictable.

    Giving students that same taste of robust predictibility (like flooding address A0000 in DOS DEBUG) will interest them in designing everything from the ground up all perfect and efficient. That kind of software development just happens to be far more interesting than the boring Java classes and professors.

    --
    "Give orange me give eat orange me eat orange give me eat orange give me you." -Nim Chimpsky
  204. Um, that's 256 bytes. by rfmobile · · Score: 1

    a 255-byte range from address $00-$FF

    Um, that's 256 bytes. Hey, on the 6502 and zero page memory, every byte counts!

    -rick
    1. Re:Um, that's 256 bytes. by Anonymous Coward · · Score: 0

      He said zero though

  205. Re:uhm by Anonymous Coward · · Score: 1, Funny

    how about I correct you if you're anal?

  206. Leave it to the compiler by Anonymous Coward · · Score: 0
    Who is this guy trying to kid? I can just about believe that it would be useful to learn assembler if you were studying computer architecture. But programming?

    Suggesting that all good programmers (should) know assembly language is spurious. Most old programmers know assembly; many good programmers are old; consequently many good programmers happen to know assembly language.

    Does anybody actually program in assembly language these days? I thought compilers had been beating hand-coded assembly for years. Certainly my old CS prof gave up competing against optimised compiler code 15 years ago.

  207. Undestanding is what counts by nurb432 · · Score: 1

    If you dont understand how things work at the register level, then you dont have any clue what you are really doing..

    Learning at that level, using assembler or even microcode is what it takes.

    Its a shame that has been lost on todays generation.

    Any ignorant boob can drag and drop components.

    --
    ---- Booth was a patriot ----
  208. Teaching Assembly by FBP · · Score: 1

    At work about twenty years ago (I was a EE for a power utility), I taught myself basic 360 assembly by writing a Forth interpreter (I had to have a goal before I could learn anything). Six months later, a local business oriented community college got my name during its search for someone to teach an evening class in 360 assembly to some Cobol programmers at a bank. This conversation followed:

    Q. When does the class start?
    A. Tuesday. (it was Thursday).
    Q. What textbook are you using?
    A. What textbook would you like to use?

    Always ready to accept what I didn't have sense enough to avoid, I took the job. I selected a textbook from the local university, wrote a syllabus and grading plan and I was as ready as I was going to get in five days. I figured that anyone willing to work with JCL would have no problem with assembly, but just in case, I had a plan for motivating people to cherish assembly language programming.

    During the first half of our three hour class I taught machine code, and hinted as we went to break that by the end of the semester we would know 160 op codes. After that, assembly was a god-send.

  209. Re:Learn x86 assembly - realize x86 is a bad platf by bcd · · Score: 1

    I think Motorola 680x is one of the most elegant assembly languages ever. Does the word "orthogonality" mean *anything* anymore?

    "We don't need no stinkin' mmx"

  210. Re:I want to shout... by Sebastopol · · Score: 1

    I'm surprised you could reach your keyboard from way up there on your high horse.

    Thank your for enlightening me Mr. Pointer Expert. You truly articulated your point with one anecdotal cliche after another.

    -Mr. Naive Idiot

    --
    https://www.accountkiller.com/removal-requested
  211. Hey Moron Brain by Anonymous Coward · · Score: 0

    There are many, many such 'emulators'. They are called debuggers.

  212. Really -- the rich and cutting edge disagree by Anonymous Coward · · Score: 1, Interesting

    I and others disagree. Here's two:

    Consider Paul Graham: Beating the Averages. Considering that he's the kind of guy that gets invited to MIT as a language wizard (along with Guy Steele, David Detlefs, Martin Rinard, Jonathan Rees, and David Moon), and considering that he has a net worth in the (hundreds of) millions, I'll go with his choice: abstraction rules.

    Consider Erann Gat from JPL (the guys who get to send robots to Mars and build autonomously controlled space probes) disagrees and empirically proves it.

    Diamond Walker emphatically endorses LISP - his story is very compelling.

    The list goes on and on: Dan Friedman, Mitchell Wand, Shriram Krishnamurthi, Christian Quiennec ...

    But, to paraphrase Graham, if you don't know these people I guess I don't have to worry about you.

    1. Re:Really -- the rich and cutting edge disagree by johnnyb · · Score: 1

      Actually I am very familiar with these people and with the perspective they come from. However, I think that doing abstractions FIRST is a bad idea. It is better to do the low-level first and then you know what it is you are abstracting. My favorite programming language is Scheme. However, in all languages, knowing assembly language helps me to know what the actual computer is doing.

  213. 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 ComputerSlicer23 · · Score: 1
      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 fund.

      I remember the instructor in architecture explaining what fun it must have been to deal with that architecture, because you could copy huge amounts of memory in a single instruction. That the page faulting, and the re-starting was very complex because a single instruction could cause multiple page faults, and could have several page ins and page outs...

      What fun, what fun.

      Kirby

    2. 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.
    3. 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

    4. 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
    5. Re:Actually, they DON'T. by be-fan · · Score: 1

      There was an interesting study done comparing the performance and productivity of C++ vs Lisp vs Java programmers. Results are here.

      One very interesting thing they found was that while the best C++ programs were faster, the average Lisp program was faster*. Programmer experience could not account for this.

      In retrospect, its easy to see why. When you write clean, straight-forward code like you would in a production environment, its much easier for the compiler to optimize high-level code than low-level code. Compilers for languages like Lisp/Scheme/Haskell/etc do all sorts of optimizations that existing C/C++/Java compilers either don't do (forgotten technology) or can't do (pointers cause lots of problems).

      My point is that programming at a higher level, in general, allows the compiler to do more optimization than programming at a lower level. Given infinite time, an asm programmer will always be able to crank out faster code than a C++ programmer, who will always be able to crank out faster code than a Lisp programmer. However, in the real world, it may very well be the case that giving the optimizer more meat to work on will result in a program that is ultimately faster over all.

      --
      A deep unwavering belief is a sure sign you're missing something...
    6. Re:Actually, they DON'T. by be-fan · · Score: 0, Redundant

      There was an interesting study done comparing the performance and productivity of C++ vs Lisp vs Java programmers. Results are here.

      One very interesting thing they found was that while the best C++ programs were faster, the average Lisp program was faster. Programmer experience could not account for this, since the C++ programmers were much more experienced than the Lisp ones.

      In retrospect, its easy to see why. When you write clean, straight-forward code like you would in a production environment, its much easier for the compiler to optimize high-level code than low-level code. Compilers for languages like Lisp/Scheme/Haskell/etc do all sorts of optimizations that existing C/C++/Java compilers either don't do (forgotten technology) or can't do (pointers cause lots of problems).

      My point is that programming at a higher level, in general, allows the compiler to do more optimization than programming at a lower level. Given infinite time, an asm programmer will always be able to crank out faster code than a C++ programmer, who will always be able to crank out faster code than a Lisp programmer. However, in the real world, it may very well be the case that giving the optimizer more meat to work on will result in a program that is ultimately faster over all.

      --
      A deep unwavering belief is a sure sign you're missing something...
    7. Re:Actually, they DON'T. by Anonymous Coward · · Score: 0

      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.


      That is so very, very wrong.

      C, for example: compile a simple for loop
      x=0;
      for(i=0;iLESSTHAN16;i++)x++;
      your compiler will generate a heap of pushes and pops and overall just generate a real mess.
      x=0;
      void xfunc(void)x++;
      for(i=0;iLESSTHAN16;i++)xfunc();
      will generate a TON.
      I've specifically tested this with functions that span very many loops, such as creating a gradient screen fade, alpha blending, lighting, typical graphics stuff that works over huge buffers.
      And yes, I optimize the c code as well (such as using backwards while loops so the generated asm code uses better opcodes)
      The benefits of coding -these parts- in asm have practically doubled or even TRIPLED the speed of some otherwise really slow routines. A very good application of asm is to optimize specific parts of code that need it, and leave the least important stuff to c.

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

      I'm afraid I wasn't around for PDP11/VAX, but I can tell you with absolute certainty that 68k is most definately RISC, with it's 16-bit length instruction codes.
      For humans, RISC is a nightmare compared to CISC.
      The opcodes are a lot easier to decipher and patch over in debuggers, the best example I can think of is that I nearly have the entire 255 opcode table memorized for 65816 asm after having used it for so long, and because of its redundancy (LDA #$=a9, SBC #$=e9,AND #$=29,etc) I would NEVER be able to memorize the bit masking logic for all of 68k.

      As far as your statements from above, you're right in that it takes a lot longer to write the code in asm than c, and the benefits become less and less apparent... but 50% speed increase is still 50% speed increase. It is my belief that programmers stick to this logic and that is why we end up with all this `visual basic' crap. Here I'm on a nearly 3ghz pentium iv and these business tier applications written in VB choke and die and lag unbelievably, whereas I remember an n64 emulator that ran at 60/60fps on a 400mhz cpu. Speed isn't everything, but I fear that people will continue to code worse and worse, and through more and more translations and markup that we will continue to need amazingly powerful processors for what could have been done on much cheaper hardware.
      What's more valuable, 50% more time of one person coding an application, or 2 million people having to buy a faster processor to run said application?

      I also have no mention of the credentials of the people tested in x86 programming. It's very easy to suck at x86 asm, just like it is at c. And there are certainly FAR less x86 experts than c experts. With c, you don't even have the ability to learn certain tricks with x86, such as that it's not the opcode count that matters, but the total functions' cycle count. a DIV instruction is a hell of a lot slower than a SHR instruction, for example.

      At any rate though, I'm sure knowledge of asm will fade out eventually, even the GBA has compilers for it now. It's a shame, but oh well. So long as they don't prevent people from writing assembly language code for systems, I don't care, I'll program the way I want to and you can program the way you want to.

    8. Re:Actually, they DON'T. by Anonymous Coward · · Score: 0

      Is that why one of the highest level programming languages, visual basic, is so immensely fast, compared to their c/asm counterparts?

    9. Re:Actually, they DON'T. by be-fan · · Score: 1

      As far as high level languages go, VB, Java, C# are pretty crappy ones. VB is high level, but doesn't use that to give the programmer power, but rather to baby him and restrict him. Java and C# are really mid-level. All of them have relatively crappy implementations. For example, the entire distinction between primitives and objects in Java is unnecessary. We've had the technology to make "objects all the way down" languages very fast for quite awhile now. Hell, Java's predecessor, Self, pioneered many of these techniques!

      In any case, your logic is flawed. Just because its possible to write a slow high-level language (VB) doesn't mean that there aren't lots of fast high-level languages (Scheme, Common Lisp, Dylan, Ocaml, Clean, etc).

      --
      A deep unwavering belief is a sure sign you're missing something...
    10. Re:Actually, they DON'T. by Anonymous Coward · · Score: 1, Informative

      You missed the point.

      This:

      (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.)

      Was the exact point of the post you spent forever "refuting". He didn't say software written in assembler was better, he said people who knew assembler produce better code in high level languages. Maybe you ought to spend more time learning the English language, I've heard it's a useful skill to have.

    11. Re:Actually, they DON'T. by shmat · · Score: 1

      I agree completely. I started my career coding in assembly language (yes, I'm old). When I started using C I thought I had died and gone to heaven because I was 10 TIMES more productive with C.

      Like most assembly language programmers, I went through the compiler generated assembly for my first couple of C programs because I wanted to see how bad a job the compiler did. I found that the assembly was hard to understand but very efficient. There were very few places where I could have done better.

      As to learning computer science, I think the only value in using assembly language as a teaching tool is that assembly language requires extremely careful attention to detail and patience. So maybe it serves as a screening process because good developers need lots of both. However, algorithms, data structures, OO, patterns, etc. are far more important to learn than assembler.

    12. Re:Actually, they DON'T. by renoX · · Score: 1

      > I can tell you with absolute certainty that 68k is most definately RISC, with it's 16-bit length instruction codes.

      Depends on your definition of RISC, but for me RISC corresponds also to Load/Store architectures: easily pipelinable instruction set.

      So 68k is definitly not a RISC ISA..

    13. Re:Actually, they DON'T. by alannon · · Score: 1

      The primatives/objects issue is pretty much moot right now for Java, as of 1.5, since it now supports automatic boxing/unboxing of primatives, just like C# does.

  214. I wouldn't buy it w/o seeing more by glitch23 · · Score: 1

    I'd want to see a TOC and some excerpts before I plunk down $35 for the book. It's not on amazon and the author's site gives no information like that. But, you CAN get a larger image of the front cover. Maybe that will get me to buy it over another book.

    --
    this nation, under God, shall have a new birth of freedom. -- Lincoln, Gettysburg Address
  215. Assembly to teach architecture: A new concept? by scdeimos · · Score: 1

    Hardly.

    When I studied IT in the 90's (that'd be 1990's, I'm not *that* old) one of my subjects was Computer Architecture, studying different computer systems, processor architectures (CISC/RISC, ring stacks, etc) and support hardware down to the register and inter-connects level and beyond.

    All of the practical work in this course was done in assembly language to ensure that we grasped the guts of the particular item. While it was mostly x86 and under messy-DOS (one of our assignments was to write an INT33 mouse driver) we got to play on other stuff too like Zilogs and Motorola 68x's in various boxes.

    This was one of my favourite courses since I'd been assembly programming long before I went to Uni and wasn't panicking like some of my classmates. :)

    I think everyone in IT should have done something like this (it seems a lot the up-and-comings think "assembly" has something to do with IKEA) as it gives you a really good understanding of what's going on behind the scenes and a view to conserve system resources and be more successful at debugging other than saying "Crap, it doesn't work! Can you help me?"

    A modernized version of this course could even have a hardware project component with PIC's and STAMP's being so cheap and readily available nowaydays.

  216. Computer Science as a Mathematical System by Anonymous Coward · · Score: 0

    This same principle proves true for studying mathematics . In order to understand the system as a whole, you must first understand the basic constructs, or thereoms.
    In computer science, it can be assumed that the basic constructs can be found in assembly language.
    Even lower level math students get some exposure to thereoms, so why should Computer Science be any different.

  217. 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.

  218. Race car driver? by Roger_Wilco · · Score: 1

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

    Do you really think the driver needs to know how the car works? What a strange analogy.

    1. Re:Race car driver? by CreateWindowEx · · Score: 1
      Actually, in any form of auto racing, it is vitally important that the driver have a very good idea of how the car works. Most auto racing events have a practice session before the race--the driver's feedback is vitally important to the crew chief or race engineer to help make the car go fast and handle well at that track at the temperature/humidity/conditions of that day.

      During the race, it is very common in many types of racing that various adjustments can be made to the car, either during a pit stop or via in-cockpit adjustments such as anti-roll bars, turbo settings, and brake-bias. While some types of racing allow telemetry, the feedback of the driver is still crucially important.

      Another thing a driver must do in a race car is be aware of the condition of the vehicle, and be able to react swiftly and correctly to any change or problem--is the engine running hot, is the car running on fumes, is shock absorber malfunctioning, did that bump in the last turn tear up the air dam too much reducing front downforce, etc.

      An analogy that I would draw is that a good programmer must have a pretty good idea of what's going on under the hood even while coding in a high-level language. Even if you code in C++ or Java, you should have a pretty good idea of what the generated machine code (or byte code) will look like, instead of thinking that it's all "magic", the same way a race driver should be able to imagine how the suspension compresses and the tire contact patches load up as he or she rotates the steering wheel and smoothly adds throttle...

  219. Good programming practices by Kris2k · · Score: 1

    Indeed, learning ASM before, or while you're touching a simpler programming language is a great step to learn on how to write tight and efficient code.

    However, it's not just the comprehension of how the CPU works that is required. I've noticed many junior programmers, when they code, all they write and think about is inside their own little box surrounded by their compiler. Not thinking of network performance issues, interrupted database connections, data scalability, the fact that the day there is a bug, the presence of external dependancies, etc..

    The problem resides on understanding the impact of all systems and subsystems that your program will be calling-out. When you program, and you're calling-out ressources that are outside of your program, you must be aware of what you're doing and who are you affecting. And, while you're at it, anticipate worst-case scenarios, like growth issues, fucked-up customer networks, the firewalls that break all the fun of calling-out RPC over a wan, etc..

    So, ASM is a good step, but, it takes more than that, you need to understand (at the very least, conceptually) every single element that constitutes your production environment.

  220. I taught myself assembly, and I disagree by ScorpiusFan · · Score: 1

    I don't think learning assembly can necessarily make one a better programmer.

    I taught myself assembly a long time ago, and 20 years later I'm making 6 figures programming VBA macros for Excel. It's more relevant I know the ins and outs of the Excel VBA objects rather than lower level registers and memory allocation, though I do have to worry about memory leaks if I don't close out my objects.

    "Easy" languages can help make the job simpler to accomplish, especially in cases where staffing is low and business demands are high.

    Besides, as we design higher level languages to build software tools for us, I think the understanding of lower-level computer operations may not be that relevant to some programmers.

    1. 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.

  221. There's a certain point... by IshanCaspian · · Score: 1

    ...where doing things in ASM isn't educational, it's torture. If you want to make kids lean how to do things in ASM, that's fine...but anything more than that is a waste of time. ASM is all well and good, but most CS curricula fail to put it in its proper contex. Nowadays, you use ASM in small functions where speed is absolutely imperative. Learning how to shave a few cycles off a nested loop in C++ is useful...making kids spend hours hunting for typos when pushing the stack is just a waste of everyone's time.

    I would personally have students start in a C++ compiler, and have them drop down to ASM and write a print function...then say ok, on to the next thing, but you get to use printf() whenever you want, etc.

    --

    But there is another kind of evil that we must fear most... and that is the indifference of good men.
  222. Its about time some one woke up by nurb432 · · Score: 1

    Today's generation has zero clue what it really takes to push those bits around.

    All they know how to do is drag and drop widgets and call it 'programming'.

    Or stick a Motherboard in a case and claim they can 'build computers'.

    No clue.

    Until you learn how a cpu works internally, and can build a system from scratch from just a data book, and then recite hex code for assembler you don't know diddly.

    --
    ---- Booth was a patriot ----
    1. Re:Its about time some one woke up by WebMasterJoe · · Score: 1
      Until you learn how a cpu works internally, and can build a system from scratch from just a data book, and then recite hex code for assembler you don't know diddly.
      Now, I really hope you're being sarcastic. Because while you're building a system from scratch, some kid down the street is flipping burgers to pay for a $300 system that will kick your system's ass thirty-five times before you can move one byte to AX.

      It might be nice to know everything about computers, but most people just don't have that kind of time - they're busy watching movies, cooking food, reading books, raising children, playing music, painting pictures, helping family, teaching students, building houses, fighting fires, and writing simple, relatively slow vb scripts that still get the job done. Not everybody can be so hardcore about programming.
      --
      I really hate signatures, but go to my website.
  223. 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/ .

  224. I wonder if they know what they are asking for? by PetoskeyGuy · · Score: 1

    Look again.

    send us
    YOUR
    Action
    Shots!

  225. 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.

  226. Disclosure, not disclaimer by Anonymous Coward · · Score: 0

    Just a nitpick from an AC. "Disclosure" is what is missing here.

    "Disclosure" is when you reveal your hidden interest, like the submitter's interest in the book that he's pimping. "Disclaimer" is when someone says that they are not speaking officially for someone else.

    1. Re:Disclosure, not disclaimer by FreshFunk510 · · Score: 1

      True that. Thx.

      --


      "Injustice anywhere is a threat to justice everywhere." - Martin Luther King, Jr.
  227. Re:assembly? bah - real men program with punchcard by autophile · · Score: 1
    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.

    If assembly coding were a true Lovecraftian nightmare, then what would happen is this:

    Programmer:

    mov ax,[sp-2]
    mov dx,[sp-4]
    div dx

    Noisome Bubbling Voice: Thou hast not installed a division by zero interrupt handler. Great Cthulhu requires one pint of thy blood, and thou must sacrifice the value in thine cx register.

    --Rob

    --
    Towards the Singularity.
  228. x86 assembler is a bit harsh for first years! by Anonymous Coward · · Score: 0

    I would have thought throwing you into x86 ASM would be a bit harsh.

    In first year uni we learnt R2000 MIPS Assembler which is the simplest of the MIPS family of processors,

    which is alot cleaner, only 32 registers, all instructions are the same size, most instructions run in one clock cycle. This makes it easy to pick up, and once you understand it, migrating to x86 asm is pretty easy

    x86 assembler is not a good beginner language, it has a lot of confusing addressing modes and exceptions and generally it's alot more complicated as it incorperates backwards compatibility with Intel 8086.
    Instructions vary in length, complexity and execution time and i imagine would confuse a bunch of first year uni students who have never programmed before

    I remember first year Computer Science, people had enough problem understanding C, things like understanding how pointers work is quite a challenge for students who 30% have never programmed before and 70% have probably done nothing more than introduction to Visual Basic.

  229. I started learning with assembly by bigberk · · Score: 1

    I thought this was very interesting when I saw the article. I started learning computer programming with assembly language in the 1980's. In my case, I was too cheap to purchase any proper language (like C etc.) so I settled with playing around with DOS's DEBUG (this is an interactive assembler). I gained an understanding in x86 assembly fundamentals which along the way taught me plenty about interrupts, timing, device and memory use of course the fundamentals of CPUs.

    Though to many people this seemed to be a weird way to learn, I was very happy with it and it was nice and challenging to code entire applications in assembly language. My freeware is still posted, actually :)

    Since then I've learned C++, Java, etc. but I've really settled on C. It makes the most sense to me from a power and efficiency point of view, since I'm mainly concerned with applications where performance is critical.

  230. 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.
  231. The only way by tuxlove · · Score: 1

    This is the only way to truly learn about computers and to be a true programmer. It should be required learning before moving on to high-level languages.

  232. 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.

  233. Re: Don't program at all by Anonymous Coward · · Score: 0

    If you are too weak minded to learn a language as simple and basic as assembly, I'd suggest you stay away from all computer programming. We don't need another lousy programmer.

    Fact is assembly is all about logic and moving numbers around/setting bits. It is about as simple as it gets if you can think logically.

    One thing that has peeved me... I wanted to learn ASM when I was about 14/15 years old. I went to my high school's head of computer sciences to ask him about learning such a language (either as a class or on my own).

    Being the naive "adults know best" type of kid, I just took the guy's word for it when he said "you need lots of math". DUHHHH. Fact is you don't.

    I wish I hadn't given up at that point (sticking to slow as molasses BASIC). 3 years later I bought myself a book, read a few chapters and off I went coding games and demos on my C64. I really regret not learning it when I first wanted to. I could have accomplished much cooler things...

  234. joke by Anonymous Coward · · Score: 0

    way to totally ruin it

  235. 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 ?
    1. Re:Best assembler by macjohn · · Score: 1

      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.

      As I recall, the 68K was pretty much an imitation of the PDP-11, constrained by 1975 die size limitations. The 8080 begat the Zilog Z80, which begat the 16-bit Z8000. The main thing I remember about the z8000 is that I could never understand the paged addressing scheme.
      I also remember that nearly every engineering group found the Z8000 superior to the Intel's 16-bit 8086, but by then intel had learned how to get decisions made in board rooms instead of engineering labs. Operation Crush!

      --
      --Hi. I'm in Portland and it's raining. This appears to be a permanent condition.
    2. Re:Best assembler by rs79 · · Score: 1

      Maybe it seems that way to you by looking at it but in the time interval bewteen working on PDP-11s that cost insane amounts of somebody elses money and being able to actually (!) own a computer of my own, the 68K stuff was a little scary and stupid looking, just as the vax instruction set made you wonder if DEC has lost it's way.

      I've thought a lot about how you'd improve a PDP-11 instruction set and I'm not sure you can a whole lot really. Bigger address space, larger word lenghts while preserving the smaller ones perhaps, but that's about it.

      The Z80000 (not Z8000, which I've used, I'm not sure I've ever heard of an actual working Z80000 system, but on paper that seemed to me to be the one to get) wasn't a lot better but it seemed to be a bit more sane then the 68K.

      But, Moto has working 32 bit silicon, and nobody picked poor Zilog and all those years of Z-80 loyalty went doen the drain.

      Of course all Moto had was cpu silicon and if you were trying to build a computer to sell in the very early 80's the fact that Intel has working dma controllers, CTC's, serial and parallel ports and so on and so forth was not lost on you; Moto did't have this stuff the bastard hardware engineers everywhere stuck it to all programmers for the next lifetime by announcing they had to use the 8086.

      --
      Need Mercedes parts ?
    3. Re:Best assembler by surprise_audit · · Score: 1

      Dunno about PDP-11, but back in, ummm, 1979 I had to write a program in PDP-8 assembler for Computer Science coursework at University. And that was write and hand-compile into binary... The task given to us was to write a program to add yards, feet and inches. I'd already had some practice writing pseudo-assembler on an early TI programmable calculator, so my PDP-8 program was among the shortest that year.

    4. Re:Best assembler by rs79 · · Score: 1

      The PDP-8 instruction set was pretty miserable, you have my sympathies. The joke used to be it had 4 instructions and one of them, "operate" did everything. They were pretty obsolete by 79.

      Our high school taught us a hypothetical machine langauge in 1970 which ran on an IBM 1130. Then we graduated to FONTRAN on punched cards. During the summers a bunch of kids rewrote the OS on that pig and made it about a zillion times faster. DEC machines were a real joy to use after that mess, and DIBOL made progamming a PDP-8 sort of ok, but the real fun was when we got to use the 11's; we never looked back.

      --
      Need Mercedes parts ?
  236. Sounds like.... by sheapshearer · · Score: 0
    I now use . . . Visual Basic (when the need arises).
    Sounds like a case of Slashdotters Gone Wild
  237. The Story of Mel by AntiCopyrightRadical · · Score: 1

    Real Programmers wrote in machine code.
    Not FORTRAN. Not RATFOR. Not, even, assembly language.
    Machine Code.
    Raw, unadorned, inscrutable hexadecimal numbers.
    Directly.

    The Story of Mel

    --
    Abolish Copyright. Restore Freedom.
  238. 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.
    1. Re:Computer Engineering Perhaps? by Anonymous Coward · · Score: 0

      I'm currently in my last year of Computer Engineering with a software specialization so I don't really agree... you seem to have forgotten about us Comp Eng software guys.

      While I have taken courses in digital circuits (and god forbit analog circuits...ewwwwwww) logic, computer organization and architecture etc I also take and have taken quite a few software courses. At least at RMC (thats Royal Military College of Canada) Computer scientists take more classes about data structures and algorithms but they don't take or at least don't have to take a lot of the more management oriented courses we Engineers take.

      Us Comp Eng software guys learn way more about software architecture, integration of software systems, planning, estimating etc. Along with the hardware and electrical courses I've taken, I've also learned about UML, I'm taking a real-time software course now, had a distributed systems class, my 4th year project is entirely software based, I've taken a course in software work products and maintenance, taking one now on software processes, I really enjoyed assembly class last year...

      guess what I'm trying to say is that Computer Engineering isn't limited to hardware In fact there are Software engineering degrees nowadays (I wish I could have gotten one of those and not taken all those damn circuits courses...) and that at least here we learn both low and high level languages (Java, assembly, a little C, and a very small amount of C++, it's hardware but I'm quite good with VHDL as well which of course is pretty similar to ada) We do start with Java but I mean as long as you can make the connections between different languages in your mind you can learn any language high or low level.

  239. Assembly is fun and easier to use by Anonymous Coward · · Score: 0

    I learned BASIC and Assembly Language together when I bought a C64 a lifetime ago. I found Assembly to be the easier of the two, although more time-consuming to write and debug.

    And Assembly is a lot easier to write than any Object Oriented language I've ever seen. If I had the time, I'd write everything in assembly, but I don't, so I won't.

    By the way, you have never lived until you've written 4K of assembly code on a Machine Language Monitor instead of an Assembler (C64 graduates know what I'm talking about. Remember HesMon?). No nmemonics for variables or addresses -- all hex, baby. That is a lot of tedious coding, so you learn the value of small programs.

    The last commercial program I helped write took up 8MB on the disk. Oy!

  240. I'm a current CS Major by 1000101 · · Score: 1

    I am currently a Computer Science major (last semester!) and one of the required courses is Assembly on the SPARC architecture. I took the class a couple of years ago, but at the time it was the first semester since they had switched from x86 to SPARC. I'm not entirely sure why they switched, but I really appreciated learning an architecture that I don't use on a day to day basis.

    1. Re:I'm a current CS Major by drskrud · · Score: 1

      Ditto here, only in our first semester we studied NASM on Linux x86 architecture. It was my school's first attempt at using Linux from the start, and there we kinks in the program. One reason I liked using the x86 architecture, however, was that I could easily do all my assignments at home and it gave me the opportunity to mess with things outside school

  241. I'm sorry... by NewWaveNet · · Score: 1

    I clicked on the OSDN ad from Microsoft with the "FREE .NET STARTER KIT" so that I too can be a CS wiz4rd.

    Seriously, when did OSDN start lapping up Microsoft ads?!

  242. Link Correction by AntiCopyrightRadical · · Score: 1
    --
    Abolish Copyright. Restore Freedom.
  243. Quit Confusing Computer Science and Programming by Anonymous Coward · · Score: 0

    I know many Computer Scientists who spend their whole day at the white and black boards or on paper.

    Rarely do they touch code and rarely do they ever need to.

    Computer Science has some programming
    Programming is not Computer Science

  244. 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.

  245. "Type" the ones and zeroes? by rk · · Score: 1

    What a luxury that is. Why, in my day, we had to stick the ground wire up our arses and alternatively stick the "1" wire and the "0" wire in our mouths.

    It really sucked when the ground wire and the zero wire were the same color, too. Boy, you didn't want to get that messed up.

  246. Re:Pet peeve of the year (was Re:Linux x86 assembl by geekoid · · Score: 1

    there is a difference been an architect and a designer.

    an architect lays out what a program will do, and how it will do it.
    A designer lays out how the code of choice will facilitate the architects design.
    an engineer puts it together in a way that it runs well.
    a developer maintains it and adds new functionality.
    an intern gets the mocha's.

    There is no opinion on how something is put together, either it is well engineered, or it is not.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  247. I understand that x86 is the dominant architecture by vlad_petric · · Score: 1
    ... but it is simply fscked up ... I would have no problem if you started with a clean, RISC, ISA, but x86 ? So ugly that even Intel tried to get away from it.

    Not to mention that the time when humans wrote assembly that was better than a compiler's output is long gone. Processors these days are just too damn complex. Direct assembly might be the best choice for simple processors on embeded systems, but certainly not for superscalar processors.

    How many assembly programmers unroll loops for instance ? Loop unrolling is crucial for good performance, as branches are the 2nd biggest performance killer. How many actually think of instruction latencies and schedule instructions accordingly? How many people realize that the processor actually has caches and missing to main memory can take as much as 400 cycles ? How many people use predication to get rid of branches ?

    Yes, a good compiler has knowledge of these things ...

    --

    The Raven

  248. "People bitch and complain" by rs79 · · Score: 1

    (waves)Hi!(waves)

    That would be me. I did assembler programming (with some C when I could get away with it) from 1976 to about 1989 and have programmed, in assembler, almost every cpu and bitslice beast there was back then from microcontrollers to minicomputers.

    Thw x86 instruction set, with it's puny number of registers was by and far the absolute worst piece of shit it's ever been my extreme displeasure to get paid to program. To add insult to injury those lame assed segment registers have been IMO, the source of more bugs than I could shake a stick it. It's hard enough to get this crap right but when you have the "oh, CS: I thoight it was DS:" nightmare it's just untenable.

    I bet you could make a good case for estimating how much programmer time was wasted dicking with those stupid segment registers, and for no good reason, and come up with an insanly huge number of dollars wasted by some bad decision early on at Intel.

    As one comp.arch poster put it so succinctly a long time ago:

    Segments are for worms!

    Looking at x86 I'm not surprised people have a fear and loathing of assembly. Assembler used to be fun, but hasn't been for decades. Bleh...

    The best, as I said in another post, was the PDP-11. That was a downright elegant machine and it's no wonder C and unix are the way they are. God forbid DMR had had an Intel processor back then.

    --
    Need Mercedes parts ?
  249. 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.

    1. Re:This book by happyfrogcow · · Score: 1

      thanks for that second link, good stuff. i'm always looking for more ways to advance my nerdyness and my duties at work are too high level to make me feel like a nerd.

      nerd being a good thing, in my opinion.

  250. 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
    1. Re:On programming in a CS curriculum by Peyna · · Score: 1

      Same here; after our first year we were expected to know how to program, and if we didn't know a particular language required for a project, we had to learn it on our own time. Most of our classes consisted of theory, with occasional programming projects thrown in to help you learn the theories better.

      Any of your top level schools are going to teach it this way; if they don't, they might as well be a technical school and call it a computer technology degree; because you aren't learning a science at that point, you're learning an application of a science.

      Calling any who can program a scientist is like calling a farmer a biologist.

      --
      What?
  251. 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

  252. Pitt computer science by 4of11 · · Score: 1

    I'm a second semester computer science major at the University of Pittsburgh, and I'm taking a required course in assembly (albeit MIPS, not x86), and computer hardware fundamentals. Next year I'll even be taking a course in writing an OS (also required). Is this really unusual? I thought all computer science majors would learn these things.

    As someone who had some knowledge of assembly prior to college (the z80 processor, as well as some very basic x86), I'm sometimes suprised at how little my classmates understand how the computer actually works. I definately feel that assembly has helped me in this area.

    As a bit of illustration, I had no idea C used a stack, until I was playing around on the z80 (my TI-83... those were the days...) and realized that I could make a C compiler using a stack (but too lazy to actually do it, of course). I later found out that C compilers really do use the stack - but assembly helped me understand this better.

  253. 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)
  254. um... did no one else see this problem? by surfsalot · · Score: 1

    sorry if I'm a little skeptical... the poster is "johnnyb", the author is "jonathan bartlett" and the publisher is Bartlett Publishing? Granted I think that asm is useful, great to know, and does build a solid foundation for understanding. I just find a fundamental flaw when someone gets something /.'d that benifits them directly. "100,000 targets in this demographic... for free... sweet"

  255. An alternate view by ttfkam · · Score: 1
    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'.

    More likely, they're "wizards" because they've been programming since the release of the Apple II. If you had been coding for twenty five years, I sincerely hope that kids just coming up see you as a wizard. Otherwise, you have just wasted the last twenty five years of your life with no visible improvement.

    All of the veterens know assembly because that's all they had. In twenty five years, all of the veterens will have started with Java or Perl or Python. They will probably have picked up some assembly along the way, but they will be able to whip out an efficient, global-scale, distributed program far faster than those old assembly coders. ...and then they'll move into management just as those before them.
    --

    - I don't need to go outside, my CRT tan'll do me just fine.
  256. C++ useless unless you know ASM by blueworm · · Score: 1

    A great idea, C++ is useless unless you've done at least some basic programs in assembler.

    1. Re:C++ useless unless you know ASM by dillee1 · · Score: 1

      Agree. C, C++, pointer and objects are meaningless unless underlying concept of memory management and objects are understood. ASM gives a much better idea on these.

  257. Virtual Machines? by Anonymous Coward · · Score: 0

    I learned MIPS ASM and yes it was useful when I was programming in a structured language. But, once you goto a OO language, all that knowledge goes right out the window!

    I don't mean to be a troll, but I really do foresee the need of ASM slowing diminishing to that of COBOL. After all, with the drive of C# and Java you aren't even compiling to ASM.

  258. Assembly is good for some, but not all by cpane · · Score: 1

    I am an HUGE advocate for always teaching assembly to early CS Grads. It's a right of passage, and will get the CS majors to the next level of understanding. But don't confuse a course in Assembly Language with a Course in using Assembly as a tool to learn about Computer Architecture. I can remember my first day in our "Machine & Assembly class". The first words out of the Prof mouth were "I am not teaching you any assembly, you have the pick that up as we go along. Depending on the teacher at my school, you either were learning assembly to do Bubble Sorts and very simple tasks, or you used assembly to wire up ISRs/catch keyboard interrupts and call into an out of C Programs. The latter resulted in an excellent introduction to how computers worked, and was an excellent prerequisite to an Operating Systems Class. The students who took the Bubble sort version didn't really learn much more than how to do a Bubble sort in a language they would never use for that purpose.

    Now - As for using Assembly as the primary language for CS education, I don't think so. Like so many things in the CS world, use the right tool for the right job. If I am teaching a class in Database Implementation, I going to use SQL, Algorithms I will use some other higher level language. It all depends on what the focus of the class is = What you want your students focusing on.

    The Operating Systems 1 Class at my old school used to use a language called Turing Plus, which lent itself nicely to the study of concurrency issues. Then in Operating System 2 you dove into using Heavy C/Assembly to write an OS from scratch.

    Again - It all goes back to using the best tool to carry out the learning objective.

  259. Um, you "teach" assembler? by Bozdune · · Score: 1



    Ridiculous. At MIT (6.251) they threw IBM Assembler H and 370 Principles of Operation manuals at us on the first day of class, and we had to teach ourselves. The lecturer just ASSUMED we knew the language. The first programming project was due 3 weeks into the course. I think there were a couple of "extra" TA sessions for those who didn't get it, but that's it.

    And, that was 1973. The projects were on punch cards. No full-screen editors, no CRT's, not even a printing terminal. So we had to learn to program keypunches, dup and sequence card decks, learn enough JCL to get by, and so forth -- also on our own.

    I guess nowadays it's "Oh, wait a minute... is my object model right?"

    No, asshole, half the programming you do ISN'T object-oriented, OK?? And a significant piece of the other half shouldn't be written in Java, OK?? Oh, and by the way, that piece of SHIT code you wrote, multiplied by all the other pieces of SHIT code that you've written so far, adds up to ONE SLOW M-FING APPLICATION, in case you didn't notice.

    Remember, we used to run pretty effective word processors in a 48K TPA on a 4mhz Z80. Think about that the next time you power up 37 megabytes worth of MS Word.

    Christ.

    OK, I feel better now. Thank you.

    1. Re:Um, you "teach" assembler? by UncleFluffy · · Score: 1

      I guess nowadays it's "Oh, wait a minute... is my object model right?"

      No, asshole, half the programming you do ISN'T object-oriented, OK?? And a significant piece of the other half shouldn't be written in Java, OK?? Oh, and by the way, that piece of SHIT code you wrote, multiplied by all the other pieces of SHIT code that you've written so far, adds up to ONE SLOW M-FING APPLICATION, in case you didn't notice.

      Remember, we used to run pretty effective word processors in a 48K TPA on a 4mhz Z80. Think about that the next time you power up 37 megabytes worth of MS Word.


      Preach on, brother !

      High-level tools are for understanding the problem, not for describing the solution to a dumb machine.

      Put it this way, if I don't see assembler on someone's resume, plus some evidence that they know how to make *efficient* use of the hardware they're given, I'm not going to be inviting them to the interview...

      (Though, I'll admit, not every company is interested in making efficient use of hardware ... which is great for me, because if they were, no-one would buy new stuff and I'd be out of a job...)

      Someone mod the parent up all the way so that people get those wonderful words burnt into their brain.

      --

      What would Lemmy do?

    2. Re:Um, you "teach" assembler? by Anonymous Coward · · Score: 0

      High-level tools are for understanding the problem, not for describing the solution to a dumb machine.

      Put it this way, if I don't see assembler on someone's resume, plus some evidence that they know how to make *efficient* use of the hardware they're given, I'm not going to be inviting them to the interview...


      You, sir, are an idiot^W^Wignorant^Wmisguided.

      Efficient programming is not a factor of how low level your code is - it's a factor of how good your algorithm is. A good algorithm in a high-level language will perform just as efficiently as the same algorithm implemented in assembly - and it will also take a tenth of the time to write and be a hundred times easier to maintain.

      High-level languages are there for describing the problem to a machine; the job of writing the solution should be left to compilers. Not only will they do a better job than most humans, they can also do that better job for any system you may care to put them on. Whereas the x86 assembly language program I write today will be utterly worthless when we buy a PowerPC-based system tomorrow.

    3. Re:Um, you "teach" assembler? by GAVollink · · Score: 1
      Anonymous post because you know that you're missing the point?

      The whole idea of having assembly background is so you have an understanding of what your algorithms and the components within them are doing at the machine level. Just as it's not necessary to learn assembly for every CPU that you program for, as long as you have a good idea about the impact of printf (C, formatted print) as opposed to putc (C, unformatted output), then your understanding of what you put into your algorithm will be much greater than that of others.

      Assembly experience reminds us that an efficient algorithm with inefficient components is no better than an inefficient algorithm with efficient components.

      I don't think anyone is suggesting that we actually create a whole application in assembly, but learning how write assembly truely shows the complexity of seeminly simple operations. The painfull memory can serve to remind us of how much we're really making the CPU do for each operation we ask of it.

    4. Re:Um, you "teach" assembler? by sphealey · · Score: 1

      I am glad you are feeling better! But I am left with one question: are you ripping into my OP? Or agreeing with it? Or both? Or is your course somewhere between 45 and 180 degrees different from mine?

      Inquiring minds want to know!

      sPh

    5. Re:Um, you "teach" assembler? by UncleFluffy · · Score: 1

      You, sir, are an idiot^W^Wignorant^Wmisguided.

      Efficient programming is not a factor of how low level your code is - it's a factor of how good your algorithm is.


      Actually, it's both. Good algorithms give good big-O behaviour, and low-level knowledge gives tight control, and useful understanding, of machine behaviour.

      One example: Quicksort is a good sort algorithm, yes ? I've seen developers use a call to quicksort() to sort a 4-element array inside a critical inner loop, which is a spectacularly dumb thing to do. The author of the code didn't understand what the compiler does with the source, what function call overhead costs, what the effect on the icache is, and all the other little details that affect performance.

      The problem with O(n) notation and that whole worldview is that it is only meaningful for large values of n. People forget this.

      A good algorithm in a high-level language will perform just as efficiently as the same algorithm implemented in assembly

      Huh ? Try: "a good algorithm in a high-level language will perform no more efficiently than the same algorithm implemented in assembly"

      I've not yet seen a compiler that can generate code as tight as a skilled human. Faster code generation - yes, but faster code - no.

      and it will also take a tenth of the time to write and be a hundred times easier to maintain.


      Agreed, but I run code more often than I write it.

      High-level languages are there for describing the problem to a machine; the job of writing the solution should be left to compilers. Not only will they do a better job than most humans

      Which is more of a reflection on the abilities of most humans than of the compilers ...

      Plus, even with a perfect compiler, all the layers of cruft that get automatically brought in when you use a high-level language bloat your code, nuke your icache, and soak up huge amounts of potential performance.

      they can also do that better job for any system you may care to put them on. Whereas the x86 assembly language program I write today will be utterly worthless when we buy a PowerPC-based system tomorrow.

      This, I will accept, is a valid argument. I tend to write a "reference implementation" for each module in C that gets built if no asm version is available for a specific platform.

      It's not possible to write huge apps entirely in assembler, but you don't need to, just the critical 10%. My preference is for C for the bulk of my code, asm for the speed critical parts, and ML for high-level algorithm design and prototyping. I (personally) see no need for the plethora of middle-level languages.

      Even if you don't choose to write assembler, understanding it lets you understand what the physical reality underneath all your wonderfully elegant algorithmic abstractions is actually doing - which is critical for writing high-performance, efficient code.

      People who only know high-level languages feel to me like people who only get where they are going by using public transport: it's easier, they don't have to know about how vehicles work, but they have a limited choice of destination and no way of controlling the behaviour of the vehicle (and to stretch the analogy for amusement's sake: C programmers are like people who drive automatics, assembler programmers are like people who drive stick).

      Anyway, morning coffee finished, ramble over ...

      --

      What would Lemmy do?

    6. Re:Um, you "teach" assembler? by Rick+BigNail · · Score: 1
      I've not yet seen a compiler that can generate code as tight as a skilled human. Faster code generation - yes, but faster code - no

      People once said computer chess programs could not beat the best human grandmaster ...

      Whether you hire someone with no assenbler experience depend on what you hire him for. Writing programs for telecommunications or symbolic mathematics.

    7. Re:Um, you "teach" assembler? by Bozdune · · Score: 1

      6.251 was an unusual course, taught by unusual people (John Donovan and Stuart Madnick). Both ended up at MIT's Sloan School. Rumors at the time were that they were forced out by EE department politics. Don't know where they are today.

      For example, if you hacked the grading program, you got an "A". They figured if you were smart enough to hack them, you were smart enough to do the assignment anyway. Great guys.

      The idea of 6.251 and its follow-on course, which by that time was taught out of the Sloan School (oddly), was "immersion" into the reality of CS, rather than spending a lot of time on largely academic fantasies like funarg problems (a real-world example of which I've seen once in a 25-year career).

      How do you sort? How do you search? Why do you sort and search? How do those algorithms really work? What's a relocating loader? What's virtual memory? What's a compiler? What's an operating system? And throughout, write a boatload of code, starting with assembler, finishing with a big piece of a compiler in PL1/F.

      If I look back on my undergraduate education, that was the single most valuable course I took. I don't even remember the "core" CS courses. OK, I guess I remember funarg problems.

      Don't know if I answered your question, but HTH.

    8. Re:Um, you "teach" assembler? by UncleFluffy · · Score: 1

      People once said computer chess programs could not beat the best human grandmaster ...

      I did say "yet" :)

      Whether you hire someone with no assenbler experience depend on what you hire him for. Writing programs for telecommunications or symbolic mathematics.

      Very true. Assembler would not be the primary requirement for hiring someone to write a symbolic mathematics package, but I would still see it as a very big plus. All else (i.e. the primary skillset) being equal, the asm coder would be more aware of what the underlying machine would be doing and more capable of tuning the higher level code to use the hardware efficiently.

      --

      What would Lemmy do?

  260. 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)
  261. bold statements... by phish · · Score: 1

    Hmm.... let's try a bit of 'reductio-ad-absurdum'

    Best programmers are the ones who know assembler.

    Knowing assembler is having a 'deep understanding' of computers.

    Those who cant program assembler don't "really" know how computers work...

    I'll agree that knowing what assembler is and how it works may yield a better understanding of computing as a whole, especially when compared to someone who's only programmed in a high level language. But to suggest that those who know assembler are generally better programmers is frankly ridiculous. I know plenty of people who know assembler (6800, x86, etc.) who couldnt develop software, let alone program themselves out of a paper bag.

  262. Pshaw! I use Uniary! by RexDevious · · Score: 1

    That's right Mr. "Oh, I can't write a program without both 1's AND 0's". And if you think considerling logic gates and memory registers is powerful, just imagine what it must be like to be me, who wouldn't even consider posting this without knowing the precise state of every electron covalence field of the atoms which MAKE UP those logic gates.

    Yeah, so just think about that the next time you ask me to bring you another cup of coffee and the check, you arrogant 10% tipping bastards.

  263. u have it backwards by cinnamon+colbert · · Score: 1

    its not that knowing assembley makes one a better programmer; its that better programmers know assembley cause they harder working and brighter people

  264. Re:Pet peeve of the year (was Re:Linux x86 assembl by God+Itself · · Score: 1

    Here, here. There is no verb, "to architect," hence no past participle, "architechted." Natural languages are equally deserving of respect as the artificial.

  265. 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."

    1. Re:Elitist, perhaps? by Anonymous Coward · · Score: 0

      Most Computer Science degrees require a few computer architecture and systems programming courses at least. At the school I attend, 2nd year CS students complete a computer architecture course which basically consists of designing a complex processor from the basic gates on up. You can't get much more low level than that.

  266. How about not? by Paradox · · Score: 1

    And I submit you have no basis for that assumption, other than an outdated idea notion that the processes should be separate in all instances. Isn't one of the points of Pragmatic Programming, Scrum and eXtreme Programming to eliminate the separation and make the code the design? Even old style development models a "capture" phase.

    The idea that the process of making software and the process of coding should somehow be separate is old-fashioned. Even massive corporations like Lockheed Martin realize that the processes are bound together (although not every manager goes along with that philosophy very well).

    We need to stop thinking this way. Software is not an engineering process like other ones, where designers design and then manufacturers go to work on it. People actually realize this these days, and it's slowly becoming an accepted fact.

    The rest of your post I agree wholeheartedly with. :)

    --
    Slashdot. It's Not For Common Sense
    1. Re:How about not? by TexVex · · Score: 1

      I wasn't aware that my post implied favoritism towards a particular software engineering process model, or that design and programming should be done by separate people. I rather thought I was saying was that (no matter what process you use), you don't necessarily want a crackerjack who can find the optimal solution to any problem and at the same time program in a kitchen sink. What you want is an engineer who can gather, implement, and verify a set of requirements given to him by a customer ("customer" in the sense of whoever he's working for -- manager, other engineer, paying client), while also creating maintainable, documented, and resonably bug-free code.

      Oftentimes, both are the same person. But a hotshot programmer who is extremely skilled but can't be bothered to follow the process is probably a liability.

      --
      Fun with Anagarams! LADS HOST, SHALT DOS. HAS DOLTS. AD SLOTHS, HATS SOLD. ASS HO, LTD.
  267. Vacume tubes? by Anonymous Coward · · Score: 0

    I had to use boxes, but sucked the air out of them.

    1. Re:Vacume tubes? by EugeneK · · Score: 1

      You had boxes? We had to go into orbit and use space as our vacuum!

    2. 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
    3. Re:Vacume tubes? by Anonymous Coward · · Score: 0

      Bonus points for using backslashes in the URL there.

    4. Re:Vacume tubes? by Anonymous Coward · · Score: 0

      huh?

    5. Re:Vacume tubes? by hesiod · · Score: 1

      > Bonus points for using backslashes

      He didn't... might want to get checked for dyslexia, pal.

  268. I'm appalled(sp) by SpacePunk · · Score: 1

    Really. I learned assembly language first. The mere thought that there are 'programmers' that don't know assembly is uncomfortable. I really don't know what to think of it. It's kind of like as if someone told me that Jesus, Santa Clause were at the door and wanted to play poker, and they brought their own booze and hookers, and that Elvis was on his way on the back of the Loch Ness monster.

    HOW DO THESE PEOPLE UNDERSTAND THE MACHINE? In a way, I guess that's what separates the men from the boys, or in this case... real programmers from the lusers... the ability to blueprint the code, how the code works in the machine, and where/if/why errors appear.

  269. I'm not even a software developer! But.... by King_TJ · · Score: 1

    From the little bit of coding I've done (used to write in BASIC, years ago, took a course in C programming in college, etc.), and from all the work I've done along-side software developers while working in I.T. - it seems to me you really can divide programming tasks up into two basic types.

    You've got "low level" and "high level". If you aspire to do the "low level" development, that means you're looking at such projects as building device drivers for hardware, code for embedded systems (maybe it's the applet that runs the front panel on a laser printer, or the display and controls on a car stereo or cellphone?), or possibly even developing the compilers themselves.

    Meanwhile, the "high level" developers are helping work on larger projects... full-blown applications, front-ends to databases, maybe even computer games (where nowdays, you can basically purchase the whole "engine" from the "low level" guys who did that part for you already).

    If you're working on the "low level" stuff, I'd agree that you better learn assembly code, and learn it well!

    If you're just doing database front-ends and the like, it's probably not really necessary. I won't argue that people who know assembly understand the real inner workings of the computer better than those who don't. That's probably very true. It's just that sometimes, that's not critically important. (EG. I'd rather have someone with a good eye for color and a good artistic background helping build an action game, especially if I already paid for rights to use the Quake engine or whatever....)

  270. Since when is this a "new" concept? by Daytona955i · · Score: 1

    Hasn't assembly been around for a while?

    But seriously, I had to take a class that delt with assembly language. Unfortunately it wasn't x86 asm but rather MIPS. It was a good course, taught me a greater apreciation for the higher level languages. (That and to run away from any job with assembly in the job description)

    It's cool to learn and to help in debugging but I wouldn't want to write code in just assembly.

  271. Actually... by RexDevious · · Score: 1

    I'm sorry guys, that sounded bitter. But I'm really good at Uniary, does anyone have a job? Seriously, I haven't worked since writing

    "Microsoft Off, Version 0.0".

    Then they turned it into "Microsoft Off-ice", and it was it "so long Dr. Zero", wasn't it? But when you're computer goes haywire, whadda they tell you to do? That's right, it's Dr. Zero to the rescue. So please give a second chance to an old computer purist like me? Or at least, stop sticking your chewing gum under the damn table. I got hepititus 3 times last week!

    1. Re:Actually... by Peyna · · Score: 1

      The word is 'unary'.

      --
      What?
    2. Re:Actually... by RexDevious · · Score: 1

      Damn! That's what the fry cook said. And I thought he was just being petty.

  272. I want to laugh... by PylonHead · · Score: 1

    In a real high level language, say OCaml, you're going to be able to write a given data structure in a tenth of the code that you'll need to write it in assembly.

    It will be portable between different machines.

    It will be polymorphic.. allowing you to use the datastructure with different types.. a list of arrays of hashtables of red/black trees containing strings.

    You won't tell the computer what kind of pointer you want. I'm not sure why you imagine this is an issue in the 32 bit world we live in.

    You will appreciate having the typechecker catch bugs in the code, because you're working on a problem of some complexity. Often, when your program typechecks, it will work perfectly.

    Everyone should learn assembly. It is important that you know how the machine works so you can get a good idea what the costs of various operations are going to be.

    But outside people writing device drivers and maybe some code for embedded devices, (highly machine dependend and not algorithmically complex), nobody should be programming in it.

    --
    # (/.);;
    - : float -> float -> float =
  273. Excellent vs. Mediocre programmers? by PanamaCongress · · Score: 1

    To say that knowledge of assembly language is a requirement of programmer excellence is a ludicrous generalization. The measurement of the ability of a programmer is enormously context-dependent. I can imagine that a low-level micro-controller programmer could possibly be far less qualified as a developer for a large Smalltalk based order management system, than a programmer with no knowledge of assembly or even C, who instead has a strong theoretical basis in object-oriented systems and Smalltalk development experience. Programming abstractions have created vastly different programming contexts which resonate with markedly different programming abilities and experience. Why does such ignorant conjecture pass the moderators on Slashdot?

    1. Re:Excellent vs. Mediocre programmers? by armando_wall · · Score: 1

      To say that knowledge of assembly language is a requirement of programmer excellence is a ludicrous generalization.

      I know! I was shocked when I read that, too! I know some assembly programming myself, but I'm a firm believer that my programming skills are based on the way my logic works in order to attack problems, rather than the programming languages I use.

      It's easy to find mediocre programmers no matter what language they use... even if it is assembly!

      Hey, editor: an assembly programmer can misuse registers, stacks and loops, too.

  274. This isn't new by KalvinB · · Score: 1

    Arizona State requires one semester of digital design (with the final project being to build a simple 4 bit programmable computer in LogicWorks) and then x86 or 6800 assembly before moving on to higher languages.

    I was able to build a 4 bit random number generator in LogicWorks (that has a non repeating sequence of hundreds of 4 bit numbers) along with an 8x8 programmable LED display and other parts required to put together a Tamagochi.

    OpenTama project complete with all the schemetics for all the parts I've assembled down to the gate level. The only thing missing I can think of off the top of my head is the state machine to drive it all.

    The final project in Assembly is a "stop watch."

    I highly doubt ASU is the only university to start off the Computer Science degree with how to build a computer before learning how to program it.

    Ben

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

    JohnnyB, use your lightning powers to teach us ASM!

  276. Big whoop by ArgyleAgent · · Score: 1

    assembly is standard material for any cs student, and using AND and NAND gates, how about flip flops? resistors! building your own 8 bit processor!! I did these all last semster for my cs210 and cs220 classes! revolutionary, indeed :-O

  277. Terrible idea by Anonymous Coward · · Score: 0

    Start with a nice high level language like C++, then take assembly. Although CS students should eventually learn assembly.

  278. 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.

    1. Re:Who cares about learning about computers? by cpane · · Score: 1

      This is a naive statement on so many levels I don't even know where to begin.

      What are you thinking!

      So we don't teach how computers work anymore, just have everyone install Microsoft Dev Studio and write their little programs?

      If you do any form of embedded systems work, write compilers, have to do heavy debug or better yet, have to try and find a bug in some C++ program running on a PC compiled in dev studio that only happens in Release mode you need these skills.

      Have you ever tried to performance tune an embedded application? Understood how the Floating Point operations on one CPU might be better than another and thus help you decide how best to write your number crunching algorithm ?

      What of you need to write a boot loader or a device driver?, or spin you own Operating system or a Compiler?

      If you a teaching someone who is interested in a career in computers about computers, why the heck would you skip how they work.

      I realize my area of computers (Embedded Systems) is heavy in the "How Computer Work" Category, but if my CS Dept decided I just didn't need to know how a computer worked and skipped all those details I would no be doing my job today (Which by the way, has proven so far to be somewhat safer from offshore outsource)

      Fundamentals people, no matter what your field is you need your fundamentals. It's a crime to not teach an undergrad that, just like it's a crime not to teach him about what a database is or how to come up with an efficient algorithm (Which in some cases, is based on the Computer Architecture it is going to be running on !)

      CS Students are in school to get a nice Breadth of experiences to all facets of how computer work and how to solve programs with them. You are them with these fundamentals so they can have lots of career options within the CS Field.

  279. A few more... by Art+Tatum · · Score: 1
    Political Science
    OK, so you do lab experiments with staffers and image consultants or something?

    Military Science
    "What have we learned?"
    "When we dump fuel air explosives on things, they explode."
    "Fascinating. Let's try it again and see if it still works."

    Library Science
    So damn silly, I don't even need to bother with an amusing comment.

    1. Re:A few more... by dash2 · · Score: 1

      Re: polsci. I hope you're not seriously suggesting that Arrow's impossibility theorem, for example, is not real science?

    2. Re:A few more... by Art+Tatum · · Score: 1

      Science, by definition, deals with the natural world. Politics, by definition, doesn't.

    3. Re:A few more... by dash2 · · Score: 1

      So economics isn't a science, and the decision to build a pipeline through Alaska isn't political?

    4. Re:A few more... by Art+Tatum · · Score: 1
      So economics isn't a science

      Correct.

      and the decision to build a pipeline through Alaska isn't political?

      Yes, it's definitely political. But the politicians aren't doing science.

    5. Re:A few more... by dash2 · · Score: 1

      Well, if you have evidence that economics is a science, you might have a case. But just saying "by definition" won't cut it. And you still might want to look up the Arrow theorem and decide what you think about it.

    6. Re:A few more... by Art+Tatum · · Score: 1
      Well, if you have evidence that economics is a science, you might have a case. But just saying "by definition" won't cut it.

      I think you meant "isn't a science". But using a definition does cut it because words mean things. We can't simply go around broadening the definitions of words to make them mean things they don't. This is usually done for the purpose of making something sound better or worse by using words with strong connotative value.

      Here are some good examples of words that have been broadened beyond all reason for what amount to propaganda purposes:

      • science (to make something sound more enlightened or important)
      • Nazi (to make someone sound racist, murderous, and immoral)
      • "empire" (to make a nation seem evil)

      I know of Arrow's theorem, but it's not science.

    7. Re:A few more... by dash2 · · Score: 1

      What you say about definitions is true, but if you want to use accepted definitions, then the accepted definition of science does not exclude "political science": that phrase has been in constant use since at least Hobbes (i.e. since around the birth of modern science).

      By Arrow's theorem not being science, I guess that you mean it is pure mathematics, and hence a priori. True. But the point is that it reveals an important truth about voting systems which has real world implications: i.e. it gives us _knowledge_ about politics. If you prefer something more empirical, consider the laws of supply and demand, which are reasonably well-confirmed.

    8. Re:A few more... by Art+Tatum · · Score: 1

      The essence of science is that it finds predictive laws. Even though there are aspects of economics and politics that are moderately predictable, it doesn't even come close to the reliability of the natural universe. Science only applies when studying things that never change. That's my view anyway.

    9. Re:A few more... by dash2 · · Score: 1

      I don't see how the laws of supply and demand are any less reliable than, say, the biological laws predicting the population of foxes and rabbits. Neither will be 100% accurate in any situation. But if you ignore them you will lose a valuable predictive tool.

  280. Re: Don't program at all by ForteTuba · · Score: 1

    About being told dumb things about computers by adults: I had one of the old Radio Shack color computers, circa 1984. I went down to the local Radio Shack -- not one of the mall stores, this was the Columbus (OH) Computer Center. They told me "there's no such thing as an assembly language for those computers". Argh! I might have become a computer wizard instead of a failed music teacher turned perpetual grad student.

  281. Start with something simpler by wrmrxxx · · Score: 1

    The full x86 instruction set is large and complicated (some of the complexity because of its history). Adding an OS like Linux and all the hardware for a PC just adds a whole lot more stuff for a student to have to deal with.

    If this is a learning exercise, wouldn't it make sense to reduce the clutter of the environment (OS, PC hardware) and isolate the learning to only what is relevant. Why not start with a simple 8 bit microcontroller like an Atmel AVR, TI MSP430 or prehaps Cypress PSOC? Once the teaching mission has been accomplished and students are comfortable with programming concepts and basic computer architecture ideas, step up to using a higher level language like C on these micro's, then step up to the PC environment including an OS like Linux. At that point, the learning options expand greatly.

    This plan lets students acquire a deeper understanding at first, because they can explore the microcontroller completely - it is simple enough for a beginner individual to understand every aspect of its operation, unlike a PC. As a bonus, there is a great sense of accomplishment in fully understanding something instead of partially understanding it, and a stronger feeling of connectedness if you can make a micro do something physical.

    Those of us whose introduction to computing was through simpler machines like the Apple II (it even came with a full circuit diagram!) must know what I'm talking about. I don't know if I'd be nearly as interested as I was in my youth if I were just starting out in computing today and my introduction was a PC. I'd probably just use it to play games, like most kids seem to do.

  282. Ah, fotran by Anonymous Coward · · Score: 0

    I hadda study fotran,jiva and paxcal before I could go homey.

  283. Re:Pet peeve of the year (was Re:Linux x86 assembl by vsprintf · · Score: 1

    Last time I checked an architect doesn't 'architect', she 'designs', therefore the past tense is 'designed' not that godawful non-word 'architected' that has sprung up here on /. several times recently.

    I hear you. My peeve is people who verb nouns. It's a losing battle.

  284. 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
  285. Nah, its beatiful by Anonymous Coward · · Score: 1, Interesting

    Its sort of like comparing Renoire with Picasso.
    All the kinks and weirdosities in x86 make the programs written in it beautiful, like the artist that paints with his toes. I even had a chance to use the JPE instruction once, it was a beauty to behold!

  286. What's the point anymore? by Space_Soldier · · Score: 0

    Why waste time reading, learning about computers; the indians are the new geeks. Americans are just dinosaurs. It sucks, I know.

  287. 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.

  288. 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
    1. Re:Your analogy is incorrect, amoung other things by betis70 · · Score: 1

      I too race cars, not professionally. I also work on my own cars, though I have never had to build a carburetor from a drafting table or CAD program (which is what you seem to be suggesting I need to do before I can race cars. Or work on them). I can, however, make the carburetor run well on a road course at different elevations and with different environmental conditions.

      There is very little reason for a professional to know HOW a carburetor works or is built, just that the car is running lean or rich. You don't have to know the physics behind it to understand that the car is running lean. A simple 02 meter on the exhaust header will help a lot with that diagnosis.

      What you describe about the pro knowing a lot is probably correct, but the question becomes whether they learned that by talking to the engineers and having them explain it over the course of numerous seasons or they learned if before they ever got on a race course. Talking with kids who go karting and can outrace me on the same course, my guess is they learn this through exposure.

      I can guarantee you that Juan Pablo Montoya does not know the details of how to build the carbon fiber tub he sit in, but yes he probably does know that the car seems to have a bit too much lift going into the braking zone for turn 4 or that the toe should be moved out 0.5 degrees. But the reams of telemetry modern F1 cars give to the engineers tells them a lot more than any driver can. The same is true of ALMS. NASCAR, I don't know as I don't follow it, but my guess is they rely on a lot of data for tuning.

      >>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.

      They make you a better driver or a better car tuner? They are not the same thing. If you are tuning your efi WHILE you are driving, I'd like to see you get around a track without punching a hole in the wall. Driving is being able to hit your apexes, know your braking zones, set up your racing line, and get yourself around the track in less time than the rest of the field. Tuning is getting your car into peak performance so that the driver can concentrate on driving.

      At our level of racing, driver and tuner are the same.

      At a professional level they are separate, specialized professions.

      --
      I forget...are we at war with Eurasia or East Asia?
    2. Re:Your analogy is incorrect, amoung other things by xtal · · Score: 1

      I don't have the money to pay someone to work on or build my car. I race and build.

      Showing up with a car that is not in proper tune is not the way to win. Maybe better driver was a bad term, but it's certainly made me much more successful. I'm not sure where you get the idea that I demonstrated that you HAD to be one or the other. Assembly language isn't machine language, just as understanding that the carbeurator provides fuel for the engine and that the engine doesn't work well if it's too rich or lean doesn't mean you can design a new one in your sleep.

      Put another way, having a mechanical engineering degree sure isn't going to HURT you if you're a professional race car driver. I would certainly bet that Mr. Montoya and his friends understand with great detail how 10 cylinder naturally aspriated engine operates, too.

      --
      ..don't panic
    3. Re:Your analogy is incorrect, amoung other things by betis70 · · Score: 1

      >>having a mechanical engineering degree sure isn't going to HURT you if you're a professional race car driver.

      I absolutely agree.

      I guess I interpreted the article to mean you had to have low-level, close to the metal knowledge of race cars--as in how to build them before you could race, like being able to build a spreadsheet program with Assembly, as opposed to using Excel as a 'power user'. Probably not the intention on re-reading it.

      --
      I forget...are we at war with Eurasia or East Asia?
  289. 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.

  290. Suspicious... by zungu · · Score: 1

    I am suspicious of onlien bookstores which do not even show the table of contents. So do I just buy this book since it has been '$touch assembly-book slashdot' ?

  291. CS != Computers by jared9900 · · Score: 1

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

    Sense when is computer science supposed to teach you about computers? It's supposed to teach you about computer science (algorithms, language theory (not languages), etc). Teaching people in assembly may help them learn more about a computer they might use, but that doesn't mean you're teaching them computer science.

    Of course I'm probably one of the few people who thought CS 1 using pseudocode was a (potentially) good thing (the graders were a bit to anal, "you forgot the '.', 0"). Pseudocode allowed for students to learn CS Theory without having to get stuck in syntactic hell. Follow that up w/ some high-level languages, and they can apply what they've learned. Let assembly be where it belongs, in a course on, oh say, computer architecture? Not as a beginning language.

    I really need to learn how to not ramble.

  292. Theory is more important by rufusdufus · · Score: 1

    I know and have hired many people in the field, and I say that abstract theory is more important that assembly. Yes there is great value in knowing the details of how the processor works, but really, anybody can pick that up.

    What more people have difficulty in is algorithm and data structure theory, which has more intellecual leverage than the simplicities of assembly.

    For example, who is going to build a better database, one who knows assembly or one who can compute big O algorithmic runtime? I say the latter.

    1. Re:Theory is more important by Anonymous Coward · · Score: 0

      No kidding. I've seen a number of people who equate lines of C code to speed of that code, and I think some of this comes from an ASM instruction count minimizing mindset. I don't care if your O(2^n) algorithm is only 5 lines long, it's still going to be slow.

      The hard stuff in computer science is using the right algorithms and data structures. The hard stuff in programming is writing code which does what the customer wants, handles error cases gracefully, and is maintainable. If you're working with teams, writing code that works with the other team members' code is on the list as well. Shaving cycles off of runtime using ASM is easy by comparison.

  293. M68K-asm at Indiana University. by garlic_b · · Score: 1

    I am relatively new to the CS world compared to those "wizards" but my favorite class a University was a ASM course (which was required) Our first proramming assignment was to program a keyboard controller, that took all the scan codes from the keyboard and allowed one to type on screen. The class was delightfully difficult. We had a crappy textbook, but we had the Motorola 68000 "manual" basically a brochure with all the instructions, their opcodes, operands and other basic info. The sheet was worth nearly its weight in gold. This course gave me a deep understanding into computers and the logical thought required to program well. I definitely think it is a good idea to learn assembly.

    The School: Indiana University.
    The Course: C335.

  294. Re:Pet peeve of the year (was Re:Linux x86 assembl by Anonymous Coward · · Score: 0

    Did anyone else notice a very well hidden joke in parent? Very nice. :-)

    Or maybe I'm just a crazed illiterate.

  295. 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.
  296. 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
    1. Re:Computer Scientists aren't programmers by Anonymous Coward · · Score: 0

      Having been rather successful so far in my first six years as a professional coder, I stoped to think about my code I'm most proud of. It involves some wacky low level memory management inside SysV shmem segments. I think any of my compsci profs would horse whip me for writing such code, but my bosses are happy because its so much faster than the in-house Java RMI counterpart.

    2. Re:Computer Scientists aren't programmers by Anonymous Coward · · Score: 0

      I am doing a BA in Comp. Sci. Right now. assm. is taught in 1st year alongside C & Java. So at the end of 1st year you know how it work, why it works and how to make it work for you... Then in 2nd year people can choose to continue with the low level stuff if they choose but it mostly moves into more detailed C & application to pretty low level theory and C++ or the high level languages. The most useless of which is Eiffel.
      All in all it provides a very good balance and allows for choosing what path you would like to take for the rest of the degree / carrear. To that end assm. is the biggest bitch i have ever come across. I did it i hated it i never want to do it again. I would like to know how to write useful protable code that can be used on most any platform and understanding of stacks and frames help when debugging but i will stick with g++ gcc and GDB for a long time to come.

    3. Re:Computer Scientists aren't programmers by Anonymous Coward · · Score: 0
      The problem is that computer scientists don't make good programmers and vice-versa.

      I agree and thought I'd add this, to paraphrase James Gleick (Chaos, p125):

      They need each other, but computer scientists and programmers have allowed certain inequities to enter their relationships since the ancient days when every scientist was both. Though the best programmers still have some of the computer scientist in them, the converse does not hold.

      A computer scientist could comfortably ignore the implementation details, but details matter and being ignorant of how computers really work often generate inefficient algorithms. (eg: Merge sort is more efficient over quicksort for large datasets as memory does NOT have an equal access time).

      Likewise, while "premature optimisation is the root of all evil" (Knuth), a programmer must understand the basic theory of complexity theory and use essentially sound algorithms.

    4. Re:Computer Scientists aren't programmers by Kupek · · Score: 1

      The problem is that computer scientists don't make good programmers and vice-versa.

      Bogus. CS, like other fields, has a diverse makeup. Some CS people do almost exclusively theory. Others specialize in software engineering. Some do systems, some networks, some programming languages. I can think of some CS professors that aren't good programmers, and I can think of some that are phenomenal.

      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).

      Ditto. You just characterized the entirety of a field from your limited experience. Would you characterize all physicists from talking to a few theoretical physicists? There are experimental physicists out there too. How about soemone who specialized in quantum mechanics? There's E&M people too. Your claims are just plain silly.

      Oh, and I am a TA. I have never heard of a school where TAs teach actual lecture. I teach lab. That is, I lecture for about 20 minutes, then let the undergrads do their programming lab and answer questions along the way. This is a far cry from actually teaching the course.

    5. Re:Computer Scientists aren't programmers by Anonymous Coward · · Score: 0

      Oh, and I am a TA. I have never heard of a school where TAs teach actual lecture. I teach lab. That is, I lecture for about 20 minutes, then let the undergrads do their programming lab and answer questions along the way. This is a far cry from actually teaching the course.

      Actually, TAs teach courses ALL THE TIME. Not sure where you went, but they did at my unversity anyway. Not necessarily in the higher-level courses, but if you took something 300 or under you had good odds of getting one.

      Agreed though on your other comments. That said, some of the professors and PhD candidates have been lost in the world of theory for a long time, and would probably not do too well in a really fast-paced "get it done now, not necessarily the most efficient way" environment.

    6. Re:Computer Scientists aren't programmers by Kupek · · Score: 1

      As an undergrad, I went to Virginia Tech. Now I'm a grad student (and a TA) at William & Mary. All of my courses at Tech were taught by full instructors or professors. I had two math classes taught by advanced grad students (they were Ph.D. candidates at that point). Here at W&M, the only course I know of that has been taught by a TA is the intro to CS for non-majors course (again, Ph.D. candidate).

      Tech is a big university; W&M is a small one. I would have been shocked to walk into a junior level CS course at Tech and see a grad student teaching it. At that point, in fact, instructors didn't teach the courses anymore, only professors. Here at W&M, it's almost entirely professors from beginning to end.

      Where did you go?

  297. This is new? by jimfrost · · Score: 1
    Teaching with assembly is new? Somebody ought to go tell that to Donald Knuth.

    --
    jim frost
    jimf@frostbytes.com
  298. 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.

  299. Kids these days... or, everything old is new again by twalton · · Score: 1

    Anyone remember, or still able to read, Knuth? He was Mix'ing it up before most /. readers were born. Real computer scientists can disassemble core dumps at the console

  300. Re:Pet peeve of the year (was Re:Linux x86 assembl by vsprintf · · Score: 1

    Umm, thanks, but I think Calvin, of Calvin and Hobbes fame did it better. :)

  301. Assembly is KEY to a CS major by Biff98 · · Score: 1

    Assembly is the ONLY way to get a full appreciation of how computers work. The University of Colorado doesn't start with Assembly, but it definitely gets you there eventually. If you've never coded Assembly you might as well be a mindless .NET spewer-of-white-paper power words...

  302. 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.

    1. Re:CS != uber-coder degree by grim_fandango · · Score: 1

      My curriculam had one paper on assembly lagnuage and IMHO it is quite sufficient to teach you about the instruction set of processors etc. Although asm programming isnt absolutely essential if you end up being a Java programmer but will help you comprehend the finer nuances eg, the way compiler optimises, the different addressing mechanisms..etc. Also the most prevalent viruses of the pre-internet era were written in asm they are really a great example of extent of non-traditional things you can achieve with asm.

      --
      Roses are red, violets are blue, an operator will be by to kill you.
    2. Re:CS != uber-coder degree by Anonymous Coward · · Score: 0

      Congratulations on making progress toward your overhyped programming certification. It sure isn't computer science.

    3. Re:CS != uber-coder degree by grim_fandango · · Score: 1

      ...and why is it so?

      --
      Roses are red, violets are blue, an operator will be by to kill you.
    4. Re:CS != uber-coder degree by Anonymous Coward · · Score: 0

      I do not claim I'm a doctor, or even a nurse, because I learned to run a blood pressure monitor. A computer, and the hardware contained within it are tools that a computer scientist uses, not the focus of their studies. Of course, some minimum level of proficiency is required.

    5. Re:CS != uber-coder degree by Anonymous Coward · · Score: 0

      Bravo and hear hear. When I was in school, the running joke was that "after this program, you should be able to pick up a new language at will by sleeping with the manual under your pillow". That is what really sets apart a Computer Scientist from a programmer. A programmer is bound to his platform - a Computer Scientist can solve the problem, then pick the platform and tools that best meet the need.

    6. Re:CS != uber-coder degree by grim_fandango · · Score: 1

      > "..Congratulations on making progress toward your overhyped programming certification. It sure isn't computer science... I still dont follow why you call what i said was taught to me as a "overhyped programming certification". It was well rounded course with papers on Software Engineering, Data Structures, Object Oriented anlysis and design approach. You just cant throw broad analogies and hope to put your point across.

      --
      Roses are red, violets are blue, an operator will be by to kill you.
  303. Why not start with Rocky's Boots? by otis+wildflower · · Score: 1

    Fire up an old Apple ][ emulator and check it out..

    Seriously though, starting in ASM is a GREAT way of weeding people out of CS. OTOH, unless you're developing hardware drivers or embedded systems software (or working for NASA), it's pretty much a waste at this point, and it is highly unlikely you can beat a modern compiler for optimized code anyway.

    Seriously, I remember teaching RB to 4th-6th graders when I was in HS, and I'd end up playing it myself for hours, 'twas hella fun..

  304. Teach them how to use a soldering iron by Anonymous Coward · · Score: 0

    I find the best programmers are the ones who are a whizz with the soldering iron.

    Sniff your programmer, and if he smells of molten metal and old boxes, you know you have a real expert on your hands.

    Charles Babbage was a great programmer and he didn't even know BASIC.

  305. Comments from an old fart programmer by cdn-programmer · · Score: 1

    Well - I could be moderating!!!

    I have no intention of drooling in this glass of wine I am enjoying... but...

    This is a good idea. It is a very good idea. Every real profession needs to have both roots and wings. The idea has merit from many points of view. And the more I think about it the more merit I think the idea has.

    Having more than 25 years experiance and more than 20 years as a consultant, developer and so forth... I can say that from my perspective there are patterns I have witnessed which I find very disturbing.

    I will summarize. I personally consider many (and perhaps the majority) in this profession to be totally incompetant. Having said this - I'll contrast to the feild of Geology and Geophysics (both feilds of which I have strong ties). In my years of working with the Geologists, Geophysists, Reservoir Engineers in every major corporation and instution which has paid me A LOT OF MONEY - I have NEVER run into a single instance where the cheif geologist, or cheif engineer or cheif geophysist was not very well respected by their collegues for their experiance, their judgement and so forth.

    Yet - in my proffession. The horror stories I can tell and the incompetance.... whoa boy! Abject stupidity abounds.

    Let me ask. If you look at a gneiss rock - most professional geologists can tell you the minerals and related rocks. So can I actually. To be promoted to cheif whatever - you gotta know your stuff.

    What of the IT people?

    Do you want to know of the manager of a computer department who didn't know the numeric data types the computer supported? what of the programming languages and what they supported? Would you like to know of the suggestion to try to develope a Production Acccounting package using a programming language where you could not write a callable function/subroutine? Where the variables were restricted to A1, A2, B1, B2 and Same with $?

    This was a major oil company of Royal Dutch decent that tried this trick.

    This is just the tip of the 'berg. How about the consulting firm out of Winnipeg,CA that recommended after intensive study the purchase of a computer which you could not install enough disk drives to carry the data... and at the same time recomended the development of the applications software in a language that did not support a data type that could even count the number of oil/gas wells drilled - much less the technical data collected.

    Oh - and after 3 years not a single line of code was written.

    They were doing _HIGH LEVEL_ work!

    In my entire life I have experianced such a deplorable level of BULLSHIT as seems to course normally through the feilds of comp science and IT. Yet when I look at related fields - I am totally impressed with the caliber of the work that is done.

    A simple example in the feild of Physics for instance can be found by reading the Feynman books.

    If anyone who chooses to read this post cares to call up the local public library and ask what they have on Feynman.... perhaps ask for the Feynman Lectures on Physics ON TAPE - ALL OF THEM - then this would be a good start.

    Feynman knew his stuff. So should IT people. I for instance should not have to walk into a room full of IT people and find that not one knows what COMP-3 is and why it needs to be there and why C++ really doesn't do the same job.

    To draw this post to a close. A geologist is expected to know his mineralogy.

    In the IT world - even the analagous basic level of knowledge of the data types the computer or language supports is often mixed in with the vapid ideas of abstration that float through the ether of higher intellectual thought.

    1. Re:Comments from an old fart programmer by corngrower · · Score: 1

      I've also seen a few incompetant cs people in my day. Most recently was the architect that decided the best way to transfer data from a database to a message (for xmitting to another location) was to read the entire set of selected records into memory, (into a XML - DOM tree), where each item of data necessitated a memory allocation. Then to access the items in this structure, you supplied it a text string ( xml-path-string) whereby at each level in the tree it had to search through a long list for the proper item. Needless to say this code ran 5 times slower than the competitor's, couldn't handle large data sets, and the project fell flat on its face.

  306. Processors are for wusses by highwindarea · · Score: 1

    Real programmers convert thier algorithms to state machines, then build the state machines out of nand gates. User interface, LED's and toggle switches are an excellent user interface

    --
    I think this internet thing sounds like a good idea
  307. Learn from the best by akuma(x86) · · Score: 1

    I'm all for the bottoms up approach to learning about computers.

    Here is a book that every aspiring computer scientist should read:

    Introduction to Computing Systems: From bits & gates to C & beyond
    by Yale N. Patt, Sanjay J. Patel

  308. Dijkstra doesn't think so by alien_blueprint · · Score: 1

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

    That's not to say that, however, that understanding machine code is not a useful skill, but it is certainly the wrong approach to teaching "computer science." When searching for this quote, I found this page which outlines why "computer science" is not about "hardware" at all.

  309. It's supposed to be Computing Science... by Anonymous Coward · · Score: 0

    ...not Computer Science.

    "Computer Science is as much about computers as astronomy is about telescopes." - Edsger W. Dijkstra

  310. here at berkeley.... by Anonymous Coward · · Score: 0

    Berkeley EECS majors do ASM last:

    CS61A, "Structure and Interpretation of Computer Programs"
    - Scheme

    CS61B, "Data Structures"
    - Java

    CS61C, "Machine Structures"
    - C

  311. I just learned a good chunk of assembly by FictionPimp · · Score: 0

    I just spent the last few months hunkered down with the Art of Assembly book by Randall Hyde. I worked my way though all the HLA functions in a matter of days, then switched to writing in masam and using hla's output to figure out how he was doing things so i could replicate them. I still suck at floating point, but i'm getting better and hope to start in on sse and mmx soon. I have learned way more about how computers work in the last few months then in the last 8 years as a programmer. I know some C, some C++ (never really use them, i do lots of web scripting), a lot of perl (I love perl), php, VB and the .NET's (who doesn't know vb) and of course my new baby that I do a lot of at work,java.

    I'm finding myself writing less code now that I understand better how to problem solve. And I am not complaining as much about language syntax. But I do find myself over analysing the issue. I have to keep reminding myself that sometimes their isn't some super awesome way to do things and you just have to grind it out.

    Overall, I recomend learning x86 assembly. Learning it the way Randall Hyde suggests was really easy to anyone who knows C syntax. And if you do as he suggests and slowly stop using his code and start using "pure" assembly slowly (writing your own loops, and functions and learning the hard way to preserve your registers) It doesn't seem as bad as it would if you had to jump in and write your own print function on day 1.

  312. The Art of Computer Programming by Anonymous Coward · · Score: 0

    Please don't even suggest that this is a new idea. Donald Knuth wrote his books not using assembly language, but one he created for a machine that didn't even exist (MIX). Ask your dad if you borrow his Volume 1.

  313. Ahhh... brings back memories... by divisionbyzero · · Score: 1

    I remember using debug to find copy protection and then using NOP commands to circumvent it...

  314. Old School by Doc+Ruby · · Score: 1

    I learned 6502 assembly language by hand assembling opcodes at a "summer program" at an NYC-area tech institute. We literally "wrote" code in pencil on graph paper, then triple-passed it against an assembly->machine language chart. When the bank of Apple ][+'es was available, we squirmed our little 11-year-old bodies up into the operator stools, hunt/pecked "call -151" for the machine language monitor, and righthanded the hexadecimal onto a numeric keypad. Then saved to tape for backup, and ran it. For better feedback in debugging, we ran lots of bitmapped routines, so we could see our bugs in action. We had lots of help from the curious grad students, working the DEC GIGI graphics terminals on the VAX mainframe. They had the biggest comp graphics lab in the world at the time (generating about 3 minutes per team per semester), but they could tell that these kids with Apples were the future.

    Later, when I learned forth, I already knew what the language was directing the CPU to do. And C just seemed like a great macroassembler, C++ like an aircraft carrier of macroassemblers. The underlying computer architectures haven't changed, in spite of the arrival of genetic algorithms, neural networks, and reconfigurable computing. I have benefitted not only from the intimacy with the machine I'm instructing, but from seeing the reiteration on every scale of the same underlying structures that assemblers process. And the value of just importing C++ classes, or calling remote procedures and web services, rather than writing all that stuff myself, is the oxymoronic moral of the rags to riches story of a happy, generous miser.

    --

    --
    make install -not war

  315. 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
  316. Book is GPL by Anonymous Coward · · Score: 1, Interesting

    ...available at ProgrammingGroundUp

  317. I DID learn to program in an assembly language by Mr.+Neutron · · Score: 1

    It was called "C".

    --
    dinner: it's what's for beer
  318. Learn? by Anonymous Coward · · Score: 0

    Real programmers already know machine code.

  319. Bill doesn't want you to know assembly by DuctTape · · Score: 1, Troll
    Bill doesn't want you to know assembly language.

    Bill wants you to renew your MSDN subscription and use C# and .NET so your apps can run on heterogeneous systems.

    Do Bill's bidding. Do it now.

    Trolling aside, go to Gibson Research and download some of their apps. They're most if not all written in assembly language, and they're fast. They'll portscan your system for you, too.

    DT

    --
    Is this thing on? Hello?
  320. Not the reason to learn Latin or assembler by Anonymous Coward · · Score: 0

    I disagree. The best reason for learning assembler is to understand how computers work in the most minute detail. This may or may not be helpful when working in higher levels of abstraction. The best reason for learning Latin (or any foreign language) is to be able to read it (or hear it) untranslated.

  321. 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
    1. Re:Just to clarify by loose+electron · · Score: 1

      A NAND gate takes 4 transistors in CMOS, 2 transistors in RTL....

      --
      www.effectiveelectrons.com "chips that work" Analog, RF, Mixed Signal
    2. Re:Just to clarify by chthon · · Score: 1

      You can also build anything out of NOR's : !(A+B) = !A . !B

    3. Re:Just to clarify by lordholm · · Score: 1

      Actually, a 2-bit NAND in CMOS takes 4 transistors, 2 PMOS and 2 NMOS. A NOT-gate takes 2 transistors though.

      --
      "Civis Europaeus sum!"
    4. Re:Just to clarify by Anonymous Coward · · Score: 0

      You cannot build circuits just from XOR gates.
      If you doubt this, try and build an AND gate from XOR gates.

      You can however build any circuit out of NOR gates, or out of NAND gates. (If you want a small challenge, make an XOR gate from 4 NAND gates)

      DeMorgans says that if you invert the inputs and outputs, you change an OR (or NOR) circuit into an AND (or NAND) circuit.
      {in C terms A&B = ~(~A|~B)}

      My posting proves the benefit of learning X86 before learning C/C++ - you can comment on Slashdot threads ;)

    5. Re:Just to clarify by Raul654 · · Score: 1

      As I already said, I made a simple mistake and wrote XOR instead of NOR. Yeesh.

      --


      To make laws that man cannot, and will not obey, serves to bring all law into contempt.
      --E.C. Stanton
    6. Re:Just to clarify by JOKane · · Score: 1
      Alternatively, you can build anything using nothing but XORS.

      This is false. With only XORS, the only functions that can be computed are parity functions -- those that depend only on whether the number of active inputs is even or odd.

  322. Assembly programmers do it better? by alphorn · · Score: 1
    Working software that's fast enough and is on time is what counts. How would assembly help there?
    • Your high level language programs run faster when you know assembly? Well, maybe 20%, but how is that relevant today? Computers will be 20% faster in 6 months. And better algorithms can get you 2000%.
    • Your HLL programs are better if you know assembly? None of today's techniques to create maintainable code (structured programming, object orientation) came out of assembly. Quite the opposite.
    If you're a PHP or Perl programmer, how does assembly knowledge influence your programming style?
  323. Aren't self-promotion slashdot posts un-Christian? by Anonymous Coward · · Score: 0

    Seems like we have some dishonest self-publication here. The person who posted the slashdot post also published the book.

    As the poster of the article misleads the reader into thinking the book is not related, and is also a heart-on-the-sleeve Christian, What does the New Testament say about misleading others?

  324. And for the record by Raul654 · · Score: 1

    For my introductory computer engineering class, every year the midterm includes a question: "Built the above circuit using nothing but NANDS/XORS" (they change that last part from year to year)

    --


    To make laws that man cannot, and will not obey, serves to bring all law into contempt.
    --E.C. Stanton
  325. ATARI games were written in FORTH by Anonymous Coward · · Score: 0

    ATARI games were written in FORTH, not assembly.
    FORTH is soooo much better than assembly, and just as close to the metal.

    1. Re:ATARI games were written in FORTH by cosmo7 · · Score: 1

      FORTH is soooo much better than assembly, and just as close to the metal.

      Very much so. Starting Forth is a great book to learn about computers in a non-recipe mode of understanding.

      Funny how some people put down Forth as being 'old', when nothing's older than machine code.

  326. What Goes Around, Comes Around by Anonymous Coward · · Score: 1, Interesting

    When I started at IBM, in 1962, they sent us to programming class and the first thing they taught us was ... all together, now ... Assembler!

    Of course things were much easier then, we were on the 7090 which is a "direct address" architecture, that is, the actual address (all 15 bits of it!) is part of the instruction. There were index registers, and occasionally you might code an address of 0 and use the index register as a "base" or "segment" register, but that was the exception. The 7090 architecture had its glitches (index registers were subtracted from the address, but by and large it was much simpler than most of today's machines, and much easier to learn assembler for.

    Oh, after we finished Assembler, then we moved to a "High Level" language ... Fortran. Not Fortran 96, nor 77, nor 66, not even Fortran IV, but Fortran II (ugh!).


    By the way, I'm doing this post as AC because I've got lots of copies of my resume out there, and not one so much as hints at my having been working in 1962 ...

  327. 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.

    1. Re:SICP by johnnyb · · Score: 1

      I agree that SICP is a foundational book. I just think that abstractions are better taught AFTER the concepts which they are abstracting, not before.

      We teach people mathematical tables BEFORE teaching them how to use a calculator.

    2. Re:SICP by markprus · · Score: 1

      I wholeheartedly agree. SICP is a great choice because it emphesizes the "computational" aspect of CS. I think starting people off with assembly is not a great idea because it imposes a specific architecture on students that just happens to be popular at the time. There is plenty of time for that in later parts of a 4-year curriculum.

  328. Re: dishonest submission? by SecState · · Score: 1

    Considering the amount of reasoned, informed debate his submission has generated, it's clear that the question of teaching assembly language to beginning CS students is worthy of slashdotters' attention. His submission may have an element of self-interest, but its content has obviously prompted a lot of discussion--which is, after all, what we're here for.

  329. Understanding computers through assembly by Anonymous Coward · · Score: 0

    I'd agree that to really know computer science you need to know how a computer works.

    and a good way to do some of that is to learn assembly tho basic understanding at an even deeper level can be helpful.

    at Purdue University there's a computer architecture course thats required for CS students. it was recently overhauled (im told it was pretty irrelevant a year or two ago) to include things like actually building digital circuits and learning assembly (SPARC this semester).

    I'm pretty sure that any good CS program does or should include this sort of thing.

  330. You have it completely backwards by Kor49 · · Score: 1
    Author claims "good programmers know assembly well, so make everybody a good programmer by teaching them assembly first".

    It is correct that many (most?) good programmers have a decent understanding of the underlying machine. I wouldn't go farther than that and claim that it's the assembly knowledge that makes them better. Gigantic logic flaw. You're immune to it though, once you put the magic "linux x86" in it, your submission will be published.

  331. Re:Pet peeve of the year (was Re:Linux x86 assembl by Michael+Hunt · · Score: 1

    Shut up or i'll knife you in the face.
    Then I'll shovel your decaying body into a box, and fire the box up in a crematorium.

  332. Re:Linux x86 assembly? Bicycle computer info by Anonymous Coward · · Score: 0

    Does anyone have pointers on what types of chips and where to purchase the small displays used in bicycle computers that monitor cadence, mph, avg speed, etc.?

    I've purchased various cyclometers, but would like to add features and customization abilities.

  333. 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
  334. A-men by Anonymous Coward · · Score: 0

    This sounds like a really good approach. The trouble with computer science is that there's the mathematics and logic behind it, the comparatively simple digital hardware, and then a lot of jargon gobbledygook and quaint, contemporary fashions that so often passes for "science". The truth is that CS is about moving bits and bytes of information around and changing them on an increasingly large scale, and the basic algorythms for doing that. High level languages try to hide the fact that the way any computer works microscopically is basically the same way it works macroscopically. While reducing complexity for the user is an obvious design goal for programs and computer languages, teaching CS with just high level languages is like teaching magic (a contradiction in terms). It becomes very hard to understand what the limitations of a computer are when students are given an ideal, abstract mental model of a computer instead of a real one.

  335. There's more to it. by Anonymous Coward · · Score: 0

    I wouldn't say the make|break point of determining the prowess of a programmer is assembly language. It's more like the types of skills they've acquired or classes they've taken in college - those who wonder what the difference between going to college and hitting the job scene can benefit from knowing college provides the opportunity to create a structured environment for learning specific skills and be exposed to particular topics.

    When I graduated almost twenty years ago, I'd written my own DBMS, my own compiler (for a semi made-up language - an extension of DCL on a VAX), Language Structures - what languages tend to have and don't have in common, how to examine a language and acquire experience in that language quickly. Several other classes in specialized (but part of a broad experience) helped.

    Assembly language? Yes. We were permitted to use single character input and single character output. All other forms of I/O were up to us. First programs were "input a number, then output the number." "input a list of numbers, then output them." "input a list of numbers, sort them, then output them". I was turning in programs of three or four lines because I wrote my own library routines (but they were small, easily maintainable calls).

    Where does this apply today? There are tons of people today who submit resumes and what's listed for college or the first two or three jobs out of college? Programming. Programming. Programming. No balance. They seem to have no balance except for programming.

  336. As a CS student... by verbatim_verbose · · Score: 1

    I have to agree that this is a very good idea. Now that I'm in my fourth semester of programming classes (first 3 all being Java) I'm now learning C and assembly, and must say, it's quite enlightening. You can know a lot about computers by learning higher level languages, but when I finally started learning assembly it drew that final link between software and hardware and finally the whole picture came together.

    Good idea, I say!

  337. 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.

  338. Assembly is a waste of time, mostly by Erwos · · Score: 1

    Speaking as someone who's been there and done that with MIPS assembly code, I'm not entirely convinced that programming stuff in assembly is going to do much of anything for the average program.

    Problems with writing in assembly:
    1. It's slow to write. IIRC, there was a study done that people who wrote in C and assembly produced the same number of lines of code. That means the assembly guys were producing less work than the C++ guys.
    2. It's non-portable. System calls differ. Not all machines have the same register conventions. Hell, the NUMBER of registers differs wildly. Your wonderful hand-coded assembly is going to be mostly worthless outside of the platform you programmed it on, and if it ain't, you probably weren't exploiting the architecture all that well to begin with.
    3. Improperly optimized assembly isn't going to net you any performance gain. Even GCC is going to do a better job than the average assembly language coder. So, yeah, the best of programmers 5% could do better on 5% of their code, but that's not going to convince me it's the best idea for even "just great" programmers.

    In other words, it's probably better and more efficient to program in a thoughtful way in C rather than try to shove assembly code everywhere in hopes of some sort of speed gain. Certainly, there's reasons to use assembly, but at this point, I would think it's mostly on embedded apps.

    The idea of getting to know at least one architecture on an assembly language level (hell, a binary level) is not a bad idea at all, and will indeed probably lead to better higher-level code in general. But trying to say that it's some kind of magic barrier between being mediocre and good is entirely off the mark. Being a good assembly programmer doesn't automagically confer you amazing abilities in Lisp or Prolog.

    I have no idea what the submitter thinks goes on in good CS schools these days. I know they worked me to the bone with large projects in assembly, C, Java, Lisp, Prolog, you name it. The idea that they don't teach assembly is idiotic.

    -Erwos

    --
    Plausible conjecture should not be misrepresented as proof positive.
    1. Re:Assembly is a waste of time, mostly by johnnyb · · Score: 1

      "I have no idea what the submitter thinks goes on in good CS schools these days. I know they worked me to the bone with large projects in assembly, C, Java, Lisp, Prolog, you name it. The idea that they don't teach assembly is idiotic."

      Most schools I've seen, while they do teach assembler, it's usually a late add-on for 4th year students (this was what it was at the University I went to - good program overall, though). In smaller colleges, it may not be taught at all, or it may be done in such a shoddy way as to make it not worthwhile at all.

      The thing is, I think that assembly language is _foundational_, not just an add-on course. It helps you learn other languages. Teaching it first helps students really get a grasp on what the computer is doing. I've seen several students graduate from Universities where, at the end, they still just didn't quite get how the programming languages they used really worked. It was still a "magic black box" to them.

  339. 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.

    2. Re:Assembly for speed? by Anonymous Coward · · Score: 0

      Or search for "Peg Solitaire", and you'll get solutions for many variations, including the game that you find with golf tees on the tables of Cracker Barrel (no offense intended to white people).

    3. Re:Assembly for speed? by leifbk · · Score: 1

      I think the game is called "Pegged". My dad made one for me when I was a boy.

      Your problem reminds me of the classic article by Niklaus Wirth: "Program Development by Stepwise Refinement" in which he describes different approaches to the Eight Queens Problem. This is highly recommended reading, demonstrating that the algorithm can mean a world of difference.

      regards, Leif.
      --
      I used to be a sceptic. These days, I'm not so certain.
    4. Re:Assembly for speed? by Anonymous Coward · · Score: 0

      Regarding your recent example - I hope your switched your new search from Python to a native compiled language (C, C++, ML, any decent Common Lisp implementation), since that alone could easily give you a 50-100x speedup?

      Linear speedups often do matter. Not when they're a matter of 20% or something like that, but when comparing interpreted vs. compiled languages, they are very significant.

    5. Re:Assembly for speed? by Anonymous Coward · · Score: 0

      You're taking the wrong lessong away from your experience.

      The lesson is, always do back-of-the-envelope calculations before you leap in and start coding. Your mistake was intuitively obvious to anyone who's used to doing this.

      I'm tired of hearing people say "don't worry about low-level optimizations". I just wrote a simulator for a CPU and it was SLOW and then I made it 10x faster by applying a small number of low-level optimizations. This stuff does work. Worry about them last, sure, but don't forget them - they get you your order-of-magnitude improvement after you're done algorithmically optimizing things to get your 3 orders-of-magnitude improvement.

    6. Re:Assembly for speed? by DonGar · · Score: 1

      That was sorta my point. Assuming that performance went from 1,000 jumps/second (a rough guess at what I was getting with the initial implementation which was REALLY wasteful) evaluated to 10,000,000 jumps/second, then the run time would drop from 300,000,000 million years to 30,000 years.

      A massive improvement, but still useless from a practical point of view.

      But yes, you are correct, linear improvements are sometimes the critical edge needed to make a project useful.

      --
      plus-good, double-plus-good
  340. what schools don't do assembly by steak · · Score: 1

    i goto Baylor, a school known more for republicans so conservative rush limbaugh pitches a tent, and even here we have at least one assembly class required.

    p.s. read the rope

  341. 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.

  342. on programming today by Anonymous Coward · · Score: 0

    assembly language programming is a good way to learn how computer architecture and programs interact. it's not a good way to learn how to write modern computer applications. there is a place for both kinds of programmer. some code needs to be written closer to the hardware, and some code needs to be written closer to the user. there is a need for both kinds of programmer.

  343. New? by imnoteddy · · Score: 1
    based on a new concept - teaching computer science through assembly language

    New concept? Sorry children, but back in the day (mid 70s for me) we all started out with assembly language. It isn't new - it's mostly a lost art.

    --
    No electrons were harmed creating this post, though some may have been subjected to electrical and/or magnetic fields.
  344. A new concept, huh? by Anonymous Coward · · Score: 0

    Seems like Knuth's books have been out for a long time...

  345. cart, horse. by Anonymous Coward · · Score: 0

    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.


    Correlation doesn't necessarily mean causation.
  346. Assembly Language is essential by jamej · · Score: 1

    I'm completely convinced you cannot be a computer Master if you didn't learn assembly language when you were a grasshopper. Respectfully, Quai Chang Kane

  347. 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 Genda · · Score: 1

      This is as goofy as the time my coworker at a silicon valley startup, made a three bit adder using K'nex and ping pong balls!!!

      Genda Bendte

    2. Re:4-bit Full Adder Using Relays or Vacuum Tubes by Anonymous Coward · · Score: 0

      How is this interesting? It's funny!

    3. Re:4-bit Full Adder Using Relays or Vacuum Tubes by Anonymous Coward · · Score: 0

      Just imagine how slow that'd be. Relays take about 2 hrs to go from one state to another. Now think about 120 million of them.

      You'd have to ensure they broke march when going near a bridge since you might get the natural frequency!!

    4. Re:4-bit Full Adder Using Relays or Vacuum Tubes by Bitmanhome · · Score: 0, Redundant

      Sure, here ya go. As a bonus, this code uses my patented Relay Acceleration Technology (RAT) that performs many times more adds then a normal relay network can handle.

      You're welcome.

      int timer=0;
      byte add(byte a, byte b) {
      if(++timer > 100000) {
      clickSomeRelays();
      timer = 0;
      }
      return (a+b)
      }

      --
      Not that this wasn't entirely predictable.
    5. 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
    6. Re:4-bit Full Adder Using Relays or Vacuum Tubes by Anonymous Coward · · Score: 0

      Do you have a cool logo for your project yet?

    7. Re:4-bit Full Adder Using Relays or Vacuum Tubes by Anonymous Coward · · Score: 0

      It might make more sense from a design standpoint, but not from many others. Would you be willing to spend extra money on a device because it would make the designers' work a little bit easier? For the same reasons that high-performance kernel code isn't written in heavily object-oriented languages and airplanes aren't completely made of that virtually indestructible material that houses their flight recorders,

      Wait, I just realized that that was a joke. Heh. I need to get out more.

    8. Re:4-bit Full Adder Using Relays or Vacuum Tubes by Anonymous Coward · · Score: 0

      One of the first digital computers, the Mark IV (I think) used relays. Adm. Grace Hopper also had an anecdote about finding a moth in the relays of a computer (she claimed it was the first "bug", but most people who have studied the question say otherwise). ENIAC was the first vacuum tube computer, and thus completely electronic (rather than electromechanical, like Mark IV).

      Of course, you must be joking if you're talking about using relays to build digital circuits. They're relatively expensive per gate, noisy, use more power, generate more heat, and fail more easily than your common quad NAND IC.

      The purpose of learning de Morgan's law is probably mainly to help convert all-positive logic to use the negative logic most common in modern logic families, but it's not the only, exclusive use. It's still handy for working with the basic logic equations at a purely mathematical level.

      Finally, you can have solid state relays built out of transistors. They take up more transistors than a basic logic gate like NAND, though.

    9. Re:4-bit Full Adder Using Relays or Vacuum Tubes by BigBlockMopar · · Score: 1

      Of course, you must be joking if you're talking about using relays to build digital circuits. They're relatively expensive per gate, noisy, use more power, generate more heat, and fail more easily than your common quad NAND IC.

      The noisy part is good. Remember the old VCRs that made all those satisfying metal clicking sounds, not like today's impotent plastic junk.

      Finally, you can have solid state relays built out of transistors. They take up more transistors than a basic logic gate like NAND, though.

      Don't want to. Want the snaps. The whole point is not practicality, it's fun.

      I have a variety including over 50 suitable relays, from tiny little reed relays, general appliance relays, winch-control relays, to a couple of big 200A DPDT contactors used for reversing (relatively small) industrial DC motors. Naturally, they all have different coil voltages, so I'll have to build several power supplies to keep them all happy.

      --
      Fire and Meat. Yummy.
  348. 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
    1. Re:From a ring counter to OOP by Anonymous Coward · · Score: 1, Funny
      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.


      512 Megs of L1 cache? Where the fuck are you hiding your time machine?

    2. Re:From a ring counter to OOP by rcpitt · · Score: 1
      OOPs

      :-)

      --
      Been there, done that, paid for the T-shirt
      and didn't get it
  349. 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
  350. Then make it binary! by Anonymous Coward · · Score: 1, Insightful

    Why don't we just learn to code in binary? If we really want to get to know the computer, then binary is the only way to go... Computer Science is as much about computers as Astronomy is about telescopes. While knowledge of assembly would be useful, I don't think it is absolutely necessary. I know that several CS professors at my university don't even know any programming language, because it's not what they really do. They write algorithms to solve complex problems more efficiently. If learning Assembly helps with that, then fine, but I don't think it's absolutely necessary for CS. Now engineers, that's another thing...

  351. My method for learning to program: by Anonymous Coward · · Score: 0

    I've always liked the method I learned to program and have communicated this to others.

    Here it is:
    1) Basic (of the applesoft variety to be specific) This language teaches the basics, ordered execution and program flow

    2) Assembly (the 6502 variety in my case) This shows you what the processor is actually doing when you use functions like print.

    3) C/C++/Java/etc These higher level languages provide time saving libraries and remove a lot of tedious manual register management allowing easy creation of useful programs.

    4) Profit! (I haven't made it here yet)

    I believe that jumping straight into assembly would be too daunting for most people, and basic provides a nice introduction into programming in general. Assembly is necesary, with out it you don't know what C (or whatever language) is doing when you use pointers, structs, malloc, etc.

    I use to say "Real programmers code everything in assembly!" The thing that blows my mind is that, with many newer processors, the compiler knows more than I ever will about the processor and can take advantage of all kinds of quirks due to the internal architecture to produce better code than I ever could without studying the internal design of the processor. Just knowing all of the instructions isn't good enough anymore!

  352. Knuth's Art of Computer Science did it, too by Dorktrix · · Score: 1
    While Don Knuth's assembly language MIX runs on a theoretical processor, all of the examples in The Art of Computer Programming (TAOCP) are based on it. Even as he has revised the editions, he has updated the language to be based on RISC (search Google for MMIX), but he chose not to update the examples to a higher level language. Here is his reasoning from his web page:
    Many readers are no doubt thinking, Why does Knuth replace MIX by another machine instead of just sticking to a high-level programming language? Hardly anybody uses assemblers these days.

    Such people are entitled to their opinions, and they need not bother reading the machine-language parts of my books. But the reasons for machine language that I gave in the preface to Volume 1, written in the early 1960s, remain valid today:
    • One of the principal goals of my books is to show how high-level constructions are actually implemented in machines, not simply to show how they are applied. I explain coroutine linkage, tree structures, random number generation, high-precision arithmetic, radix conversion, packing of data, combinatorial searching, recursion, etc., from the ground up.
    • The programs needed in my books are generally so short that their main points can be grasped easily.
    • People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird.
    • Machine language is necessary in any case, as output of many of the software programs I describe.
    • Expressing basic methods like algorithms for sorting and searching in machine language makes it possible to carry out meaningful studies of the effects of cache and RAM size and other hardware characteristics (memory speed, pipelining, multiple issue, lookaside buffers, the size of cache blocks, etc.) when comparing different schemes.

    Moreover, if I did use a high-level language, what language should it be? In the 1960s I would probably have chosen Algol W; in the 1970s, I would then have had to rewrite my books using Pascal; in the 1980s, I would surely have changed everything to C; in the 1990s, I would have had to switch to C++ and then probably to Java. In the 2000s, yet another language will no doubt be de rigueur. I cannot afford the time to rewrite my books as languages go in and out of fashion; languages aren't the point of my books, the point is rather what you can do in your favorite language. My books focus on timeless truths.

    Therefore I will continue to use English as the high-level language in TAOCP, and I will continue to use a low-level language to indicate how machines actually compute. Readers who only want to see algorithms that are already packaged in a plug-in way, using a trendy language, should buy other people's books.

    The good news is that programming for RISC machines is pleasant and simple, when the RISC machine has a nice clean design. So I need not dwell on arcane, fiddly little details that distract from the main points. In this respect MMIX will be significantly better than MIX.
    1. Re:Knuth's Art of Computer Science did it, too by Junks+Jerzey · · Score: 1

      While Don Knuth's assembly language MIX runs on a theoretical processor, all of the examples in The Art of Computer Programming (TAOCP) are based on it. Even as he has revised the editions, he has updated the language to be based on RISC (search Google for MMIX [google.com]), but he chose not to update the examples to a higher level language

      Mod the parent up! That the most classic text in computer science uses assembly language for code examples is exactly what the original poster wanted.

  353. 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
  354. Not a new approach by Anonymous Coward · · Score: 0

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

    Well, it's actually still done today. While most CS1 programs use a high level language like Java, Scheme, C++ or (less common) Pascal, Yale Patt and others have text books, commonly used, that use assembly. There's a community of CS educators that advocate what's called the "machine model" of learning--starting with bits and gates, and working up to assembly.

    But in the slashdot "learning via google" community, this point is probably lost on most people.

    If you want to learn more, visit his web page: http://www.ece.utexas.edu/~patt/

  355. Question by jadavis · · Score: 1, Interesting

    Ok, I can make my way through a couple different assembly languages, but I'm missing something important.

    Every program you write is run inside the operating system, right? So how does an OS switch between all those tasks if it seems like you're intimately working with the hardware? You put something in a register, well what if a new task comes along and want's to use that register also?

    Is everything virtualized from the kernel, sort of as if the kernel is the machine? How do you differentiate between accessing kernel memory and accessing virtual memory?

    Also, doesn't the operating system implement the RTS and other basic features? If you're programming a kernel, do you not have the RTS available?

    I think that all these questions are related. Would someone please enlighten me?

    --
    Social scientists are inspired by theories; scientists are humbled by facts.
    1. 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!

    2. Re:Question by douglas+jeffries · · Score: 1

      Generally, an operating system saves context between tasks. That is, anything necessary to restore the current operating state of a task is saved (e.g. program counter, stack data).

      The amount of saved data depends on how smooth of a context switch is needed. Most desktop OSs will save everything a task needs to run so that switches are very smooth and transparent to the application code. On the other hand, real-time OSs often save less. At work we are developing on a system with very contrained resources. The RTOS I have coded does not perform a full context switch. The stack data is not saved, and control jumps (via longjmp) to the RTOS scheduler. Every context switch blows away non-static variables, and restarts the current task at the top (or possibly switches to a new task). This is acceptable because it is a non-preemptive system. It is necessary because our memory contraints are very tight.

      As an RTOS, the only things available are those specifically supported by the hardware. There is no magic to support you, that's what you're providing to others.

      There is also no reason an OS must be written in assembly, or that it must not be. Many developers consider C a much more effective system language, although C programming is much different at that level and still requires a good understanding of the machine's instruction set.

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

      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!

      Google? what the hell is that? Is it good or is it whack?

    4. Re:Question by Endive4Ever · · Score: 1

      Every program you write is run inside the operating system, right?

      That's where you are completely wrong.

      Assembly Language programs can pimp off the I/O and system calls of an Operating System. They do not have to. As an extreme example: an 'x86 assembly language program can be written that replaces the BIOS ROM chip on a PC motherboard. You can then use the ISA channel drivers as general purpose I/O ports and roll out a 'single board computer' design.

      In general, there are more 'computers' and 'microcontrollers' out there running Assembly language on 'bare hardware' than there are 'computers' running 'Operating Systems.'

      --
      ---
  356. 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.

  357. You lucky b*stards... by Chordonblue · · Score: 1

    ...I actually got my first taste of machine language programming as a kid on the...

    MAGNAVOX ODYSSEY2 Game Console (complete with sync-sound action and lots of exclaimation points!)

    OMFG. It was called, "Computer Intro." You had one line of 8 characters to program on, one 8 character line to use as a display. Basically, you could animate a few characters and make it 'buzz' annoyingly.

    Incredibly primative, but it did in fact teach me the basics of assembly. One quote I remember from the manual referred to how 'microprocessors might someday fit as many as ONE MILLION transistors on ONE CHIP!' Heh.

    More info here:

    http://www.classicgaming.com/o2home/db/cart.asp? ma sterid=12&cartid=12

    --
    "...Well, there's egg and bacon; egg sausage and bacon; egg and spam; egg bacon and spam; egg bacon sausage and spam..."
  358. 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.

  359. Where's the 307? by Rob+Riggs · · Score: 1

    That set needs a 307 to be complete.

    --
    the growth in cynicism and rebellion has not been without cause
  360. debug for dos by ender-iii · · Score: 1

    anyone ever try writing asm with debug.exe?
    now that was fun

    --
    ender-iii
  361. Bollocks. Not a new idea, nor a good one by ajv · · Score: 1

    I don't know if your submitter knows any history at all, but for me, circa 1989 - 1991, we learnt IBM 370 machine architecture and Motorola 68000 assembly language for two first year subjects. Nearly useless then, and completely useless now. So it's not a new idea, and in fact, it's a complete and utter WAFTAM.

    Learning good software engineering skills, working with peers, and instill a desire for continuous lifelong learning is far more important than being tought a ridiculously low level representation.

    Just as you get to know x86, and it'll be obsolete as you should now know x86-64 extensions, or an embedded instruction set (gasp!). If you are really going to do embedded stuff, you should learn the PPC instruction set (this week) as IBM's 400 series embedded processor rules the roost or Intel's (ex ARM) XScale instruction set for PDAs.

    On some ISA's, hand coded assembly has NEVER been faster than the C compiled variant. On Pentium III and 4's, you need to know how to fill the two integer ALU's and order instructions properly to prevent stalling. You as a human are too mentally puny to do this properly. More to the point the time you might be able to achieve by hand coding something is better spent looking at the algorithm. You might be able to save 30-80% off the overall execution time if you spend your time properly, rather than a few nanoseconds here or there.

    For a hard example, I sorta maintain Pnm2ppa, the HP print driver for HP's lamest printers. They print the bit pattern under the head at the time, and they're incredibly dumb. pnm2ppa is a master work of reverse engineering done by a few others, but I optimized it ... a bit. By unrolling the stupid hand assembly and getting rid of the "register" hints in the code. That made it go about 20% quicker. Then I unrolled a hand rolled up loop because someone thought they knew how compilers and assembly worked on a wide buffer. By simply making the instructions simple, gcc managed another 20% then and there because it understood what the code was SUPPOSED to do rather than what someone thought gcc might do. Then Klamer Schutte came in, and rejigged the gamma table lookup code and shaved more than 97% off the 40% faster execution time in return for 4k of memory in a look up table. Simple algorthmic improvement - and no assembly.

    So it's completely a useless skill. For the average CS major (not engineering major), do not waste your time on assembly.

    Instead, learn five or six languages to reasonable competence, and two well, and master one. This will stand you in good stead if another language or framework comes out and becomes the defacto commerical tickbox (C-> C++ -> Java -> C# for example). Don't learn COBOL unless you want to maintain bank software.

    But most of all, learn how to project manage and write documentation. These are a real world skills you can use to kill off projects you don't want to do, or at least make a go of them if you are forced to do them.

    --
    Andrew van der Stock
    1. Re:Bollocks. Not a new idea, nor a good one by Anthony · · Score: 1

      Just a minor nit Andrew. 370 Assembler is not totally useless as there is a bunch of Assembler exits still being used around the world. The instruction set of the later machines is an extension of the basic 370 and most of the coding tricks should still work. I peeked over the shoulder of a programmer last year maintaining one. Not doing assembler language is limiting one's view of programming though. Basing a whole course around it is pushing it, however. A CS degree should have a computer architectural component to it and Assembly languages should be part of that course. Writing programs without having a reasonable model of what will happen when it executes is, IMHO, limiting. Not having read the book, I can only surmise that that is the point of the book.

      --
      Slashdot: Where nerds gather to pool their ignorance
    2. Re:Bollocks. Not a new idea, nor a good one by BigBadBri · · Score: 1
      So it's completely a useless skill

      I'm feeling controversial, so I'll compare that staement to the assertion that 'Latin is a dead language'.

      Of course assembler is not worth using, but it is worth learning, in the same way that Latin is worth learning, because it gives you an insight into how languages work.

      I myself prefer assembler over C - if I'm going to get down and dirty with the machine, I'll do it properly, but if I want to produce usable maintainable code, I'll use Java or Lisp (or even C++ if pushed by the PHB).

      Assembler is a wonderful thing - it reminds you where the computer came from, and provides a useful grounding point when your mind wanders too far from reality.

      I should post this as AC, 'cause it's total bollocks, but I'm convinced that assembler is worth keeping alive, so (in the words of John Lydon) fuck off, cunts!

      --
      oh brave new world, that has such people in it!
  362. Said Gandalf... (the Wizard, get it?) by Esion+Modnar · · Score: 1
    Frodo, this Code was Assembled in the time of CP/M! You must take it to Mount MyDoom to have it Disassembled! But beware the, uh, Code Wraiths and Sith Lord Darl...

    (And yes, I agree, knowledge of Assembly does give you better fundamentals, even if you only use it occassionally. However, I can appreciate why people don't want to write 25 lines of assembly to achieve the equivalent of 1 line of C.)

    --

    They say the first thing to go is your penis. Well, it's either that or your brain. I forget which...
  363. CS != Engineer by Anonymous Coward · · Score: 0

    I graduated from an accredited 4yr with a degree in Engineering. Can I call my self an Engineer. NO. I would still have to pass the EIT (Engineer in Training Test), then work for at least two years in Engineering and then I would have to pass the PE (Professional Engineer). Only then could I say that I am officially an Engineer, and this is the "fast track" in the US.

    Those in CS seem to think that all they have to do is get a job writing HTML and they should put Engineer in their title.

    Don't get me wrong, I know a lot of people in CS who I would consider Engineer quality. It just annoys me, all of the "Software Engineers" who are reducing the reputation of Engineering.

    If you want to be considered a Software Engineers then you should have to pass certain standards created by a group of professionals. The schools need to be inspected by these professionals to make sure that they are teaching to certain standards.

    In the same breath, I do some programming, enough to impress those who don't and enough to know when the CSs I work with are blowing smoke. Do I pawn myself off as a CS. Hell No! I am realistic about it. I know some CS who should be considered Engineers of the field, and others while they claim to be Engineers write code so bad that I can see the bugs.

    1. Re:CS != Engineer by BigBadBri · · Score: 1
      Thankyou for your insight

      As a non-engineer, it was insulting for me to have to explain (and prove) from first principles the flow of viscous liquids through a pipe, and for the 'engineer' (a wanker that referred to Arabs as 'camel jockeys') to then send my explanation to a 'chartered engineer' for verification.

      I don't know how it is in the US, but here in the UK, a chartered engineer is a waste of space - a dickhead who knows which table to look stuff up in.

      The guild system is alive and well, and it's in all the so-called 'professions' in the UK.

      --
      oh brave new world, that has such people in it!
  364. Re:Why not just use an HP calc?-SATURN by Anonymous Coward · · Score: 0

    You joke, but the SATURN CPU is very educational, AND available. But I recommend you get the special cable for PC hookup, for obviously the keyboard and screen aren't programmer friendly.

  365. Computer Systems, not Science by ajayvb · · Score: 1

    An excellent course taught in Carnegie Mellon University is "Computer Systems: A Programmer's Perspective" - CS:APP or 15-213, the course number by which it is better known. A better way to put it is that they are teaching computer systems and not computer science, which by definition is much wider in scope. A book based on this course, (which is immensely popular among CS and ECE majors here) is also available. Check it out at http://csapp.cs.cmu.edu

  366. computer science... by Anonymous Coward · · Score: 0

    not teaching a coder how to program in assembly lang. is like teaching a student how to read by by having the student listen to books via audio tapes

  367. WHEN should students learn Assemby by Poligraf · · Score: 1

    As someone with MSCS and experience of knowing 4 different Assembly languages, I think students need to be taught Assembly. The key is chosing the best moment to do that.

    This moment is defined by the GOAL: teaching the students to write efficient programs.

    In my opinion, Assembly should be studied AFTER students study:
    1) Algorythms and data structures;
    2) Procedural programming;
    3) OOP and component models.

    These things are good to be taught using C and Java.

    At the same time, Assembly should be mastered BEFORE the coding style of a new student will be formed (as well as before different scripting languages).

    --
    Tigers respect lions, elephants and hippos. Maggots respect no one. (C) S. Dovlatov
  368. Hmm.. by rfernand79 · · Score: 1

    Not sure if this is "new" or not, but I'm sure that Donald Knuth's "The Art of Computer Programming" is written in assembly code (MIX). Want to learn computer science? Computer Architecture, Automata Theory, Formal Languages, Compiler Technology, Algorithm Analysis and Math are usually good (required) starting points. The language should not really matter - even the JVM has "assembly". We should teach people general truths, not specifics. What if this "Linux x86" assembly students face a PowerPC? or a SPARC? or sometihng with a different ISA?

  369. That's how I learned by jbohumil · · Score: 1

    When I took programming class in 1977, we started out with a limited instruction emulated assembler language one of the instructors had designed. Then we learned assembler language, and then finally Fortran and Cobol. This forced us to learn the binary reality of the machine, it's data formats and how it actually worked instruction by instruction. I've met programmers in years since who lacked this approach to training, and thier lack of understanding of binary data representation and the assembler code generated by the higher level compilers always keeps them from reaching the highest levels of proficiency. In programming you will inevitably be faced with situations in which a deep level of what is happening at the assembler and binary level will aid you in solving a problem. It's what separates the good programmers from the excellent programmers.

  370. assembler for a hypothetical stack machine is ... by Poligraf · · Score: 1

    ... Forth.

    --
    Tigers respect lions, elephants and hippos. Maggots respect no one. (C) S. Dovlatov
  371. Actually, they DON'T.-optimizing XML by Anonymous Coward · · Score: 0

    "(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.)"

    Slightly OT, but are there any XML optimizers? Specifically SVG.

  372. Some corrections by rs79 · · Score: 1

    No one would really call the PDP-11 a CISC machine. You might call it a RISC VAX however

    I've always held RISC to mean "executes an instruction in a single cycle" and the PDP-11 cpu's did not work that way. The instruction set was no more reduced than any other 16 bit minicomputer of the time, it was just more powerful, sensible and orthogonal than anyyhing else.

    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."

    All PDP-11 cpu's other than 11/15 and 11/20 were microcoded, only the 11/60 had a writable control store and was user microprogrammable. I never saw one - like the IBM 360/84 or /96 or something - that was also microprogrammable, you never really heard of one, ever.

    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.

    RT11 was awful and made Z-80 CP/M look advanced. RSX-11M was another story but by '76 pretty much every PDP-11 at a university was running UNIX while very few if any in industry were, they used RSX-11M or RSX-11D. RT11 died out pretty quick when RSX-1M became stable around '77.

    Fitting in 4K wasn't a big deal, by the mid 70s 16K was still considered pretty minimal and most machines had more, like 128K an big system might a total of say 90K used by the various tasks running in your average "big" application.

    --
    Need Mercedes parts ?
  373. 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).

    1. Re:in reality... by shadowbearer · · Score: 0, Redundant

      Ow. My head hurts :)

      Thanks. I just wrote assembly on the damned things...circuit design I failed at, miserably.

      This is going to haunt my dreams for a week. Thanks a lot :)

      SB

      --
      It's old. The more humans I meet, the more I like my cats. At least they are honest.
    2. Re:in reality... by Anonymous Coward · · Score: 0

      Actually, stacked pass gates can be very tricky for your average designer to get right. Furthermore, your statement about pass gates being faster isn't even true. Because of the capacitance and other loading issues, amplifying gates (as you call them) are generally much faster than pass gates. For a given amount of power, the extra resistance imposed by the pass gates slows down the possible transition time at each output.

      Pass gates have the virtue of being bidirectional and fairly simple for dense structures like MUXes, however. Also, they can be used to build funky logic gates that are faster than purely static BiCMOS (because they can often avoid the transition altogether). However, saying that pass gates alone are faster is just plain wrong.

      I'm in complete agreement about not just using NANDs, although it's often simpler to analyze such a circuit, since you don't have to worry about the different transistor driving strengths among different gates.

  374. I read it online, as for learning the assembler... by JollyFinn · · Score: 1

    And found out that it was THE best source for learning assembler for me. Almost every other asm tutorial I found on net was for windows. And everything else I found for linux wasn't beginner friendly, I tried to learn it from those sources but simply it was bits and pieces everywhere and nowhere anything comprehensive. So basicly if you use linux as your only OS, and wan't to learn assembler. Then get the book as pdf from savanna.nongnu.org , its practicly your ONLY reasonable source for doing it from material from net.

    --
    Emacs is good operating system, but it has one flaw: Its text editor could be better.
  375. 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/

  376. Free book (duh) DO NOT BUY THIS BOOK by Anonymous Coward · · Score: 0

    The book is free. Yeah he should ave disclosed that he wrote it, but its free

  377. Oooh, good plan by Rogerborg · · Score: 1

    Because the Indian programmers currently eating our fucking lunch, well they took the time to learn assembly language, right? Right?

    --
    If you were blocking sigs, you wouldn't have to read this.
  378. Another book by the same name.... by hyph-n · · Score: 1

    there is some irony here somewhere....

  379. 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).

  380. Re:Chills? It Ain't That Bad. Just Avoid x86 To St by Kardamon · · Score: 1

    I second that. I would suggest ARM to learn assembly. ARM has an elegant instruction set & an nice collection of registers, it is widely used (palmtops, embedded...) and several operating systems (Linux, EPOC/Symbian, RiscOS...) are available.

    --
    -- Qu'est-ce que la propriété intellectuelle? It is thought control.
  381. Remember the days by Evets · · Score: 1

    Remember manually typing in assembly or machine language code straight out of Compute! magazine into pfs:write on your double floppy disk apple IIc or e to play the latest video game of the month?

    I was 7 when I started doing that.

    I have to agree that understanding at least some of the basics of assembly forces you to have a better understanding of how computers work in general. For every 10,000 visual basic programmers, there is one guy out there who could tell you accurately how a computer works.

    I'm afraid in 10 years there won't be any real OS upgrades because the current crop of graduates either don't know how to build the basics of an OS, or aren't interested in doing so.

    Real progress won't be made until a visionary comes around who can build a computational system more efficient than a large grouping of transistors. That visionary is probably in diapers now, and won't realize the fruits of his labor until most of us have laid down our keyboards in favor of shuffle board sticks.

  382. It's the tools, not the language by Cardbox · · Score: 1
    The thing that makes you program so much better in assembler is the fact that the debugging tools aren't nearly as good.

    The best code I ever wrote was when I wrote my own homebrew assembler in Basic (on a Pertec PCC2000 with ROM basic, no other OS). I didn't write a debugger, so the only way of testing a routine was to run it. You very quickly learn to write things RIGHT when any bug means rebooting and starting again!

    I wrote a whole CP/M BIOS using that system, so then I had the world's only PCC2000 with CP/M. But more seriously, the code I produced there lasted 8-10 years in commercial packages I produced. With no bugs. Not one.

    I'm not boasting: it was the lack of a debugger that did it.

  383. Using Assembly is like shaving with a machete... by anandcp · · Score: 0

    Someone said: "programming in assembly is like shaving with a machete. If you are very good at it, you can get a decent shave; if not... well let's forget about it."

    --
    -------- Cluster bombing from B-52s is very, very accurate -- the bombs always hit the ground.
  384. Submitter is a homophobe by Anonymous Coward · · Score: 0

    Not only did the submitter hide the fact that he wrote the new book he's hawking, but he's also a homophobe who likens homosexuality to rape, in this article:

    When you see someone who is a murderer, a prostitute, a rapist, a homosexual, a cheater, or whatever, God's instructions are to simply view them as people who need Jesus.

    I know this comment will get lost in the (nearly) one thousand other comments, but never-the-less I feel compelled to call it out.

    1. Re:Submitter is a homophobe by Anonymous Coward · · Score: 0

      Most of the world is homophobic, and 99%+ of the world is racist. Lets concentrate on his intellectual contribution, and leave out his moral or ethical beliefs, otherwise we'll have to give all submitters to have some kind of morality quiz so we can spend our days moralising.

    2. Re:Submitter is a homophobe by Anonymous Coward · · Score: 0

      Shut up, faggot

  385. asm in cs curriculum by sangdrax · · Score: 0

    Assembly languages have been in my CS curriculum's first year (Delft, Netherlands) for years. It was PDP-11 assembler when I started but got changed (fortunately) into PowerPC assembler in '98 orso.

    It is used to show the students the inner workings of a computer rather than really teach them the full power of PowerPC assembler, since knowing any assembler language itself is rarely needed in real life.

    The inner workings of other programming languages when translated into assembler (function calls, stack, etc) are covered in the second year.

    1. Re:asm in cs curriculum by cpex · · Score: 1

      I dont know about your cs program but where i am at we take intro class to java then some data structures then some sparc assembly, somemore data structures and algorithm classes then some digital design then some computer architecture were we actually design and simulate from gates and flip flops up a 8 bit single cycle cpu with our very own instruction set from there we get to write a compiler for oberon which generates assembly for sparc. oh and dont forget os class where we learn how to do scheduling, context switching, memory management etc and since i am ce i get to ake all the ece courses like analog design, signals and systems, and lots of other fun stuff.

  386. Bring back assembler! by Zog+The+Undeniable · · Score: 1
    I too remember the days of 1980s home computers, when the choice was glacially slow interpreted BASIC or "machine code", which, as compiled BASIC was also pretty bad, meant assembler.

    I never managed to do much beyond a few fancy screen scrolls and a very fast encryption program, but in my Computer Studies coursework, I was God - no-one else submitted 6809 assembler listings :-)

    Nowadays with gigabytes of RAM and fast CPUs, I believe the emphasis is on easily created and reusable code, rather than the days of 1MHz CPUs and 32K of RAM, where the object was to bum the code into the fastest, smallest possible form. Sad to see it go, really.

    --
    When I am king, you will be first against the wall.
  387. start teaching assembly language first...... by martin · · Score: 1

    How about just..

    'start teaching assembly language'

    There's lots of 'Comp Sci' students out there that really don't want to learn the basics. They want pointy clicky, draggy droppy and really hate anything like real work (ie a command line).

    This is a big problem for the Uk Universities as each module has a point system, and you pass so modules = get a degree.

    Alot of students are avoiding programming courses (or any course with programming content), and still get a comp sci degree.

    This means the 'programming' course have low numbers and are therefore under pressure to 'close'.

    IHMO there should be a core set of courses + a few options, not totally choice based. This means that you HAVE to pass the programming courses the maths courses etc etc.

    too much choice makes the world a bad thing, too little is bad too..

  388. Writing many Assembly vs. few HLL lines by Teancum · · Score: 1

    There is an amazing concept with Assembly programming: Macros!

    Seriously, this difference isn't really all that big if you really know how to use the assembler properly, and with most of the modern assembly languages many of the concepts that you might be familiar with in HLL (High-Level Languages... does C++ count?) like arrays or even objects can be done fairly effectively in assembly as well. It is possible that you are using an underpowered assembler, but the same can be said of a poor compiler.

    When I am programming, especially time critical functions even when using HLL, I am very much aware of what the compiler is going to translate that code to in assembly. I had a co-worker who was trying to review a particularly tight routine, so he challanged me to compare the compiler's output with what we would do by trying to do it by hand.

    Besides some quirky register usage (which is typical with most compiler designs and a necessary component of designing a compiler) our code was identical.

    The point is, like mentioned elsewhere, you really need to know assembler and how the computer archetecture is affecting your code to write quality code yourself.

    I guess this is why I am anti-Java and to some extend dot Net (.net) or other similar VM implimentations: They keep adding abstraction that makes you lose sight of how the machine is actually functioning. These VMs have their place, don't make it sound like I hate the entire concept, but eventually you have to understand that individual gates inside a chip on actual hardware must be trying to interpret your code and if you can't translate a line of code down to that level you really don't know programming.

    1. Re:Writing many Assembly vs. few HLL lines by Esion+Modnar · · Score: 1
      For some reason, the book "Code" by Charles Petzold has come to mind. This is a very good read-- he starts by describing Morse code, and by the end of the book, after one logical progression after another, he winds up explaining computer architecture.

      I guess I mention it because it would be very good to read just prior to picking up a good book on assembly.

      --

      They say the first thing to go is your penis. Well, it's either that or your brain. I forget which...
  389. A new concept? by chris_sawtell · · Score: 1
    a new concept - teaching computer science through assembly language


    What total rot! Donald Knuth was doing this about 30 years ago. His MIX is an ideal virtual machine carefully honed for its purpose. To teach Comp. Sci. via Assembly code.

  390. Balanced approach needed by DollyTheSheep · · Score: 1

    While I think that assembler (and in general low-level languages) are neglected now in favor of high-level concepts, learning about a specfic computer architecture is definitely not enough. It is a well known fact, that most times a clever application architecture or algorithm is far more efficient as any low-level optimization (think 'quick sort'). A balanced approach between low-level concepts (assembler, programming on register level, knowing what pointer arithmetic can be good for), datatypes and algorithms and high-level concepts (modeling and higher OO languages) is needed. What engineering teams needs often most, gets sometimes not taught at all: project management, requirements engineering, team communcation, testing (and so on..)

  391. Ex M68K programmer by HogynCymraeg · · Score: 1

    I learnt to program on an ancient aquarius at the age of 9. It was great and my first steps were done in BASIC. I then got an Atari ST and the M68K chip blew e away. I wanted to be "like the other demo crews" so i set about learning. I got pretty far and Assembly language was pretty easy. Once PCs came to the fore i thought "Great! I'll transfer my skills to a mainstream platform". How dissapointed i was to discover that the x86 was a crippled chip with only 4 registers. I know things have changed these days but it put me RIGHT off. The M68K had 8x16 bit data registers and 8x32bit address registers (IIRC). It was a dream to push around bits and have plenty of storage. So has the x86 platform evolved to a better state of afairs (like the good old 1979 M68K?). I certainly hope so, as it would rekindle my love for "to the metal" programming. I'd be interested to hear your comments.

    1. Re:Ex M68K programmer by mmu_man · · Score: 1

      Shamely it has evolved the same way the wintel platform always did, with patches and legacy :^)
      There are mmx regs, but you need special opcodes to use them, and they use the same storage as the FPU regs... You thought you could interleave mmx with floating point to optimize ? forget about it.
      I really miss the m68k...

    2. Re:Ex M68K programmer by HogynCymraeg · · Score: 1

      I'm not up on what motorola do these days but surely a similar chip that can emulate the x86 architecture would be possible?

  392. Nobody gets it by slashdot_commentator · · Score: 1

    Learning assembler is not about learning programming. It is about the integration of the theoretical basis of serial computing by interacting with its representation in physical hardware.

    Of course it may seem difficult and irrelevant. Assembler is not about providing abstractions so you can more easily develop working programs. Its all about the most basic logical operations combined by a programmer to achieve a finite state machine (the program). When you finally have a mastery of assembler, you come to appreciate boolean algebra and the concepts of serial computing. You learn to think as the CPU thinks. You develop a genuine understanding of the nature of a computer and an appreciation of the theory that made it come into existence. It must be like the feeling some physicists had at the turn of the century when they were muddling through general and special theory of relativity and a couple of decades later be able to validate the theories' "correctness" in the a-bomb.

    If you go through the trouble of learning to program assembler on more than one architecture you will come to realize that even though all the instructions have different mnemonics, (one CPU will have branch on condition instructions, another will have test and jump on flag instructions, some combination of instructions are more efficient on one CPU but not another -- whatever!) *its all the same*. And that's because the basic theory is all the same, regardless of CPU, or who made the computer.

    (This elegance of assembler of course does not apply to Intel CPUs, which incorporated all sorts of horrible kludges in order to add functionality to the CPU. Its the last CPU I'd want to be using for an assembler class.)

    I find people's reactions to assembler to be a good sign of the individual's grasp of computing. Those that can't interface with the core being of the machine is better off being a theoretician or go into management.

    --
    There is no America. There is no democracy. There is only IBM and AT&T and DuPont, Dow, General Electric, and Exxon
  393. I have to strongly disagree by Teancum · · Score: 1

    You weren't there, and you apparently havn't been reading the comments from the veteran programmers here.

    The folks who got started on Apple ][ computers (and TRS-80, Commodore, Atari, etc.) really needed to learn about the architecture to get stuff to work. Memory was measured in kilobytes, and that was only a two digit number at that. Even a typical programmer would eventually write a program that would use the entire available memory space, so you had to be forced into writing more efficient code and doing things that would never be done today with GB of RAM and TB of hard drive space.

    One of the problems that I see is that even fairly good programmers that are graduating from CS programs now take for granted that there is going to be lots of memory availble, so they tend to be very wasteful with both memory and CPU cycles. Then they wonder why their software seems sluggish and why the old-timers just about throw up on their code.

    Oh, BTW, in regards to who is going to move into management first, yeah, they may be able to impress some CEO if they have lots of flash, but that doesn't mean that some idiot who never really learned computer archetecture theory and became boss really knows what he (or she) is doing. It just means that the Peter Principle is at work. (Do a google search if you havn't heard about it.)

    1. Re:I have to strongly disagree by ttfkam · · Score: 1

      I "wasn't there?" What "there" would that be? You mean when the Apple II came out? I daresay that I was "there." I was "there" when the C-64 came out. I remember loading up blackjack and backgammon on a cassette player hooked up to an Exidy Sorceror that had been upgraded from 16K to a whopping 32K of memory. Woohoo!

      CLOAD BJACK

      *press play*

      This was before the days of Commodore branded cassette players. This tape player was like any other you buy in stores at the time, and it would take about 15-20 minutes to load before playing. It was on this computer that I wrote my first programs. Rocket ships flying across the screen and the like.

      The folks who started out doing assembly in the 70s had it easy. The folks before them called their programming language "a soldering iron" and their disk drives "punch cards." The point is, it's all relative. What you would call wizards, some would call Johnny-come-latelys.

      I am not at all saying that knowledge of (various dialects of) assembly is bad. Far, far from it. I found it quite enlightening; But taking pride in one's tasks and looking deeper into the "why"s and "wherefore"s makes you a better programmer, not a fixation on assembly. I've known "old-timers" who wrote absolutely horrendous code. They didn't care. I've also met sixteen-year-olds who didn't know C let alone assembly that made JavaScript and Perl routines that are as good as they could have been. They usually did care a great deal.

      Could the "wizards" do amazing things with assembly? Yup. Can I do the same? Probably not. Since I learned assembly, I haven't used it at all. I get the job done in C (or a higher-level language) and I get it done faster than the assembly guys. Why? Because assembly is slow and tedious. It can be fascinating when you are in the mood for that kind of minutiae, but most of the time, I prefer other kinds of minutiae.

      I know how to make a NOT and a NAND gate. This doesn't help me in my daily life. I was not a crap coder, learned assembly, and voila! I was a great coder. I started learning. I sucked. I kept at it. I had fun. I got better. I kept at it. And now I can hold my own in multiple languages on multiple platforms. Time on task and interest got me going, not assembly.

      The reason why there are so many more perceived crap coders is because there are so many more coders. In the 70s, computers were a rarified field and hobbyists were few, far between, and passionate about it. There are just as many (and possibly more) passionate individuals today, but computers are mainstream. With becoming mainstream, the computer field has quite a few new recruits who either just want to make a quick buck or have it as a passing fancy where no real time is spent. And that's fine. It's not like it makes someone a bad or stupid person.

      CS graduates take memory for granted for good reason. Memory is cheap and plentiful. 256MB costs $30. I remember saving up $600 after a summer job and purchasing 16MB of RAM. Learning the difference between an O(n) and an O(n^2) algorithm is not something that can only come from the use of assembly. Learning that a CPU has a 128KB L2 cache versus another with 512MB and that certain routines are more prone to cache misses is not dependent upon knowing assembly. Assembly can help you see the mechanics up close and personal, but anyone who knows to look at specs and can multiply can figure it out.

      And finally, management is something that happens over time to most folks. It is not because they couldn't do their job. In fact, many knew their job so well that it was getting boring. Rather than problem solving an errant resource leak, many go on to problem solve why some director of operations is harrassing my team over a lower priority item. Skill in one does not mean skill in the other. They both take practice. I take from your attitude that you have never been a manager for any real length of time. That's fine. For what it's worth, I am a better programmer than I am a manager.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
  394. Clever code? Unmaintainable code! by Lio · · Score: 1

    The knowledge of assembler language and the way computers work deep inside can help a lot in designing software, but they often lead to "clever code". I.e. a code which is so sophisticated and so cool, that you as the programmer will be very proud of it. But the pitiable new employee who is assigned to your team will struggle with that code as it turns out to be so clever that no one else will be able to maintain it.

  395. Re:I couldn't read the code my compiler generates by A55M0NKEY · · Score: 1
    I couldn't read the code the compiler generates. If I ever ran into a compiler bug, I would never know unless a later version of that compiler compiled my program w/o an apparent bug.

    The thing is, I took a course on x86 Assembly in college. We wrote a bunch of assembly programs. I would tell people honestly, if they asked, that I know x86 assembly, but that I haven't used it for years. ( since that class actually ) It would be possible to debug a compiler if you were familiar with the way that compiler lays out code etc. Merely knowing what 'mov eax, 3' and suchlike means is not enough.

    int 21h

    --

    Eat at Joe's.

  396. Spare me from these please by varjag · · Score: 1

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

    You've found it wrong. Learning assembly language is not that great undertaking, and clearly it is not the decisive factor in programmer's qualification. To bend the book's metaphor, knowing how a carburetor works isn't the thing that makes you a good race driver.

    Being in the trenches since '97, I find your implication (that such a trivial thing as knowing a few mnemonics and monkey tricks is what determines excellence in our trade) insulting. For heaven's sake, most of CS grads here go through assembly course: it's just as basic as it gets.

    --
    Lisp is the Tengwar of programming languages.
    1. Re:Spare me from these please by tarsi210 · · Score: 1

      To bend the book's metaphor, knowing how a carburetor works isn't the thing that makes you a good race driver.

      When you are a programmer, you are NOT the driver -- you are the engine builder. You are the person who has to know how it works lest you can't fix it when it breaks. You have to know why it's only getting 5 miles to the gallon instead of 10. You have to know when you are preventing that extra horsepower from coming through because of some other needed feature.

      You're right...assembly is the basics. And if you don't have the basics down, how will you have a proper foundation for the rest of your knowledge?

      Assembly programming has been invaluable in my career...not because I actually do it, but because it gives me a mindset -- I think about what is happening behind the scenes when I write a function -- the operations involved just to push a new function pointer onto the stack, load the variables, save the program counter, etc. It has made me aware and prevented me from making dumb programming mistakes that would have cost a lot in terms of performance and resources.

      Of course, just knowing assembly doesn't make you good. You have to have all the other skills on top, as well as a quick and thorough mind. But it's a GREAT place to start on the road to excellence.

    2. Re:Spare me from these please by varjag · · Score: 1

      When you are a programmer, you are NOT the driver -- you are the engine builder.

      Agreed. But the book in question did exactly that comparision.

      And if you don't have the basics down, how will you have a proper foundation for the rest of your knowledge?

      I'm all for getting the basics right :) It is the submitter's statement that the knowledge of assembly is the key difference from mediocrity was irriating me. Knowledge of whatever topic alone isn't going to give you excellence. I've seen some very good developers, and if I could point at anything distinguishing them from the rest (apart from expertise, which tends to accumulate with time) it would be their ability to concentrate and mental stamina.

      --
      Lisp is the Tengwar of programming languages.
  397. Re:WideScreens by tigersha · · Score: 1

    90% of the code nowadays have much more to do with the speed of the network between the database or another server and no assembler will really improve that. Algorithms, Caches, yes.

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  398. Just what exactly IS "Linux assembly language"? by gatkinso · · Score: 1

    Hmm?

    --
    I am very small, utmostly microscopic.
  399. Re:What you realize by A55M0NKEY · · Score: 1
    Yeah, if you write the whole program, you will have had to consider dereferencing yourself, but most times in assembly, you push a couple parameter values into some registers and goto your dereferencing 'subroutine' which puts the array value conveniently in a register for you.

    You would access the array using that 'subroutine', so you could forget about the mechanics of the actual dereferencing process. Maybe someone else would have written an nice 10 dimensional array member-access 'function' that you use, so you have no idea at all how the data in the array is stored. This is much the same as someone coding in C who doesn't even know assembly language.

    --

    Eat at Joe's.

  400. Re:Pet peeve of the year (was Re:Linux x86 assembl by perky · · Score: 1

    Sorry - Have recently started working for a firm where that kind of noun-to-verb conversion is commonplace. Must be strong in the face of corporatespeak.

    --
    "The new wave is not value-added; it's garbage-subtracted" - Esther Dyson, Dec 1994
  401. Teach how computers work LOL by salesgeek · · Score: 1

    Based on the last 20-30 programmers I interviewed, I think teaching assembly language is a great idea. One of the questions I ask in the interview just to weed out the posers is to whiteboard how each type of number (int, float, double, etc...) is represented in memory. Then I ask them how a simple string is handled in memeory (c or c++ style). Anyone who can't show me confidently is confidently shown the door. Last time it cleared 8 out of 10 candidates.

    --
    -- $G
    1. Re:Teach how computers work LOL by crsgrg · · Score: 1

      Does this mean that Computer Science in universities no longer teach microprocessor design and machine language, or computer language theory and models?

      I suppose this was inevitable. Each new generation of software "technology" builds on the last, adding another layer of abstraction and taking the programmer that much further from the engine that runs his work. Anything more than a layer where you started to learn is pretty much taken for granted.

  402. Graphitics, anyone? by Anonymous Coward · · Score: 0

    Assembly language poised for a revival? Wow, next thing you know people will discover how to emulate the working of a comuter using nothing but pen and paper.

  403. Not Sarcasm by nurb432 · · Score: 1

    No, i was serious.

    Though i never said they couldnt also get a 'pc', but they should *Learn* how to do it the right way first.

    I detest 'appliance' types that think they have a clue.

    --
    ---- Booth was a patriot ----
  404. Clueless "programmers' by nurb432 · · Score: 1

    My point wasn't that you had to know how things actually function to drop and drag and pretend you are a programmer, or IT guy or 'leet hacker'.

    My point is you have no clue unless you do, and you have no right to call yourself, anything other then a moron.

    Most of you people wouldn't recognize the details if it bit you in the ass. And personally the entire concept of the knowledge loss that is occurring ( and the arrogance of those that don't have a clue ) sickens me.

    --
    ---- Booth was a patriot ----
  405. toupper() call = moron, MOVE by cheekyboy · · Score: 1

    Yeah like morons that like to call ::toupper() Clib functions, rather than use a macro in a loop.

    100000 calls to toupper() will thrash the stack/cache, and be way slower than a pure optimized smart macro inlined.

    No clib funcs get inlined, face it.

    No wonder some peoples code can be 50% slower but barely look any different than a good coders code.

    Things cascade , and bingo, you get an application which is 3x slower than a good implementation.

    Like someone said, software is years behind hardware engineering, perhaps more software programmers should know more about hardware.

    No wonder some hardware engineers think of software engineers like software engineers think of managers.

    --
    Liberty freedom are no1, not dicks in suits.
    1. Re:toupper() call = moron, MOVE by 42forty-two42 · · Score: 1

      Can't toupper() be implemented as a macro that does an array lookup?

    2. Re:toupper() call = moron, MOVE by multipartmixed · · Score: 1

      > Can't toupper() be implemented as a macro that does an array lookup?

      Sure, and that would be *totally* obvious to any twelve year old writing it from scratch in ASM. I know, because I did just that about 18 years ago. Except it was converting ASCII to PETSCII, but same code, different array.

      Nowadays, as a CS PhD candidate to write toupper() in C and you're going to get a variant of this:

      char toupper(char c)
      {
      if ((c >= 'a') && (c = 'z'))
      return c + 'a' - 'A';
      } ...and he probably won't even notice the compiler warnings that his prototypes should be ints (assuming he's including ctype.h, which he probably will, because most of those guys cut and paste the same four hundred #include lines from project to project). Of course, the CS guy will defend his code by saying it also works on EBCDIC, or any other alphabetic encoding. *sigh*

      Ask an assembler guy to implement it in C, you'll probably get asked: "fast, or accurate?". Accurate would the lookup table. Fast will get a solution a like this:

      char toupper(char c)
      {
      return c & 64 ? c | 32 : c;
      }

      It's not accurate because it fucks up the @ sign and a few other things, but as long as you're just feeding it alphabetic characters, you're good to go. And it would significantly faster than any other solution, as it can be inlined in just a few instructions.

      Here it is for 6502 -- a very simple CPU -- ready to use as a function. I could shorten it significantly if the 6502 was more sophisticated (i.e. math unit could work with more than one register):

      PLA
      TAX
      AND #$40
      CMP #$0
      BEQ labelONE
      TXA
      ORA #$20
      PHA
      RTS .labelONE
      TXA
      PHA
      RTS

      I'd had to see the CS's solution, subtraction is (relatively) expensive.

      The code could be about half that size if it were inlined, as we could use the BIT instruction to test memory, instead of yanking it through the stack.

      --

      Do daemons dream of electric sleep()?
    3. Re:toupper() call = moron, MOVE by cloudboi · · Score: 1

      You'll notice you ragged the hypothetical CS person for using the incorrect prototype and then did not rag the hypothetical assembler person for doing the same.

      -cb

    4. Re:toupper() call = moron, MOVE by multipartmixed · · Score: 1

      You are correct, sir.

      I used cut and paste -- the number one reason programmers make mistakes like that.

      It must be because I was typing a Windows box, it polluted me. ;)

      --

      Do daemons dream of electric sleep()?
    5. Re:toupper() call = moron, MOVE by Anonymous Coward · · Score: 0
      But this code is broken! Get your ABI straight, man! /tlr
      PLA ; pull from stack (if this was a
      subroutine call you get part of the
      return address.
      TAX
      AND #$40
      CMP #$0 ; why? The z-flag is set
      correctly by AND immediate.
      BEQ labelONE
      TXA
      ORA #$20
      PHA ; push to stack.
      RTS ; will break because of broken
      return adress on stack.
      .labelONE:
      TXA
      PHA ; push to stack.
      RTS ; will break because of broken
      return adress on stack.
      do this: (assuming the char is in the accumulator)
      -
      TAX ;2 cycles
      AND #$40 ;2 cycles
      BEQ labelONE ;3 cycles if taken
      (assuming same page)
      2 cycles otherwise
      TXA ;2 cycles
      ORA #$20 ;2 cycles
      RTS ;6 cycles
      .labelONE:
      TXA ;2 cycles
      RTS ;6 cycles
      (an additional 6 cycles for the JSR needed to call this)
    6. Re:toupper() call = moron, MOVE by 42forty-two42 · · Score: 1
      Of course, the CS guy will defend his code by saying it also works on EBCDIC, or any other alphabetic encoding. *sigh*

      Actually... I don't think ISO C guarentees that the letters of the alphabet be contigous. I may not remember correctly though.
    7. Re:toupper() call = moron, MOVE by Anonymous Coward · · Score: 0

      Yeah, and a real compiler will support inline functions (I don't care if inline is ANSI compatible or not, it is too damn useful not to use) and have inline versions of the simple functions like toupper.

      Macros suck because of all the side effects and the fact that they don't end up in the c code symbol table since the preprocessor eliminates the symbol names.

      You want to throw down the idiocy gauntlet on SW vs. HW? How about HW engineers that don't have a clue about data encapsulation or configuration managment. They write code like they prototype a board, with fly wires soldered in everywhere!

  406. A recipe for disaster by twem2 · · Score: 1

    I can't disagree more strongly.
    Higher level languages should be taught first (preferably an OO and a Functional language followed by a logic language to gain an overview of different paradigms)
    Assembly language should be taught in conjunction with a study of hardware and its design.
    There is very little need for assembly level programming with today's optimising compilers, time would be much better spent learning about algorithm design and software engineering.

    Infact, it is much more useful to learn the principles of computer science (ranging from programming and hardware principles to theory) which can then be applied in many different areas than the specifics of a small area which is of little use outside that area.

    I also don't see how assmebly language helps you understand the internals of the processor and the design choices made, assembly language is an abstraction layer.
    Efficiency is also not gained through assembly level programming, but through good software design, engineering and the right algorithms and datastructures.

  407. Actually, you are more right than you know by Raul654 · · Score: 1

    I was very tired when I posted that stuff last night. I *meant* to say NOR, but I said XOR (in 2 different posts, no less)

    --


    To make laws that man cannot, and will not obey, serves to bring all law into contempt.
    --E.C. Stanton
  408. so true... by mmu_man · · Score: 1

    I've been comtemplating engineer students who learnt high level languages and still don't understand how parameters are passed on the stack, or how pointers work. That's so depressing. I begin to think the bottom-up approach is the only valid one.

  409. 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.

  410. Re: Assembly Knowlege and OO by A55M0NKEY · · Score: 1
    Knowlege of asm does not preclude knowlege of OO anymore than knowlege pastry making precludes knowlege of chess.

    Anyway, OO is yesterday's buzzword. There are times when it's the only sane way to go, and others when a different approach would work as well. Probably everyone who understands OO has at one time been somewhat of an OO fanatic. But although it's a useful tool, there is life beyond OO.

    People who don't know assembly often associate it with some kludger that, although they may be expert at obscure details of often obsolete technology, writes unreadable and unstructured code because they somehow can't resist obfusticating things with some special 'secret' non-portable 'performance enhancing' trick. This hypothetical kludger likes to apply their very limited knowlege of assembly to problems it is best left out of in an attempt to impress the younguns whose knowlege may be completely nonexistant.

    This association between kludgy programmers and assembly is 100% BS. If anything, assembly is MUCH LESS forgiving than other languages of programmers with bad habits about structuring code. While most other languages provide things ( like subroutines ) that tend to provide structure in a standard way, the assembly programmer has no compiler to enforce this. The assembly programmer has only their own habits and comments to enforce structure and readability. If you can write good readable assembly, then your skills at structuring code can survive in any environment. If your assembly programs work, then they are structured. If they are not structured, they do not work, or they appear to but have serious bugs.

    For the OO fanatics: OO does not conflict with asm. Remember that OO languages compile to an assembly representation.

    In the same way that an assembly programmer might define subroutine-like goto labels that expect a pointer to some parameters to be passed in a certain standard-throughout-the-program register, one could, ( and compilers do ) define objects in some standard way in assembly.

    Learning assembly teaches you the wisdom and value of all the helpful features that a higher level language provides. To get anything sizeable accomplished in a readable and relatively bug free way in assembly, you end up implementing those high level features yourself by convention.

    Assembly teaches that good coding style does not need to be enforced by the language ( it really can't be ), it comes from within the programmer. The helpful features of high level languages hint at some good ideas though. The enforcing of certain style rules can be a check against typographical errors, but it can not make a bad programmer into a good one.

    Perl also doesn't legislate or enforce things. It gains the power of flexibility, while providing high level features to those who can appreciate and use them. You can write really awful Perl code because of this, but you can also write really beautiful Perl code because of this. It depends on you.

    --

    Eat at Joe's.

  411. Assembly Language is another tool, one of many. by rben · · Score: 1

    Assembly language is one of many tools that programmer can know and use in their craft. Whether you need to know assembly depends primarily on what kind of programming you are doing. It certainly helps if you work on kernal code or device drivers, but isn't likely to give you a huge edge if you work primarily on business applications written in Java.

    Knowing how the computer works at a fundemental level is not nearly as important for a high level application programmer as writing code that can be clearly understood by those who have to maintain it. "Wizard" code can be difficult to understand and nearly impossible to maintain. It's best used where it can do the most good, in low-level and/or high-performance areas.

    Most compilers already turn out far better assembly code than can be written by the average assembly programmer. This is the result of more than thirty years of work on optimization research that has been built into modern compilers.

    If you really want to hit high performance, though, knowing assembly is not enough. You also have to have a detailed understanding of how the target chip works, the sizes of it's L1 and L2 caches, how branch predictors, byte-order, and lots of other details.

    When it comes right down to it. I think that all programmers should have some exposure to assembly, but that an application programmer's educational time is better spent learning how to refactor than how to write clever assembly language. It's kind of painful to say this, since I was weaned on Z80 assembly, but I don't think my knowledge of assembly language helps me greatly when working on my Java application code.

    --

    -All that is gold does not glitter - Tolkien
    www.ra

  412. Great idea by photon317 · · Score: 1

    I learned assembler first myself, although I'm of a somewhat newer generation (27 atm) than older programmers who were forced to. I think it's a big help for the same reasons stated, and I've noticed too that the best programmers I know are people who, like myself, know assembler. Of course you need other things too :), but it's a good start.

    You can even take this a step further and say that before one learns assembler, one should learn basic electronics, both analog and digital. You don't need to go so far as designing microprocessors - but at least far enough to build little logic and timer circuits from standard TTL and CMOS ICs, perhaps advancing from that towards building circuits around a PIC microprocessor and writing asm code for the PIC to control little hardware devices.

    Then do x86 assembler, preferably without a real OS in the way (e.g. MASM/TASM under plain old DOS without using MSDOS interrupt functions, or even BIOS ones if you can help it), then graduate to using assembler and C both seperately and linked together under a protected-mode OS where one must use system calls (ala Linux like the book), and then move on to regular C/C++ coding without doing anything in asm unless neccesary for speed (which is very rare), and THEN, PERHAPS, if the situation warrants, or other things (available contracts, stupid corporate policies, etc) require, you could learn ugly languages like Java and code in them.

    --
    11*43+456^2
  413. Object oriented assembly by hayriye · · Score: 1
    eax.mov 00h;
    1. Re:Object oriented assembly by bmac · · Score: 1

      Thanks, that really made me lol. There is nothing like a good laugh.

      Peace & Blessings,
      bmac

  414. Teach Compilers by Evl · · Score: 1

    Taking a course on compilers is probably the best way to improve your programming skills. You will learn exactly how your high level instructions map into assembly. Especially if you cover optimizations, you'll get a much better idea of how to write efficient code. Secondly, a course in modern chip design can be very useful so you know about how caches, branches, etc will effect your code.

  415. Another great book on ASM by curtisk · · Score: 1

    Is Jeff Duntemann's Assembly Language Step by Step, I have the original edition from 92' and it appears there's been a revised edition that covers some Linux. Whats nice is that he has always taken the approach that it is your first language to learn, and he does a great job of laying it all out in very layman type terms. I still have that book and it will be one that I always keep around.

    --

    Sehr geehrter Toilettenbenutzer!

  416. Knuth by Anonymous Coward · · Score: 1, Interesting

    Knuth has been teaching CS using ASM for a *Long* time.

    *shrug*

  417. Assembly first would be wrong by slaad · · Score: 1

    A lot of people have enough trouble figuring out C/C++ when they start programming. Starting out teaching assembly would turn a lot of potential computer scientists away in frustration before they ever get a chance to get a feel for what they would really be doing (which would likely be using a higher level language, and not assembly). The computer science program I am going through right now includes an assembly language class and a more advanced class that follows up and teaches more about the basic machine architecture. Based on the reaction of my classmates, the majority of them would have probbaly switched degrees if they had started with assembly.

    --


    ~Warning!~ The above is encrypted using rot676!
    1. Re:Assembly first would be wrong by Anonymous Coward · · Score: 0

      Poppycock. Assembly is much simpler than C or C++. I can code in x86 and 68k assembler and still cannot fathom Pascal.

  418. The lost art of Assembly Language by Pedrito · · Score: 1

    When I was still in school (seems like a million years ago, but it was only about 15 years ago), we only had one assembly language class. That and the two intro courses are the only ones I didn't go to (did the homework, went for the the midterms and finals, got As).

    I don't think one semester is really enough assembly language, though. I think people should really have to understnad both assembly language and compiler design, though. I think it's important to understand both, though. As a programmer of a higher level language, you then have a fairly good concept of what's happening to the code you write.

    And while I think that's still important now, I don't think it always will be important. In fact, I think over the years, its importants has diminished significantly and will continue to do so.

    As an example, when machines were much slower and optimizations far more important, I remember jumping through a lot of hoops to optimize my code so that it would compile more efficiently, or embedding assembly routines for speed. I haven't had to hand code assembly since the mid-90s, though. So it seems to me it's far less important these days simply because machines are so much faster.

  419. learn to program using perl by Anonymous Coward · · Score: 0

    and start learning math from calculus. this is why cs students are past ignorant.

  420. They do. by lburdet · · Score: 1

    Just depends on where you go: el-collegio around the corner for a quick "Computer Degree" coding Java, or a university degree.

    i sure as hell know *WE* had to code fs#@%* ASM

  421. importance of machine architecture is overrated by Anonymous Coward · · Score: 0

    The sound of this message makes me guess that johnnyb considers himself being one of those wizzards ;-)

    My approach would be -- exactly the opposite -- to teach lisp wich, is as independend of the underlying architecture as a language can be.

    As machines are getting faster and faster efficiency by investment of hardware knowledge is getting more dispensable for most of us.

    An example that illustrates the overestimation of hardware knowledge very well: When Sun presented its servlet concept, webapps started to be excitingly fast, even though java is considered a 'slow' language. Why was that? Not because they thougt about register optimisation, but because they abandoned the traditional one-request-relates-to-one-process concept (an CGI does it); in other words this improvement was born out of pure software architecture considerations.

    I think its quite good for a programmer to know some assembler (maybe java byte code?) but teaching beginners this ugly i386 assembler would be an exaggeration.

    Titus v.d. Malsburg

  422. Assembly IS taught in Computer Science programs by Anonymous Coward · · Score: 0

    I got my BS in CS at a state university and part of the program included assembly language and computer architecture. I would imagine that any accredited CS program would cover assembly language and computer architecture. It won't necessarily be x86, but the vital concepts will be there.

  423. Assembly Language == Prime Cause by tilleyrw · · Score: 0

    The first, and so far only, assembly language I have learned was for Motorola 6502 chip which powered the Apple ][+. It is a very compact language and very suitable for programming. Armed with the reference for interfacing with the GUI toolkit (and believe me, the gui toolkit was very basic on the Apple ][+), a skilled bit-munger was capable of rather complex achivements.

    I cast my vote in that Assembly Language, for any CPU, is more crucial to gaining an understanding of computers in general that a college degree showing you learned C++.

    As an idea of when this was, when I went to college the language of choice was Modula-2. Make of that what you will.

    --
    This post encoded with ROT26. If you can read it, you've violated the DMCA. Handcuffs please, sergeant.
  424. Real Men by Anonymous Coward · · Score: 0

    As the old saying goes, "Real Men program right down to the bare metal."

  425. Taking One by Malvegil · · Score: 1

    I'm currently taking a class for my Computer Science degree that is required. It's a course that includes learning the MIPS assembly language. The course includes basic system design and processor design. I'm enjoying the class and wish that they would offer more assembly classes. This one could be a prerequisite to one with the x86 architecture or others.

  426. Hah by pommiekiwifruit · · Score: 1
    On the processor I have onscreen in another window it is C style, dest instr src. For example:

    r1 += r2

    r3 = [bp+3]

    It may not be as traditional as other assemblers but it is straightforward to pickup.

  427. Well by Tonik,+the · · Score: 1

    Most of us here are acquainted with the Jargon File, I suppose.

  428. Assembly language is misunderstood by Junks+Jerzey · · Score: 1

    There is always something to be said for understanding the native language of a CPU. How can there not be? You can put it down all you want, but someone has to write the code generator for each processor. There's also much benefit from writing domain specific languages. Contrary to popular opinion, writing a compiler is fairly straightforward undergraduate project. Anyone who thinks otherwise should be ashamed to be in computer science.

    But let me rewind a little.

    The entire point of language design, compilers, and so on, is to make programming cleaner and more reliable. Assembly language is not an ultimate goal. Neither is C++. Learning PowerPC or x86 assembly language does a good job of explaining how those architectures work, which is not necessarily a good blueprint for the future (in the case of the x86, doubly so). This is much of the reason assembly language for popular desktop processors has fallen by the wayside. x86 assembly language is more of a mid-level language, with the processor using a huge register file behind your back and reorganzing instructions on the fly. You don't have the ultimate control, which used to be one of the primary reasons assembly language was interesting. Now you have a patched-up and ugly architecture with implementations that have been tweaked and twaddled into performing well for certain types of well-behaved applications. You can break things fairly easily on the P4, such as by putting code and data in the same 1K block, or by performing simple return stack manipulations that cause the branch predictor to fall down hard. It's all very dated and byzantine and ugly.

    A better method is to design an architecture for more specific needs, one that isn't trying to be the giant 1970s C machine. Keep it clean. Keep it specific. Keep is reasonably small. This makes assembly language meaningful again, and worth knowing. For example, Ericsson prototyped a processor for their functional, concurrent language, Erlang (which is used to run many of their telephone exchanges). At 20MHz it was outrunning their damn-fast interpreted implementation on a 500MHz UltraSparc--by a factor of 30. This is where the future is. Figure out what you want to do. Once you've implemented it in software, iterated it a bunch, and nailed it completely, put it in hardware. And then there's much to be had in knowing how things work all the way down to the metal. But for modern desktop processors, no, there isn't much point. It's all too soft and vague and complex and meaningless.

  429. Dest <- Src by pommiekiwifruit · · Score: 1
    The x86 and 6502 and Z80 all use the same system used in BASIC, Pascal, Fortran, Algol, C, C++, Java.

    I.e. Destination = Src

    It's the 68000 and ARM that got it wrong by doing things the COBOL way (MOVE src TO dest). Pah. And they got the high bytes in the wrong locations goddamnit, so that a value is different depending on its type (and multi-unit arithmatic is less sensible).

  430. Argument Summary by theghost · · Score: 1

    sydb: I am a pedantic twit.

    Paolomania: I am a bigger and more pedantic twit.

    sydb: I am the biggest, most pedantic twit that ever was and ever shall be. Do not meddle in the affairs of big pedantic twits, for they are subtle and quick to anger.

    theghost: ;)

    --
    The only thing necessary for the triumph of evil is that good men do nothing.
    1. Re:Argument Summary by sydb · · Score: 1

      Thanks for your support!

      Note that you missed the word "big" in the sequence "big", "bigger", "biggest".

      --
      Yours Sincerely, Michael.
    2. Re:Argument Summary by feronti · · Score: 1

      It's unnecessary. Bigger is a simple comparative. Since a baseline was set with sydb, big or not, it would be fairly meaningless for Paolomania to call himself "a big pedantic twit," as there would be no way to reference the baseline, unless sydb then said "I am a bigger pedantic twit," which would leave us with either Paolomania as the biggest pedantic twit (undesirable in the context of giving support to sydb) or require Paolomania to reply along the lines of "I am an even bigger pedantic twit than you!" which unnecessarily and redundantly extends the witticism in question. Such an extension would increase the time between set up and punchline, and as a result. the joke would be far less amusing. Ergo, the joke was far better executed with brevity.

      Unlike this post, which is thoroughly unamusing long or short.

  431. disclaimer by Sean+Clifford · · Score: 1
    There is no way to determine that you are the author of this book by the submission you made. By not explicity saying that *you are the author*, you deceive by omission. That's why people who have an affiliation with a topic under discussion explictly say so - e.g. "Disclaimer: I work for..." or "Disclaimer: I wrote this book..."

    Anyway, at best you demonstrated poor judgement. At worst, it was a deliberate deception. I don't know you, so I don't really have an opinion.

    Now, regarding teaching assembly language programming:

    I don't know what planet everyone else studied on, but my Computer Science curriculum (I studied computer science for a while after earning a B.A. in Philosophy) required assembly language programming. Our software emulated the Z81 and ran on NeXT workstations. The introductory programming course was in Ada - which is a underrated language (switched to Java later). C was also required (and fun).

    1. Re:disclaimer by johnnyb · · Score: 1

      The one I went to required assembly language programming, too, but it was an add-on for juniors and seniors. I think assembly language should be the beginning, not the end of learning computer programming.

      Having said that - assembly languages _is_ disappearing from many schools altogether. Also, those who don't go to college (at least for programming) generally don't know it, either.

  432. 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

  433. Actually, it's a great idea (Re:This is a BAD idea by SalesEngineer · · Score: 1

    As a former college lab instructor, I have a lot of experience with CompSci students that don't understand how a computer works. Some assembly language would have helped, but it's not the only solution.

    I used to teach a lab at Clemson University for Computer & Electrical Engineering students (ECE371). Students built a piece of hardware for the ISA bus, then wrote software to control the hardware ... in other words, build a peripheral and write a driver. The lab used a combination of C & assembly code.

    Assembly Language was a pre-requisite for the ECE students, but CompSci students could take it without the pre-requisites. In general, I had to spend more time explaining basic concepts like input & output to the CompSci students than the ECE students.

    Most of these students had no exposure to assembly language of any form (RISC or CISC). The inner workings of the processor were described in general terms, but they had no practical knowledge.

    The industry trend in firmware development is away from assembly, moving to something like C that is abstracted from the platform. This is good because it requires more 'general' programming knowledge, but it can backfire if the C programmer a company tries to convert to a firmware/embedded developer doesn't understand how the computer works ... then you end up with bad code (too big, too slow, large memory footprint, etc.).

    The point of learning assembly isn't to know assembly ... it's to understand the computer at it's lowest and most fundamental layer. If you don't think it makes a difference, go check out the educational background of the average Indian programmer.

  434. object oriented by Anonymous Coward · · Score: 0

    this is completely appalling! object oriented programming doesn't care about the machine it runs on, only a functionally (including object based as most people attempt to create object oriented programs) cares about the way a computer thinks. we need to break this habit, and it starts with those who start learning programming.

    1. Re:object oriented by GorillaTest · · Score: 1

      Bullshit. If you don't understand the runtime architecture you are using (not likely if you haven't thought about things from a machine language level) you can't code effectively. Just look at boxing in C#.

  435. Moo by Chacham · · Score: 1

    Assembly Language Step by Step is an excellent source for beginners who want to understand the concepts of Assembly.

  436. Other books already do this... by Mixel · · Score: 1

    Knuth's "Art of Computer Programming" uses a fictional assembly language written especially for the book!

  437. Anyone review this book? by g0bshiTe · · Score: 0

    Has any of the /.ers read this book? I would like to find out how those who have read it would rate it,as far as depth and subject matter.


    I am very interested in learning ASM, but I need a good reference. I know some ASM via HLA, but I want to take it further. Any books that /.ers could recommend would be apreciated.


    "Oh no theres another bug."
    "Shut up! We'll tell them it's a new feature."

    --
    I am Bennett Haselton! I am Bennett Haselton!
  438. AMEN! Finally! by The+Spoonman · · Score: 1

    Now, if only we could get these paper mills to stop teaching the answers to certification tests and start teaching how everything works we might have some IT people out there who are capable of doing a job.

    I've known too many people who come up with the oddest shit because they just don't understand AT A DEEP LEVEL how a computer works. They're users who got a slightly deeper understanding, but that's it. When I went to get my degree. You learned how the computer worked by starting with resistors and capacitors before moving on to digital circuits and eventually processors. It was only after you understood how a processor worked that you learned assembly programming, and only after you learned assembly did you learn higher-level languages.

    What an ideal world IT would be if there were more people who knew what they're doing....Sigh, a dream never realized, I suppose...

    --
    Which is more painful? Going to work or gouging your eye out with a spoon? Find out!
    http://www.workorspoon.com
  439. Assembly in curriculum by Anonymous Coward · · Score: 0

    I studied Computer Science at the University of Michigan and recently graduated. My curriculum there was overstressed with the hardware level. In some ways it was very valuable to understand the underpinnings of hardware and be able to translate that into valuable knowledge for programming well in a high level language. However I felt my education was spread too thin. My goal was to come out of college as a software engineer. I feel utterly lacking because I believe too much emphasis was put into the hardware side. I encourage anyone who is going into a Computer Science program at a University to closely examine the curriculum and see how well it weighs with their goals for after college. College is expensive! Don't pay for something that doesn't give you what you need.

  440. data structures in assembly? by gugux · · Score: 1

    Gaining a good understanding of the internals of the computer may not be the most useful thing for a new computer scientist. Teaching data structures and algorithms (sorting, binary trees etc) in assembly would be impossible. Assembly would still be useful perhaps but would not always make a computer scientist better. There's so many things like databases and AI where the conventional perhaps introductory material would be more suitable. For myself however I have to say that I would be interested into gaining a deeper understanding of the actual machine throguh assembly.

    1. Re:data structures in assembly? by Anonymous Coward · · Score: 0

      "Gaining a good understanding of the internals of the computer may not be the most useful thing for a new computer scientist. Teaching data structures and algorithms (sorting, binary trees etc) in assembly would be impossible"

      Check out Knuths "The art of computer programming" (1..3).

  441. Back when I was a boy... by ExRex · · Score: 1

    We learned to program in Hex on punch-paper tape. Only after we knew what we were doing could we move on to Fortran on punchcards.

    And yes, we also had to walk 12 miles through the snow to school. Uphill. Both ways.

    --
    The closer you are to the code, the happier you are. - Ancient Geek Proverb
  442. laughable disclaimer by Stone316 · · Score: 1
    You can't be serious? What bugs me these days is that anyone thinks they can program or be a DBA after picking up a teach yourself in 24 hours book or doing some coding in their spare time. For that matter, the people that take 10 week/6 month programming boot camps are in the same league if you ask me.

    Its why IT is in such sad shape today.. The people who were really interested in computers/tech took engineer or CS in university... The other group, who are just here for a job, did history or religion in University, realized they have no marketable skills and went to some overpriced IT-farm. They have no real interest other than getting a cheque every two weeks. They don't really understand or care about what they are doing.

    Yes, i'm making a rather blanket statement but i'm getting stick of having to put up with this crap. But from what I have seen, these IT-mill people are good for very junior positions. And yes, there are some exceptions to this, but these people are genuinely smart and could pick up anything they wanted. There aren't too many of these people around tho.

    Sorry, but I have had to clean up other's messes too many times. I'm sure most other _real_ IT people would agree with me.

    --
    "Thanks to the remote control I have the attention span of a gerbil."
    1. Re:laughable disclaimer by Endive4Ever · · Score: 1

      From my point of view, the problem is inherent in your smudging together of 'IT' and 'Computer Science.'

      IT is Information Technology, and there are many types of technology that can and are used to house and organize information. IBM used to do it with decks of punched cards, long before the Computer became a necessity to actually process said cards (they sorted card decks with jumper-wire panels set to sort on fields). 'IT' is just an electronic form of a filing system. 'IT Professionals' are somewhat-brighter peers of the people who work in factories making filing cabinets.

      Computer Science is something else. And yes, the blurring of the distinction is deplorable. Don't contribute to it.

      --
      ---
  443. Software Engineering by Watcher · · Score: 1

    I think we're muddling a few issues here, thanks to the lack of distinction in much of academia between computer science and software engineering. Just as I would not reasonably expect a Physicist to be a bridge designer (Mechanical/Civil Engineering), or circuit designer (Electrical Engineering), I would not expect a Computer Scientist to write software. A Computer Scientist is concerned with the theory and science of computation-algorithms, data structures, number theory, language research, and the like. They're the folks who are working out the theory on how something we may not see implemented in 30 years functions.

    Really, we need to understand that there is software engineering (the folks who *design*, develop, and maintain software) and software science (what we call Computer Science). For software engineering, I believe it is fundamentally important to understand languages at as low a level as assembly, and as high a level as Prolog and the like. I have seen many poor design and implementation decisions made in professional code that would not have been made if the developer understood what was happening under the hood-or if they were aware of a higher level tool that would cut their development time dramatically and simplify their codebase. To be a good software engineer, you have to understand these things, and be able to judge the time to use a given tool. If you don't, you're doing a disservice to yourself, your employer, and your profession.

    Now, I know there has long been an issue that (at least in the US, I don't know about other countries) there is no legal definition of what a software engineer does, or what qualifies a person to hold such a title. That's something we will need to change and address in this profession. The reality, though, is if you design and write software for a living, you really aren't a computer scientist-you're a software engineer.

  444. Top down please by Aidtopia · · Score: 1

    Having read code from many other programmers and having interviewed scores more, I've found that the best programmers are those who learned simpler, higher-level languages before others.

    If Jessica learned Pascal, then C, then assembly, I'd bet she's pretty good at all three. If Samantha learned the same languages in the opposite order, chances are she's not as good at any of them.

    You may disagree, but it has certainly proven true in my experience. My impression is that the folks who learn low-level first get bogged down in the details and have a harder time finding the elegant (read "simple") solutions. Once the problem is decomposed, experience with lower level languages translates into tools for building a clean implementation of the solution.

  445. and electronics too by Anonymous Coward · · Score: 0

    A background in electronics is also very beneficial, these people tend to have a better grasp of timing issues, synchronization, and "getting it right" verses "it works, good enough".

    All the best designers and developers I have met have had a background in assembly language and most have had at least a hobbiest interest in electronics too.

    And then of course there's the whole discussion of how people with a creative bent -- especially in music -- make for the best developers.

    In a previous life, if we had a choice between two equally strong candidates we would always hire the one with a musical interest.

    AJ

  446. Don't confuse cause and effect by Dr.+Smooth · · Score: 1

    I don't think that teaching students assembly makes them programming aces. I think that programming aces embrace difficult techniques like assembly.

    If you try to jam assembly down the throats of a wider audience, you'll just have _more_ students bailing from computer-related fields.

    You'll probably get the same number of programming gurus out the other end as you would have without broadening the exposure to assembly programming.

    --

    ...if you ask no questions, beware of lies...

  447. Rubbish! by a1englishman · · Score: 1
    I've found that the key difference between mediocre and excellent programmers is whether or not they know assembly language.
    This is total claptrap. There is more to computer science than knowing how to twiddle bits with assembly. While I think it's important to know the fundamentals of computer architecture, there are many important things a good developer should know. Having a clear understanding of abstraction is vital. I've seen so many junior developers who cannot solve a problem because they cannot abstract it. They cannot find the generic case -- can't see the forrest for the trees.

    A developer must be able to utilize all the tools available to him or her. That means leveraging high level languages, applying libraries, and utilizing design tools like Rational.

    Likening good developers to the level of assembly they know is just pure elitism.

    1. Re:Rubbish! by gugux · · Score: 1

      I agree with you. Apart from writing efficient code, one has to also consider how the code will be maintained. Abstractions, code-reuse and patterns are the things that programmer's absolutely need to be equipped with.

  448. Yes, THAT dgc by rs79 · · Score: 1

    Yup, that's Dave. After Teklogix he went to work for DEC and worked on DEC-TALK and then the Alpha.

    Dave is the ultimate uber-hacker and I never met anybody like him. He could talk more quickly than a country auctioneer and code even more quickly and was never wrong, ever. He works for MS now in the machine architecture group last time I talked to him about a year ago.

    --
    Need Mercedes parts ?
    1. Re:Yes, THAT dgc by Ungrounded+Lightning · · Score: 1

      Yup, that's Dave. After Teklogix he went to work for DEC and worked on DEC-TALK and then the Alpha. ... He works for MS now

      I heard that Gordon Bell also went to MS. (To the group that deals with CPU scheduling, according to the rumor.)

      --
      Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  449. Why don't they teach me that ? by ladadadada · · Score: 1

    This disturbs me. I have completed two years of a Comp Sci degree and I have been taught Java and a little html. I hear that a new teacher has taken over that subject and the now learn css as well.

    Whoopee.

    We were taught jsp, and given the option to do our major assignment in php instead if we liked. They didn't teach us any php, nor supply a computer to host it on, but after some research on the market share that php had and the way it was growing, I decided to take the road less travelled.
    I was the only one.
    I taught myself php and figured out installing it, creating a dynamic dns so I could host it on my dialup account, installing mysql and getting the whole lot to work together.
    It may not sound like much, (it doesn't to me now) but I had no help, and this was a group assignment I was doing on my own.
    Now I'm employed as a web devloper creating web-based systems using php and mysql.

    We have not been taught C or C++, no assembly, no php, no xhtml, no css, no bash. Yes, the taught us enough of how to manage our files (cd, ls, rm, and a supplied script for mounting floppies), but nothing serious like scripting or evening piping one command to another.
    I have very little idea about memory management, and yet the university claims that they are teaching me "programming concepts" that will enable me to learn another language very quickly. I should be able to just pick up C and start.
    I was stuck with my first C++ program for days before someone told me that I should be using g++ to compile it instead of gcc.

    All this makes me wonder. What have I learned at Uni ? What jobs can I apply for NOW ? I can apply for a job programming in C++, but who would hire me if I told them I had a degree in Comp Sci and I'd never used C or C++ ? Sure, I can probably learn it quickly given a decent programming guide and a reference guide but it makes me ask again... why did I go to Uni ?
    I taught myself Apple Basic at the age of eight by looking at the code of the games that came with our Apple ][e. OK, I had some help from a couple of books from the library that had some simple 50 line games listed in them but the point is that I learned it with no help other than that. If a University has charged me $600 per semester per subject to teach me one language and the ability to learn more, and I already had that... I wonder what point there is.

    Up until now, I thought this is what Uni Comp Sci was all about. This is what they teach everywhere. How wrong was I ?

    The three most useful subjects I did were Theory of Computation, Algorithmics and Advanced Algorithmics. No programming was taught, when you were expected to write code it could be in C, C++ or Java but nearly everyone chose Java because that's all they knew.
    What we learned was that the difference between N^2 and N(Log(N)) was far more important that any optimisations you could tweak in assembly language.

    So, the final question remains; am I better off with a degree in Comp Sci and only one language under my belt (I don't count Apple Basic anymore) or am I better off teaching myself C and trying to get a job and some experience.

    I suppose there should be a third option there: should I simply find myself a better University that actually has a serious Comp Sci course ?

    --
    Sig matters not. Judge me by my sig, do you?
  450. l's and 0's by Anonymous Coward · · Score: 0

    From an old Dilbert:
    Engineer #1: Back in the day we programmed everything in assembler.
    Engineer #2: We programmed with ones and zeroes.
    Wally: I programmed with ones only.
    Dilbert: I had to use "els".

  451. Yes, Linux x86 assembly is different. by Rhodnius · · Score: 1

    First, let's define "assembly language programming" as "accomplishing something using assembly language".

    There are (at least) two components to doing that. First is knowing and using assembly language itself. This is knowing what the machine registers are (AX, DX, SI, DS, etc) and how to manipulate them using assembly instructions (MOV, JMP, etc.) This part is the same for all uses on an x86 platform - Linux or DOS or Windows or your own operating system.

    The second part of assembly programming is interfacing with other software routines to do something useful or fun. Unless you're writing your own OS from scratch, this is necessary. Suppose you want to load a file from disk into memory space so you can do something with it. You'll want to interface with existing OS file operations; you don't want to write code to navigate the OS file structure and read from the disk byte-by-byte.

    Under DOS, you do this by loading data into certain registers to indicate parameters (references of a filename and of a memory space to load the data into) and executing the assembly instruction INT 21h. DOS code then finds the file on disk, goes through file-locking routines as necessary, and copies its data into the memory space you specified.

    Under Windows, this is completely different. You push parameters onto the stack to simulate a C stack calling frame, and then you transfer control with a CALL instruction to a Windows API function in a DLL somewhere. Then the Windows code finds the file and loads it into your memory space. That can involve very complicated things like connect to another machine over a network and pop up a box to the user for a password - you definitely did NOT want to reinvent all that in assembly yourself.

    Under Linux, there's yet another convention to accomplish something like that (I'm ashamed to confess that I really don't know how it's done in Linux.)

    But that's how "x86 assembler" is the same yet differs drastically on different platforms.

  452. Another old timer :) by System_390 · · Score: 1

    Hi, I'm new here. This thread was posted on the Win32Asm forum, where I spend a little time. http://board.win32asmcommunity.net/index.php I've been a professional programmer for about 35 years. I "worked" on the IBM 1130 "mini" at my high school, in my senior year, 1968-1969. I already knew Fortran, having taken an "adult school" class the previous year. I also had a second shift job after school, as an IBM System/360 operator. When I graduated, the company hired me as a junior programmer, and I started using Cobol. Cobol at the time didn't have much built-in error processing. Things like alpha data in a numeric field often resulted in a "core dump", a printed listing, showing the machine language and data in memory at the time. In order to debug the problem, you needed to know at least some machine language. Everyone had a "green card" that listed the instruction opcodes, formats, etc. When I did discover assembly language, around 1970, I already knew what was going on, from looking at Cobol dumps. Assembly was way cool. I could do what I wanted directly, without having to deal with all the overhead generated by Cobol. Even the "optimizing" Cobol compiler that came out a few years later still generated a ton of overhead, simply because it's such a generalized language. I instantly fell in love with assembly language, and it's still my favorite language by far, no matter if it's on the current IBM System/390 mainframe, the x86, or the 6502. It just seems like the "natural" way to program, a least for me. I tend to agree with a previous poster, people that put down assembly language really don't have much real world experience with it. I don't think they know much about things like Macros. I'm not talking about simple "text replacement" facilities, like in MASM, but a true front end pre-processor, like on the System/360/370/390. Things like Global Variable Symbols are very powerful. I've developed a couple of Macro assembly based "languages" over the years. They had the usual verbs, like ADD, IF, MOVE and so on. They also had application specific verbs, like INPUT and OUTPUT, for the 3270 terminal system that I worte. An entire source program was 100% macros, without a "native" line of assembly code in sight. Sure, it took quite a while to write all those macros. But once they were done, an "end user" program could be written very quickly. As the macro code matured, new programs were virtually bug free. Sure, it takes a while to write assembly code, and it takes even longer to write good, optimized code. But those of us that have been doing it for a while don't start from scratch every time. We've got a "library" of "reusable" code, that's been beaten up and fine tuned over the years. I get a kick out of comments like "you can't write a big application in assembly language". The IBM mainframe MVS operating system was once described as the most complex software project ever designed. Guess what it's written in. 100% Assembly Language. :)

    1. Re:Another old timer :) by System_390 · · Score: 1

      Sorry that the above came out as 1 giant paragraph. Like I said, I'm new here... ... ...

  453. Anecdotal? by gillbates · · Score: 1

    What part was anecdotal?

    And how am I being high-and-mighty if I point out the obvious? (or what should be obvious to anyone who has used assembly for a while).

    Or better, what part of:

    traverse: cmp esi,0
    je endpoint
    mov eax,[esi]
    call ebx
    mov esi,[esi + 4]
    jmp traverse
    endpoint: ret

    don't you understand? This is a standard linked list traversal in assembly: it takes a pointer to a function as an argument in ebx, the head node of the list in esi, and it will traverse the entire list, calling the function in ebx for every node in the list. It's seven instructions, and it will work for any datatype.

    In C++, the above would probably be written as:

    template <class T>
    class Node{
    T data;
    class Node * next;
    };

    template <class T>
    void traverse (void (*func)(T),Node * list){
    T tmp;
    while (list){
    tmp = list->data;
    func(tmp);
    list = list->next;
    }
    }

    So, in C++, I've got to write 14 lines, where in assembly I have to write 7.

    How is that harder?

    How is this cliche? I can demonstrate with examples. I'm not repeating some tired old mantra - I've spent a considerable amount of thought on this. At one point in my career, I couldn't use anything but assembly; the experience taught me that assembly is a very versatile language, provided one follows some very basic coding standards (register usage, calling conventions, etc...)

    It never ceases to amaze me the number of programmers who can't or won't write in assembly, almost to the point where it's a superstition. Perhaps they had a bad experience, so they've written it off. Perhaps they learned computer programming rather than computer science.

    I understand assembly can present some difficulties. There are definitely some situations in which the project requirements would exclude its use - and this can be said for any language - but to say that data structures are more difficult to implement in assembly is more an indication of ignorance than enlightenment. Any data structure with a heavy dependence upon pointers is almost always easier to implement in assembly.

    I'll leave you with this, though:

    traverse:cmp esi,0
    je breturn
    push esi
    mov esi,[esi + 4]
    call traverse
    pop esi
    mov eax,[esi]
    call ebx
    push esi
    mov esi,[esi + 8]
    call traverse
    pop esi
    breturn: ret

    What this does is left as an exercise for the reader, but its very close to what you mentioned in the original post...

    --
    The society for a thought-free internet welcomes you.
    1. Re:Anecdotal? by Sebastopol · · Score: 1

      First, thanks for posting examples.

      Second, add stack frame setup to your ASM, and subtract the typedef from the C++ (unnecessary for your example) and they are the same size, and the C++ is far easier to read.

      The point is I said ASM is pain in the ASS compared to C++. C++ is far more illustrative of what is happening than the ASM. And that was my point.

      But you decided to call me an idiot and naive, when I'm not the one bragging about my knowledge on geek newsgroup. Obviously we can't prove who has the bigger dick, er, is the more experienced programmer, but anyone who claims a low-level language is easier to code in than a high-level language should just go back to plugging in wires and making punch-cards, because you missed the point of a HLL. It's a ridiculous position to argue.

      --
      https://www.accountkiller.com/removal-requested
    2. Re:Anecdotal? by Sebastopol · · Score: 1

      ...also, your last example drives home my point. it would take a noob a day to figure it out in ASM, or a few minutes in C++. duh. thanks for making my point.

      btw, your last example never reaches line 6. at least post code that works when trying to make your point next time. you also did't dereference ESI correctly for an indirect address, but now i'm just being mean, and you'll get there with experience.

      --
      https://www.accountkiller.com/removal-requested
    3. Re:Anecdotal? by gillbates · · Score: 1

      Well, I'll give you that one. I think I overreacted a little. HLL's do have a place - in fact, I'm using them right now.

      What disturbs me is that I mistook you for the "assembly sucks" troll. I guess I got trolled.... but I do hate to hear programmers knock assembly simply because of some preconceived notions.

      And assembly has come a long way since its inception. The macro processing facilities make it look more and more like a HLL every day.

      Granted, it's not portable. Poorly written code can be a real pain to debug and maintain. But then, a well-coded piece of assembly is a thing of beauty. I've seen insertion sorts coded in 12 instructions. And the examples above - list traversal in 7, and binary tree traversal in 13 instructions, only bring home my point. No instruction is wasted, there's no overhead at all....

      What it really comes down to is being open minded and picking the right tool for the job. Often times, the best language for the job is not necessarily the one you like best. The fundamental problem I often run into with HLL's is that the lack of language features makes implementing a particular algorithm very difficult, or in some cases, impossible (try building a linked list in VB?!). Even worse are the languages for which the algorithm can be implemented, but only by using a number of arcane language features and confusing constructs.

      The timeless components of computer science are the algorithms, not the languages. There isn't a an algorithm which can't be implemented in assembly, but there are many which can't be implemented in HLL's. There is a certain mental appeal to working with a language in which the only restrictions are the physical limits of the machine.

      With assembly, I trade portability and increased development time for the assurance that I can implement any algorithm necessary. With HLL's, I trade some fundamental algorithms for the ability to write portable code, and get it done on time.

      Yeah, it's a trade off. But I think I've learned to refrain from the One True Way(tm). When you have a choice of languages, its important to recognize the relative strengths and weaknesses. When you don't have a choice, at least you are in a better position if you understand the underlying algorithms.

      As an aside, I've had to write applications in assembly language. At first, I thought it was going to be a nightmare. After a while, though, I learned that it was much easier if I obeyed a few simple rules:

      1. Pass arguments in registers; if you run out of registers, refactor your code.
      2. A function must preserve every register not used to pass a parameter.
      3. Always return a value in eax, a pointer in ebx.
      4. A linear list is an area of memory whose first word contains the count of the items in the list.
      5. A linked list node is 2 or 3 words and the first word always points to the data. The second node points forward (for single link), and the third node backward. This allows a doubly-linked list to use the same forward traversal function that a singly-linked list uses.
      6. Use the first word of a buffer to store the size of the buffer. This allows you to safely write routines using the movsb and stosb instructions rather than coding a loop. Since these objects determine their size at runtime, they reduce the potential for array out of bounds errors.
      7. Write a reusable memory allocator.
      8. Write a reusable string library.
      9. Write macros for system calls. That way when you change OS'es, you can simply use a different set of macros.
      Following these rules, I've got just about the same functionality of an HLL without the overhead.
      --
      The society for a thought-free internet welcomes you.
  454. Re:Linux x86 assembly? Bicycle computer info by Endive4Ever · · Score: 1

    Use PIC embedded controllers, as made by Microchip. There are PIC controllers that have absolutely TINY hardware footprints. They make single-chip processors in as small as an 8-pin package, both through-hole and surface mount. For the kind of design you're talking about, you'd use an external LCD controller, probably one talked to over a two wire serial interface. If you start delving into the huge mass of PIC enthusiast's websites, you'll probably find your display technology without difficulty.

    --
    ---
  455. 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.

    1. Re:assembly by johnnyb · · Score: 1

      For teaching, I've always thought of having a class emulate the processor. Have some shoeboxes for memory, and each memory location has a number, which is the instruction. a person brings the instruction to the instruction decoder person, who looks up how to process that number. Then, if the instruction includes any memory locations, you have people who are the data bus running to get memory chunks.

    2. Re:assembly by Sean+Clifford · · Score: 1

      You should do that; it's a really good idea. Sort of like the market in SnowCrash - books coming and going and horses with books coming and going.

  456. 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."

    1. Re:Not a new idea by GorillaTest · · Score: 1

      Here! Here! A person after my own heart.

  457. Learn HTML while you're at it by Anonymous Coward · · Score: 0

    instead of just slamming out pages with Dreamweaver or similar. Same concept, actually understanding what's going on beneath the covers.

  458. YALE PATT ALREADY DID THIS by Prof.+Pi · · Score: 1

    One of the leaders in computer architecture, Yale Patt, has already written a book based on this concept. He gives enough of an overview of logic design to understand things at an RTL (register) level, and distills CPU design to its essentials. He doesn't get to C until half way through the book.

    His observation is that CS students have a MUCH easier time comprehending things like recursion when they understand what's really going on inside.

    (My efforts to get this book introduced at my old university were unsuccessful, as the department chairman was afraid that teaching assembly language would drive students away. He wanted to teach them Java instead.)

  459. CMOS!? by autopr0n · · Score: 1

    When I was a kid, we didn't have fancy CMOS gates, we had to pick NMOS or PMOS and go from there!

    --
    autopr0n is like, down and stuff.
  460. Assembly Language Step-by-Step by ninejaguar · · Score: 1
    Here's another book on the same topic. However, at least this one has an ISBN number:

    Assembly Language Step-by-step: Programming with DOS and Linux
    by Jeff Duntemann
    ISBN: 0471375233

    = 9J =

  461. Re: Of course, real programmers.... by nineoneone · · Score: 1

    write microcode.

    --
    sig under development
  462. silver jubilee by zihamesh · · Score: 1

    25 years ago I started programing in CESIL (Computer Education in Schools Instructional Language), it made the assemblers of the day look feature rich (sic).

  463. is this type of advertising OK on /. by Anonymous Coward · · Score: 0

    jonnyb decided to enlighten us...
    so jonnyb wrote a book...
    and then jonnyb had it published...
    figuring he may as well sell some copies...
    but jonnyb had a target audience who didn't know the book was written and published...
    so jonnyb decided to tell /.ers "a new book has been written", for "I wrote this book I am now selling" would be too much of a giveaway...
    jonnyb wants to advertise a product, but wants to be deceptive about it... it is cheaper this way I guess

  464. Link to online version by Hobart · · Score: 1
    --
    o/~ Join us now and share the software ...
  465. disagree by samantha · · Score: 1

    Assembly language for one course is great for understanding the low-level aspects of computer software. However, I have employed that level of understanding in my 23 year career less than a dozen times. Only one of those was mission critical. I would much rather see students equipped with VHLL (hint: Java ain't one) than assembler given a choice. A really good survey of languages course and a compiler course is more useful than assembler by far.

  466. 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)

  467. Buddy, can you spara digm? by Anonymous Coward · · Score: 0

    To the tune of "Buddy, can you spare a dime?":

    Once I had a website,
    made it run,
    made it race against time,
    once I had a website,
    now it's gone [to India],
    Buddy can you spara digm?

    Once with Starbuck's coffee's,
    gee - we looked swell,
    full of that Yankee Doodle de dum,
    Once we could buy Starbuck's,
    now it's gone [to India],
    Buddy can you spara digm?

    Say you remember,
    Oh - please tell me you remember,
    Buddy can you spara digm?

  468. assembly by Sean+Clifford · · Score: 1
    An add-on? That's odd. I think this was one of those first or second year elimination courses, y'know - like logic. I agree - it should be at the beginning; computer scientists need to know what's going on at the processor level. How to use registers, push and pop and execution order, jumping from one point to another, etc.

    Of course, when we started out at the beginning of the semestre it was all binary, our inputs were done in hex, and toward the end we were using standard MV, ADD assembly notation. Hard to believe it's been 8+ years; amazing what you forget.

    Anyway, we were programming for the Sinclair Z81, which is odd because the first computer I ever used (and put together) was a Timex Sinclair.

    Most of our graduates went on to work for the Department of Defence, NASA, or other government programming jobs (hence the focus on Ada for coding and rocketry in math courses) - fewer things are better cures for insomnia than taking lectures in aerothermaldynamics.

    I didn't go for the M.S. in CS (which is why I was blasting through undergrad prerequisites); ultimately I just went to work doing web development. It pays the bills. Still, one day I'd like to add an M.S. in CS or a Ph.D. to my B.A. and M.Ed. He who dies with the most degrees wins.

  469. Some ideas by Rick+BigNail · · Score: 1

    So far no one mention this report from ACM/IEEE.

    It is on computer science curriculum and it describes several approaches to introductory courses -- object-first, procedural-first, hardware first, etc.

    My opinion is that it does not matter whether you start with high level or assembly as long as all levels are covered.

    And many people mentioned Knuth and TAOCP. But this is not an introductory textbook for beginners. The reason he used assembly is to describe and analyse EXACTLY the cost and complexity of different algorithms. No one now could be called CS expert without reading this seminal work. So in some sense, expert programmers would know assembly but programmers who know assembly are not necessarily expert.

    My experience started with Pascal in highschool, scheme in first year college and C++ in second year. I encountered assembly, and binary gates and hardware, in second year basic architecture course. So can I cal myself expert?:)

    Anyway, computer science at UBC is quite good! (I am kind of sad when they change first year courses from scheme to java. Not that it is a bad choice, but I am not sure why I feel that way.)

  470. A great way to learn assembly language... by Ann+Elk · · Score: 1

    ...is to write a disassembler, preferrably in assembly language. Of course, you this won't teach you a lot of the required practical aspects (interacting with the OS, etc), but it will teach you everything you need to know about the processor's instruction set. Highly recommended.

  471. You had keypunch by www.sorehands.com · · Score: 1

    You had keypunch machines? I had to make my own arrowhead to poke holes into a punch card.

  472. "Computer Science" is not or"computer programming" by chris-johnson · · Score: 1

    So, my problem with this idea is that it seems to assume that computer science is all about computers and/or programming. Granted, that's what alot of CS curriculums focus on, and that's what alot of CS-majors wind up doing, but computer science isn't really about computers... This sounds like something that'd be more appropriate for computer engineers.

    On the other hand, if you say something more along the lines of "if you learn assembly language, you'll be a better programmer" or "you should start with assembly language before learning a high level language," then I sort of agree, but sort of don't. Knowing assembly most likely will give the programmer a better understanding of what's going on inside the machine, which is probably useful in lots of places, but not useful everywhere. I would expect that if you continuously think about the machine instead of about the problem you're trying to solve, you wind up getting bogged down in alot of mechanics of the machine. This is probably a good reason why you should start off programming in a higher level language (And I do not include C here, because C is too close to the machine) and focus on the real problem you're trying to solve, and go down closer to the machine only as it becomes necessary (i.e., something you obviously have to do if you're doing any sort of system programming). It would be interesting to take two groups of beginning programmers, and start one off with LISP and the other off with assembly, and see who really understands things better. I would expect that the LISP kids might have a better understanding of algorithms and high-level problem solving, while the assembly kids would have a better idea of what's going on with the internals of a machine.

    There's also a fear that you will scare people off if you try to start them off with assembly (though those who aren't competent in LISP would probably say the same about LISP), but then I guess the question becomes are you trying to teach them how to be good programmers, or trying to attract as many people as possible.

    Let me make it clear that I'm not 'bashing' assembly language, just that I think it's not the best way to do alot of things (and I've got a feeling anyone who's ever written alot of assembly will agree, to an extent, except those that have to be 'hardcore' and love assembly and only assembly).

    In any event, I think the best way to learn programming is probably to have a little bit of high level stuff, a little bit of low-level stuff, and be capable of choosing an appropriate tool/language/whatever.

    --

    <wik>/bin/finger that girl in the back row of machines.
  473. OT: K'Nex by wolrahnaes · · Score: 1

    pics? links? /me is a K'Nex addict ;P

    --
    I used to get high on life, but I developed a tolerance. Now I need something stronger.
  474. This is why... by Anonymous Coward · · Score: 0

    while(true) {MyCaseRests(0, null, false)}

  475. So is this all from someone shilling his own book? by multiplexo · · Score: 1

    If you look the poster is called "johnnyb". The name of the Author is Jonathan Bartlett. As far as I can tell most of the books on the Bartlett Publishing website are by Jonathan Bartlett. It looks to me as if this is basically a vanity press.

    --
    cheap labor conservatives - they want to keep you hungry enough to be thankful for minimum wage.