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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Frieder Ferlemann
06/21/09 13:59
Read: 346 times
Old Europe


 
#166315 - doesn't SDCC warn about line 36?
Responding to: Girish Nikam's previous message
there is a lot to say about your code but

why should xmt_flag be tested for not being zero in line 36 if its value is known zero?

_uart_send:
        mov     _SBUF,dpl
;       uart.c:31: xmt_flag = 0;
        clr     a
        mov     _xmt_flag,a
        mov     (_xmt_flag + 1),a
;       uart.c:34: while (1)
00105$:
;       uart.c:39: opti_fooler++;
        inc     _opti_fooler
        clr     a
        cjne    a,_opti_fooler,00105$
        inc     (_opti_fooler + 1)
        sjmp    00105$
 


Hint: lookup "volatile", then recheck, then remove the variable:)

List of 17 messages in thread
TopicAuthorDate
UART code porting to SDCC      Girish Nikam      06/21/09 13:29      
   doesn't SDCC warn about line 36?      Frieder Ferlemann      06/21/09 13:59      
      that's it      Jan Waclawek      06/21/09 15:03      
         ah ha      Jez Smith      06/21/09 15:08      
            Don't blame the optimiser!      Andy Neil      06/22/09 01:36      
      doesn't SDCC warn about line 36      Girish Nikam      06/21/09 22:13      
         hmmm      Jez Smith      06/22/09 00:42      
         modified dog      Andy Peters      06/23/09 14:21      
   I cannot remember now      Jez Smith      06/21/09 14:33      
   xmt_flag., why "int"?      Mahesh Joshi      06/22/09 01:53      
      if you want to use it as "int" / "char"      Andy Neil      06/22/09 02:47      
   You destroy succeding putchar()'s      David Prentice      06/22/09 05:14      
      "Volatile" Helps      Girish Nikam      06/22/09 07:42      
         "bit" is more useful      Mahesh Joshi      06/22/09 08:16      
            buzzzzz      Erik Malund      06/22/09 08:37      
               family      Jan Waclawek      06/22/09 13:44      
            stdbool      Oliver Sedlacek      06/23/09 06:44      

Back to Subject List