Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Thread Closed: Off-topic

???
10/01/06 00:25
Read: times


 
#125474 - Perhaps it's a compiler, but how good?
Responding to: ???'s previous message
Back in the days of CP/M, when BASCOM was a Microsoft product for the Z-80, etc, it produced considerably faster code than the same syntax on the same machine using the interpreter, which was also a Microsoft product.

It was supported with a linker and an Assembler, by means of which one could produce libraries of callable functions. The compiled code was MUCH faster than the interpreter, but MUCH slower than what was produced with MT+ Pascal or with BDS C or any of a number of other 'C' compilers.

I suspect that this is not so much becuase of the compielr, but because the BASIC language simply doesn't provide the ability to do some things as handily as 'C' will do them.

For years now, 'C' has been termed "portable assembler." I doubt that's appropriate, but it's a challenge to write ASM code that's appreciably faster than some 'C' compiler output. The primary difference seems, in most cases, to be that the 'C' compiler output is larger than the ASM output.

Now, why would that matter in a case where one has 64KB of code space available? Well, in the context of a discussion of comparing/contrasting the output from BASCOM vs. the output from ASEM51 or the like, perhaps that's because BASIC doesn't provide convenient means for managing code large enough for this to become an issue. It doesn't rule things out, but it doesn't make it convenient to handle them.

Does BASCOM produce ASM output files? If not, how do you handle cases where the output has to be faster than it is, i.e. where it has to take exactly 41.37 microseconds from the time you enter this function until you've returned to the calling procedure? In fact, how well can it handle generating critically timed code? If you have to "get around the loop" in 21 machine-code instruction cycles, how can you ensure that in Bascom?

After that, how well does it allow you to use two or more data pointers, exploiting features in a controller equipped with them that allow you to move data with one pointer for source and the other with destination address, incrementing or decrementing them automatically? If you have a pointer value that exceeds 32767, as you might if you're comparing values in a table in code space, how does it handle that? All these are trivial in ASM, and certainly convenient in 'C' or other modern languages.

There are lots of problems that BASIC can solve, but it won't generate tight code, and it won't be as fast as 'C', let alone ASM. Controlling the world is a time critical task. Until you can write precisely timed code you can't control it.

RE




List of 155 messages in thread
TopicAuthorDate
Assembler is dead            01/01/70 00:00      
   2K            01/01/70 00:00      
      Assembler is dead            01/01/70 00:00      
   the problem is that BASIC isn't            01/01/70 00:00      
      Assembler is dead            01/01/70 00:00      
         if you're happy with a few-kHz update rate, maybe            01/01/70 00:00      
   Reports of my demise are greatly exagerrated            01/01/70 00:00      
      There is other stuff            01/01/70 00:00      
         Assembler is dead            01/01/70 00:00      
            i thought basic had dies a long time ago            01/01/70 00:00      
               to goto or not to goto            01/01/70 00:00      
                  you're right about 'C'            01/01/70 00:00      
                     dead horse            01/01/70 00:00      
                        ..or used the syntax            01/01/70 00:00      
                     incomplete statement            01/01/70 00:00      
                  Not the hammer's fault if you can't drive a nail            01/01/70 00:00      
               No longer true, anyhow            01/01/70 00:00      
                  Structures in the mind            01/01/70 00:00      
                     structured programming            01/01/70 00:00      
                     EVEN Pascal            01/01/70 00:00      
                        ISO            01/01/70 00:00      
               The new interperters are better            01/01/70 00:00      
      Assembler is dead            01/01/70 00:00      
         Its sounds to me like            01/01/70 00:00      
            My thoughts too            01/01/70 00:00      
         Nothing smart            01/01/70 00:00      
            Assembler is dead            01/01/70 00:00      
               Basic is (brain) dead            01/01/70 00:00      
               I see the interest in PID controllers!            01/01/70 00:00      
                  Now we know what happened to his brain!            01/01/70 00:00      
                     See here Richard            01/01/70 00:00      
                        No, but "good" and "alive" don't apply            01/01/70 00:00      
               you are evidently smoking right now            01/01/70 00:00      
   Not at all!            01/01/70 00:00      
      Assembler is dead            01/01/70 00:00      
         Now your're talking!            01/01/70 00:00      
            Assembler is dead            01/01/70 00:00      
               Dead            01/01/70 00:00      
                  Here you go Andy...            01/01/70 00:00      
                     If you can\'t tolerate disagreement, SCRAM!            01/01/70 00:00      
                     Some points            01/01/70 00:00      
                     Credibility            01/01/70 00:00      
                        Here you go Andy...            01/01/70 00:00      
                           ANSI and ISO            01/01/70 00:00      
                              try GOOGLing on \'C\' interpreter            01/01/70 00:00      
                                 Here you go Richard            01/01/70 00:00      
                                    Perhaps it's a compiler, but how good?            01/01/70 00:00      
                                       Here Richard            01/01/70 00:00      
                                          Irrelevant            01/01/70 00:00      
                                          OK, so you can measure the width of the pulse...            01/01/70 00:00      
                                             Weird questions abound            01/01/70 00:00      
                                                Well, there's one task for which BASCOM's useless            01/01/70 00:00      
                                                   Here Richard            01/01/70 00:00      
                                                      Assembler is dead???            01/01/70 00:00      
                                                Well, I know a lot of hardware devices that do            01/01/70 00:00      
                                          how about an answer            01/01/70 00:00      
                              is that good or bad?            01/01/70 00:00      
                                 Yes.            01/01/70 00:00      
                                    Hi Jan and Steve,            01/01/70 00:00      
                           Nit picking?            01/01/70 00:00      
                              Here Andy,            01/01/70 00:00      
                                 Just a minute, Darren ...            01/01/70 00:00      
                                    Here Richard            01/01/70 00:00      
                                       Respect            01/01/70 00:00      
                                       Degree            01/01/70 00:00      
                                 what about the price pof the result?            01/01/70 00:00      
                        credibility - or not            01/01/70 00:00      
                           nope ... he's just stoned ...            01/01/70 00:00      
                           correct, why the hesitation            01/01/70 00:00      
                              LOL, good to have you back Erik            01/01/70 00:00      
                     Forum            01/01/70 00:00      
                        Hi All,            01/01/70 00:00      
                           Ouch            01/01/70 00:00      
                           Compiler Wars            01/01/70 00:00      
                              Here you go Andy...            01/01/70 00:00      
                                 Counter example            01/01/70 00:00      
                                    Here you go Andy...            01/01/70 00:00      
                                       living proof that drugs make you ... stupid, maybe            01/01/70 00:00      
                                       why would anyone            01/01/70 00:00      
                                 with 90% of the responders being rank amateurs, wh            01/01/70 00:00      
                           ah, now we are getting somewhere            01/01/70 00:00      
                     CPU design            01/01/70 00:00      
                        it's pretty clear he means applications            01/01/70 00:00      
                        Super CPU            01/01/70 00:00      
                           non sequiter            01/01/70 00:00      
                              Jeff's super CPU            01/01/70 00:00      
                                 You lack the talent for sarcasm            01/01/70 00:00      
                                    Here Jeff            01/01/70 00:00      
                                       Darren, you DO need a spell-checker!            01/01/70 00:00      
                                       if you heard what I thought I said            01/01/70 00:00      
                                 EE students are required to do that.            01/01/70 00:00      
                                 Oh, my            01/01/70 00:00      
                     this is getting more and more ridiculous            01/01/70 00:00      
               the oner thing that is consistent in your posts            01/01/70 00:00      
            I elaborate, Andy            01/01/70 00:00      
         what about 600.000 units            01/01/70 00:00      
   I see nothing useful            01/01/70 00:00      
   #ASM ... #ENDASM            01/01/70 00:00      
   wonder what BasCom was written in?            01/01/70 00:00      
      we need a BasCom written in BASIC!            01/01/70 00:00      
         Hi Richard,            01/01/70 00:00      
            Compiler design            01/01/70 00:00      
               Thank you, Steve            01/01/70 00:00      
               interpreting            01/01/70 00:00      
            It's been around since the early '80's            01/01/70 00:00      
               Bit Banging            01/01/70 00:00      
         not a compiler but an interpreter            01/01/70 00:00      
   Delphi            01/01/70 00:00      
   Basic is Dead            01/01/70 00:00      
      Go Forth my child            01/01/70 00:00      
         Going Forth            01/01/70 00:00      
            Here Richard            01/01/70 00:00      
               too much of that weed, fer shurr!            01/01/70 00:00      
                  Buggy compilers            01/01/70 00:00      
                     Maarten Brock would be interested in that!            01/01/70 00:00      
                        SDCC has its Darrens            01/01/70 00:00      
                     free != buggy            01/01/70 00:00      
                        What a gamble!!            01/01/70 00:00      
                           I don't gamble            01/01/70 00:00      
                           Darren, you MUST be stoned!            01/01/70 00:00      
                              Here Richard            01/01/70 00:00      
                     usually is a big word            01/01/70 00:00      
               No            01/01/70 00:00      
                  Really?            01/01/70 00:00      
                     Thanks for the support, Kai            01/01/70 00:00      
                     It's True            01/01/70 00:00      
                        Hey Ian, here you go            01/01/70 00:00      
                           Darren, you've got to learn to read and write.            01/01/70 00:00      
                           Duh!            01/01/70 00:00      
                              Interpreters, Hey Ian and Richard            01/01/70 00:00      
                                 LOL            01/01/70 00:00      
                        Cool!            01/01/70 00:00      
                  let's not go overboard, Ian            01/01/70 00:00      
                     Crap            01/01/70 00:00      
         so, now we know            01/01/70 00:00      
   Hammer is dead            01/01/70 00:00      
      Would'nt he look better with a screwdriver?            01/01/70 00:00      
         Or, have a look at this one            01/01/70 00:00      
            Will this invention lead to a come back of hammer?            01/01/70 00:00      
      GOOD POINT!            01/01/70 00:00      
   Dead??            01/01/70 00:00      
   Interesting Google results            01/01/70 00:00      
      HHHmmmm unemployed which is not surprising            01/01/70 00:00      
         lets not go totally \"ad-hominem\"            01/01/70 00:00      
            logical fallacies            01/01/70 00:00      
               maybe he's not a complete idiot ...            01/01/70 00:00      
                  a danish proverb translated            01/01/70 00:00      
                     The meaning of the proverb...            01/01/70 00:00      
                        I think the proverb also is about that, neverthele            01/01/70 00:00      
      Hey Jeff            01/01/70 00:00      
         The problem with dopeheads            01/01/70 00:00      
            Here Russel            01/01/70 00:00      
               Darren, you still need a spell-checker!            01/01/70 00:00      
   rotating at 100.000 RPM in the grave            01/01/70 00:00      
      Hi Erik            01/01/70 00:00      

Back to Subject List