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

Back to Subject List

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


 
#89218 - dkfuhg
Responding to: ???'s previous message
"At last.. an idiot even I can rip into."

Charming.

"Oh yes they are. It even says so in the manual. Isn't that right?"

No, it's wrong. The arguments are not passed on the stack, they are passed in a fixed 15 byte area of RAM. Problems caused by passing too many arguments occur when that 15 byte area is exhausted.

"Do tell us all precisely why"

You have a mismatch between the format specifiers and arguments. The format specifiers expect a two byte signed quantity, you are passiny single byte arguments.

"Wrong again. Its not the only thing you can do, and it depends on where you stack has been placed."

On the 8052 the stack has to start somewhere in the data/idata area and grows up. If you place variables in the idata area you are guaranteed to reduce the area available for the stack. If the stack was "low down in data memory" you would be placing variables into precisely the area the stack is trying to grow into.

"The first thing to do when printf() falls over when passed too much is to split it up into several calls. This uses less stack space."

I've explained above why splitting it up into several calls actually works.

"Just plain wrong. Please tell us all again exactly why you think it needs work, and I'll will happily put you straight."

You haven't declared your loop variable volatile. This means that the compiler can optimise it away completely if it sees fit. Even if it doesn't do so the time taken to execute the loop may well vary between compiler versions and optimisation levels. In a nutshell, about the only thing you can say for sure about it is that it is extremely unlikely to give the delay you expect.

"Otherwise STFU!"

Charming again!


List of 38 messages in thread
TopicAuthorDate
LCD<            01/01/70 00:00      
   must be a bug in lcd_write()            01/01/70 00:00      
      no bug            01/01/70 00:00      
      Bug in lcd_write            01/01/70 00:00      
         Another test            01/01/70 00:00      
         Not quite            01/01/70 00:00      
            Stand corrected            01/01/70 00:00      
               further corrected            01/01/70 00:00      
                  Makes sense            01/01/70 00:00      
                     Delay after the character write?            01/01/70 00:00      
                        unknown bug            01/01/70 00:00      
                           ANSI divergence            01/01/70 00:00      
                              Are you sure?            01/01/70 00:00      
                                 skdjfhg            01/01/70 00:00      
                                    It realy works fine with UART            01/01/70 00:00      
                                       Story so far            01/01/70 00:00      
   Keil and Function pointers?            01/01/70 00:00      
   Simulator            01/01/70 00:00      
      Kaiwalya - O.T            01/01/70 00:00      
         Let me try            01/01/70 00:00      
   Post the real code            01/01/70 00:00      
   Possibilities            01/01/70 00:00      
      ksfd            01/01/70 00:00      
         Troll            01/01/70 00:00      
            the real issue            01/01/70 00:00      
               Corrections            01/01/70 00:00      
               Small but fast            01/01/70 00:00      
                  MIPS            01/01/70 00:00      
            Corrections            01/01/70 00:00      
               sldkjf            01/01/70 00:00      
            dkfuhg            01/01/70 00:00      
               Corrections            01/01/70 00:00      
               Corrections            01/01/70 00:00      
                  got curious and looked            01/01/70 00:00      
               I'm wrong - Damn!            01/01/70 00:00      
                  debugging            01/01/70 00:00      
                     Post you real code            01/01/70 00:00      
   How to initilize 4X20 LCD            01/01/70 00:00      

Back to Subject List