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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/14/11 07:51
Read: times


 
#182655 - Readability helps
Responding to: ???'s previous message
Andy Neil said:
Per Westermark said:
I'm way less likely to miss out when the assembler instruction uses [<addr>] than if it uses #<addr>. I must make two typing errors on the same line for the assembler to not detect a problem.


That assumes that it's just a typing mistake; if it's the more fundamental error of using an address where a literal is required (or vice versa), then the actual syntax doesn't help.

As you said earlier, 'C' has types to help here - Assemblers don't.

No - it assumes that it was just a typing mistake that introduced the error, and not a conceptual knowledge error.

But the real problem isn't how it was introduced, but how visible the error is when you review the code (and do know the conceptual difference between immediate values and indirection). And that is where the '[' <addr> ']' has a great advantage - at least for me, when I do review code. And why an assembler that both uses #<val> and $<val> is way worse than an assembler that uses #<val> and <val>H.

List of 17 messages in thread
TopicAuthorDate
8051 core quiz            01/01/70 00:00      
   quizes are out of fashion these days...            01/01/70 00:00      
      I did it....            01/01/70 00:00      
         thanks            01/01/70 00:00      
      missed CJNE            01/01/70 00:00      
         indeed            01/01/70 00:00      
            I guess a quite frequent oversight            01/01/70 00:00      
            RE: optimize LJMPs to AJMPs, etc            01/01/70 00:00      
      Maybe?            01/01/70 00:00      
         caught again!            01/01/70 00:00      
            Most common 8051 assembly mistake?            01/01/70 00:00      
               Not just 8051?            01/01/70 00:00      
                  Different assemblers have different probabilities            01/01/70 00:00      
                     Conceptual & Typographical errors            01/01/70 00:00      
                        some assemblers do            01/01/70 00:00      
                        Readability helps            01/01/70 00:00      
                     99's            01/01/70 00:00      

Back to Subject List