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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/16/07 14:08
Read: times


 
#139345 - Comments on comments on ...
Responding to: ???'s previous message
Hello Jan,

Thanks for the long note. I see your point of view on most items.

It is interesting how each person's experience affects the way they do things. In most of the projects I have worked on, there has been piece of external RAM to work with. And, in most of the projects I have worked on, execution speed has not been an issue except in very isolated situations. As a result, I tend to worry more about conserving program space than RAM.

I also have a "less code == fewer bugs" mentality that keeps me pointed in the same direction.

One place I do disagree with you is the "caller saves registers" vs. "callee saves registers" issue. Presumably, any given subroutine will be (or at least might be) called from multiple places in a big program. If the subroutine promises to clean up after itself, then the saving and restoring only has to be done once in the subroutine itself, instead of all over the place by the callers. This means less code and fewer oppotunities for mistakes (see above).

A worse problem appears if a widely-used subroutine in a big program suddenly decides it needs to use another register. If the subroutine does not save/restore that register, then you have to investigate every place that calls it and possibly make numerous adjustments throughout the program. That is an excellent recipe for creating new bugs.

I suppose this boils down to a big program vs. little progam tradeoff. In a little program, it's easy enough to use either way ("caller saves" or "caleee saves") or even to mix them, as you said. But in a bigger progam, I think you are asking for trouble with "caller saves".

Perhaps all big programs should be written in C. (c:

-- Russ



List of 44 messages in thread
TopicAuthorDate
Weekend Quiz - easy            01/01/70 00:00      
   Dumbbbbbb            01/01/70 00:00      
      I know of 3, and it is \"synthtetic\"...            01/01/70 00:00      
   Hi Jan!            01/01/70 00:00      
      2 out of 3            01/01/70 00:00      
   Comment lies!            01/01/70 00:00      
      that makes 4... embarrassing            01/01/70 00:00      
         #4            01/01/70 00:00      
            N-th            01/01/70 00:00      
               Similar            01/01/70 00:00      
         Thats the one I saw first too !            01/01/70 00:00      
   Another lyin\' comment            01/01/70 00:00      
      Bingo!            01/01/70 00:00      
   seems solved - so now for the equivalent in C?            01/01/70 00:00      
      Oops            01/01/70 00:00      
         Gee ... it was just an 'x' ...            01/01/70 00:00      
            Yup ...            01/01/70 00:00      
            "just" an x ?            01/01/70 00:00      
   writing SBUF without checking?            01/01/70 00:00      
      well...            01/01/70 00:00      
      the REAL mistake is using an HLL rather than ASM            01/01/70 00:00      
         Not so            01/01/70 00:00      
   Shall we continue this???            01/01/70 00:00      
      the spec itself is problematic            01/01/70 00:00      
         How would you fix the spec?            01/01/70 00:00      
            handle DEL (0x7f) and BS?            01/01/70 00:00      
               throwing in something to chew on... :-)            01/01/70 00:00      
               Are DEL and BS equivalent ???            01/01/70 00:00      
                  relax.            01/01/70 00:00      
      ReceiveString, rev.1            01/01/70 00:00      
         ReceiveString, rev. 2            01/01/70 00:00      
            there are many ways...            01/01/70 00:00      
               Comments on comments on ...            01/01/70 00:00      
                  (comments on)^3            01/01/70 00:00      
                  Caller-saves            01/01/70 00:00      
                     Caller-save vs. Callee-save            01/01/70 00:00      
                        Compiler trade-off            01/01/70 00:00      
      ReceiveString, rev. 3            01/01/70 00:00      
   Sunday Challenge (rev 4)            01/01/70 00:00      
      hard to beat...            01/01/70 00:00      
         Just one more byte ...            01/01/70 00:00      
            want to spare bytes?            01/01/70 00:00      
               CALL vs ACALL            01/01/70 00:00      
                  it depends            01/01/70 00:00      

Back to Subject List