Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. The Classic [modified]

The Classic [modified]

Scheduled Pinned Locked Moved The Weird and The Wonderful
questioncsharpc++java
30 Posts 16 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I freely admit it: I have done this frequently in the past and I will do it again. And it holds countless horrors for those who are not used to it anymore:

    void SomeClass::SomeMethod()
    {
    asm
    {
    // here the horrors begin
    ....
    }
    }

    Seriously, I once began on a small self-built machine and typed in machine codes with its hex keypad. Compared to that some C++ inline assembly code is already high level. But I often wonder how people fare, who started out with something like .Net and Java. Edit: How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

    modified on Monday, May 5, 2008 9:25 AM

    C L V P E 10 Replies Last reply
    0
    • L Lost User

      I freely admit it: I have done this frequently in the past and I will do it again. And it holds countless horrors for those who are not used to it anymore:

      void SomeClass::SomeMethod()
      {
      asm
      {
      // here the horrors begin
      ....
      }
      }

      Seriously, I once began on a small self-built machine and typed in machine codes with its hex keypad. Compared to that some C++ inline assembly code is already high level. But I often wonder how people fare, who started out with something like .Net and Java. Edit: How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

      modified on Monday, May 5, 2008 9:25 AM

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      CDP1802 wrote:

      How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

      Use a <pre> block, not a <code> block.

      Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) My website | Blog

      L 1 Reply Last reply
      0
      • C Colin Angus Mackay

        CDP1802 wrote:

        How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

        Use a <pre> block, not a <code> block.

        Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Introduction to LINQ to XML (Part 1) - (Part 2) My website | Blog

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Thanks, I will edit it

        1 Reply Last reply
        0
        • L Lost User

          I freely admit it: I have done this frequently in the past and I will do it again. And it holds countless horrors for those who are not used to it anymore:

          void SomeClass::SomeMethod()
          {
          asm
          {
          // here the horrors begin
          ....
          }
          }

          Seriously, I once began on a small self-built machine and typed in machine codes with its hex keypad. Compared to that some C++ inline assembly code is already high level. But I often wonder how people fare, who started out with something like .Net and Java. Edit: How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

          modified on Monday, May 5, 2008 9:25 AM

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          CDP1802 wrote:

          But I often wonder how people fare, who started out with something like .Net and Java.

          I find it extremely hard :( I wish I knew a lot more.

          xacc.ide - now with TabsToSpaces support
          IronScheme - 1.0 alpha 3 out now

          1 Reply Last reply
          0
          • L Lost User

            I freely admit it: I have done this frequently in the past and I will do it again. And it holds countless horrors for those who are not used to it anymore:

            void SomeClass::SomeMethod()
            {
            asm
            {
            // here the horrors begin
            ....
            }
            }

            Seriously, I once began on a small self-built machine and typed in machine codes with its hex keypad. Compared to that some C++ inline assembly code is already high level. But I often wonder how people fare, who started out with something like .Net and Java. Edit: How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

            modified on Monday, May 5, 2008 9:25 AM

            V Offline
            V Offline
            VentsyV
            wrote on last edited by
            #5

            I never had to write inline ASM, but whats the big deal ? And isn't it __asm ??

            L 1 Reply Last reply
            0
            • L Lost User

              I freely admit it: I have done this frequently in the past and I will do it again. And it holds countless horrors for those who are not used to it anymore:

              void SomeClass::SomeMethod()
              {
              asm
              {
              // here the horrors begin
              ....
              }
              }

              Seriously, I once began on a small self-built machine and typed in machine codes with its hex keypad. Compared to that some C++ inline assembly code is already high level. But I often wonder how people fare, who started out with something like .Net and Java. Edit: How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

              modified on Monday, May 5, 2008 9:25 AM

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              Sorry - but I have to say this isn't a horror. Sometimes it's just plain necessary.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              L G 2 Replies Last reply
              0
              • L Lost User

                I freely admit it: I have done this frequently in the past and I will do it again. And it holds countless horrors for those who are not used to it anymore:

                void SomeClass::SomeMethod()
                {
                asm
                {
                // here the horrors begin
                ....
                }
                }

                Seriously, I once began on a small self-built machine and typed in machine codes with its hex keypad. Compared to that some C++ inline assembly code is already high level. But I often wonder how people fare, who started out with something like .Net and Java. Edit: How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

                modified on Monday, May 5, 2008 9:25 AM

                E Offline
                E Offline
                Ed Poore
                wrote on last edited by
                #7

                I've obviously got too much shooting on the brain because I thought, wow someone else going to The Classic[^] ;P

                L 1 Reply Last reply
                0
                • V VentsyV

                  I never had to write inline ASM, but whats the big deal ? And isn't it __asm ??

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  In Visual C++ I always used plain 'asm', but I don't doubt that also '_asm' exists. I will look it up when I start working.

                  1 Reply Last reply
                  0
                  • P Pete OHanlon

                    Sorry - but I have to say this isn't a horror. Sometimes it's just plain necessary.

                    Deja View - the feeling that you've seen this post before.

                    My blog | My articles

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    I also see it that way. At college a professor tried to tell me that I can't possibly write better code than a compiler. I proved him wrong, but it's not really hard do better than a compiler in most cases. But I had the impression that many people feel uneasy about going down to assembly level. They are used to all kinds of high level comfort and it seems to be a horror for them to give it up.

                    P M S 3 Replies Last reply
                    0
                    • E Ed Poore

                      I've obviously got too much shooting on the brain because I thought, wow someone else going to The Classic[^] ;P

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Now that would be no programming horror :) As for shooting... I used to be good with machine pistols, rifles and machine guns, but probably could need a little practice now.

                      1 Reply Last reply
                      0
                      • L Lost User

                        I also see it that way. At college a professor tried to tell me that I can't possibly write better code than a compiler. I proved him wrong, but it's not really hard do better than a compiler in most cases. But I had the impression that many people feel uneasy about going down to assembly level. They are used to all kinds of high level comfort and it seems to be a horror for them to give it up.

                        P Offline
                        P Offline
                        Pete OHanlon
                        wrote on last edited by
                        #11

                        CDP1802 wrote:

                        But I had the impression that many people feel uneasy about going down to assembly level.

                        Horses for courses. If I'm writing a data entry app, then I would be extremely uneasy, but if I'm writing an app that needs to interact with the registers then I would use this.

                        Deja View - the feeling that you've seen this post before.

                        My blog | My articles

                        L 1 Reply Last reply
                        0
                        • P Pete OHanlon

                          CDP1802 wrote:

                          But I had the impression that many people feel uneasy about going down to assembly level.

                          Horses for courses. If I'm writing a data entry app, then I would be extremely uneasy, but if I'm writing an app that needs to interact with the registers then I would use this.

                          Deja View - the feeling that you've seen this post before.

                          My blog | My articles

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #12

                          Certainly. A user interface which sits there most of the time, waiting for some event to happen, would not profit much from assembly code. Also, I would not want to lose all benefits from object oriented programming. But then comes something, that needs a little optimisation. Sometimes you can't just write beautiful high level code and tell the customer to buy a faster computer. But it seems, this is a lost art. Many 'modern' developers tell me that the compilers are good enough (I usually tell them that this means they are not), the next generation of processors will bring more than any optimization, and of course, that optimization costs too much development time.

                          B H 2 Replies Last reply
                          0
                          • L Lost User

                            Certainly. A user interface which sits there most of the time, waiting for some event to happen, would not profit much from assembly code. Also, I would not want to lose all benefits from object oriented programming. But then comes something, that needs a little optimisation. Sometimes you can't just write beautiful high level code and tell the customer to buy a faster computer. But it seems, this is a lost art. Many 'modern' developers tell me that the compilers are good enough (I usually tell them that this means they are not), the next generation of processors will bring more than any optimization, and of course, that optimization costs too much development time.

                            B Offline
                            B Offline
                            BadKarma
                            wrote on last edited by
                            #13

                            CDP1802 wrote:

                            But it seems, this is a lost art. Many 'modern' developers tell me that the compilers are good enough (I usually tell them that this means they are not), the next generation of processors will bring more than any optimization, and of course, that optimization costs too much development time.

                            Sadly, but true. Another reason to know assembler is, when you have written 'correct' code, and somehow there is a bug in the application. In those rare cases its good to be certain that the compiler has created correct code. This way we have found 3 bugs in the compiler and one bug due to including a header which changed a struct a little in one specific part of the application.

                            Learn from the mistakes of others, you may not live long enough to make them all yourself.

                            1 Reply Last reply
                            0
                            • L Lost User

                              I freely admit it: I have done this frequently in the past and I will do it again. And it holds countless horrors for those who are not used to it anymore:

                              void SomeClass::SomeMethod()
                              {
                              asm
                              {
                              // here the horrors begin
                              ....
                              }
                              }

                              Seriously, I once began on a small self-built machine and typed in machine codes with its hex keypad. Compared to that some C++ inline assembly code is already high level. But I often wonder how people fare, who started out with something like .Net and Java. Edit: How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

                              modified on Monday, May 5, 2008 9:25 AM

                              M Offline
                              M Offline
                              MidwestLimey
                              wrote on last edited by
                              #14

                              CDP1802 wrote:

                              But I often wonder how people fare, who started out with something like .Net and Java.

                              Taught myself assembler on an old 386 in a very boring support job. Lowest I get to these days is MSIL ... sadly most .Net developers aren't even aware of that. In a previous gig I had code that added dynamic methods to reset resources. Not only did the other developers not know about dynamic methods, they didn't even know what IL was .. sad.


                              I'm largely language agnostic


                              After a while they all bug me :doh:


                              L 1 Reply Last reply
                              0
                              • L Lost User

                                I freely admit it: I have done this frequently in the past and I will do it again. And it holds countless horrors for those who are not used to it anymore:

                                void SomeClass::SomeMethod()
                                {
                                asm
                                {
                                // here the horrors begin
                                ....
                                }
                                }

                                Seriously, I once began on a small self-built machine and typed in machine codes with its hex keypad. Compared to that some C++ inline assembly code is already high level. But I often wonder how people fare, who started out with something like .Net and Java. Edit: How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

                                modified on Monday, May 5, 2008 9:25 AM

                                C Offline
                                C Offline
                                cp9876
                                wrote on last edited by
                                #15

                                Your user name brings back memories. One of my first jobs was a military radio using an 1802 mpu, I always considered myself lucky to be on the hardware side, the poor suckers programming it had to cope with an instruction set that didn't even have an in-built call subroutine instruction. You had to manually save the return address on the stack then load a new value to the PC. To return you popped the stack to the PC. I remember hours helping debug the thing with a logic analyser. I hate to say it but I guess all 1802 code would probably classify as a horror today. I think the main advantage was the fact that it was true CMOS. note - to those brought up on C#: PC = program counter

                                Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

                                L 1 Reply Last reply
                                0
                                • L Lost User

                                  I freely admit it: I have done this frequently in the past and I will do it again. And it holds countless horrors for those who are not used to it anymore:

                                  void SomeClass::SomeMethod()
                                  {
                                  asm
                                  {
                                  // here the horrors begin
                                  ....
                                  }
                                  }

                                  Seriously, I once began on a small self-built machine and typed in machine codes with its hex keypad. Compared to that some C++ inline assembly code is already high level. But I often wonder how people fare, who started out with something like .Net and Java. Edit: How do I indent the code lines correctly with this editor? Tabs and spaces will not work.

                                  modified on Monday, May 5, 2008 9:25 AM

                                  D Offline
                                  D Offline
                                  darkelv
                                  wrote on last edited by
                                  #16

                                  CDP1802 wrote:

                                  But I often wonder how people fare, who started out with something like .Net and Java.

                                  "OMG! What is this? Which forum do I go to to ask for a solution for THAT!!!???"

                                  1 Reply Last reply
                                  0
                                  • L Lost User

                                    I also see it that way. At college a professor tried to tell me that I can't possibly write better code than a compiler. I proved him wrong, but it's not really hard do better than a compiler in most cases. But I had the impression that many people feel uneasy about going down to assembly level. They are used to all kinds of high level comfort and it seems to be a horror for them to give it up.

                                    M Offline
                                    M Offline
                                    MarkB777
                                    wrote on last edited by
                                    #17

                                    watching our professor give his assember 'examples' IS a horror!

                                    Mark Brock Click here to view my blog

                                    1 Reply Last reply
                                    0
                                    • C cp9876

                                      Your user name brings back memories. One of my first jobs was a military radio using an 1802 mpu, I always considered myself lucky to be on the hardware side, the poor suckers programming it had to cope with an instruction set that didn't even have an in-built call subroutine instruction. You had to manually save the return address on the stack then load a new value to the PC. To return you popped the stack to the PC. I remember hours helping debug the thing with a logic analyser. I hate to say it but I guess all 1802 code would probably classify as a horror today. I think the main advantage was the fact that it was true CMOS. note - to those brought up on C#: PC = program counter

                                      Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

                                      L Offline
                                      L Offline
                                      Lost User
                                      wrote on last edited by
                                      #18

                                      The good old CDP1802 must be one of the oldest CPUs which still in production. I used it in my first self built computer (which still exists and works). The 1802's instruction set foreshadowed the later RISC processors and therefore is no horror at all. For a beginner a CDP180X (all CPUs of that line had almost identical instruction sets) there can be no friendlier processor to program. A very compact instruction set, few addressing modes, 16 registers for general purpose use (just take two of them as you like as PC and SP), one single bit (DF) which elegantly serves as status flag for all processor operations... And, as I hear, the little 'horror' still does it's job after more than 30 years in space in the Voyager probes. And yes, it had a real hardware horror: A multiplexed address bus.

                                      C 1 Reply Last reply
                                      0
                                      • M MidwestLimey

                                        CDP1802 wrote:

                                        But I often wonder how people fare, who started out with something like .Net and Java.

                                        Taught myself assembler on an old 386 in a very boring support job. Lowest I get to these days is MSIL ... sadly most .Net developers aren't even aware of that. In a previous gig I had code that added dynamic methods to reset resources. Not only did the other developers not know about dynamic methods, they didn't even know what IL was .. sad.


                                        I'm largely language agnostic


                                        After a while they all bug me :doh:


                                        L Offline
                                        L Offline
                                        Lost User
                                        wrote on last edited by
                                        #19

                                        It's not the first time such things have happened. I know a blacksmith. A real blacksmith, who really still works at his anvil. His profession almost does not exist anymore. We have all kinds of sophisticated means of producing high quality steel on an industrial scale, but the knowledge how to manually shape steel and give it the desired properties is almost lost. I guess it will be reinvented if and when the need should arise.

                                        G 1 Reply Last reply
                                        0
                                        • L Lost User

                                          The good old CDP1802 must be one of the oldest CPUs which still in production. I used it in my first self built computer (which still exists and works). The 1802's instruction set foreshadowed the later RISC processors and therefore is no horror at all. For a beginner a CDP180X (all CPUs of that line had almost identical instruction sets) there can be no friendlier processor to program. A very compact instruction set, few addressing modes, 16 registers for general purpose use (just take two of them as you like as PC and SP), one single bit (DF) which elegantly serves as status flag for all processor operations... And, as I hear, the little 'horror' still does it's job after more than 30 years in space in the Voyager probes. And yes, it had a real hardware horror: A multiplexed address bus.

                                          C Offline
                                          C Offline
                                          cp9876
                                          wrote on last edited by
                                          #20

                                          CDP1802 wrote:

                                          I used it in my first self built computer

                                          My aims were somewhat grander - I managed to talk our rep into a sample of a 68000 (an 8MHz version if I recall) when they cost in the hundreds of pounds. I still have it somewhere. The outcome was somewhat poorer than yours, although I did use it to flash a LED I never got round to building the computer, bought an 8086 box instead.

                                          Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

                                          L 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups