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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/03/05 12:31
Read: times


 
#84260 - Re Andy
Responding to: ???'s previous message
Sorry i left this thread becuase i solve this problem.

first i always run my code on my 8052 system with LCD so the function WriteCommandLCD() is working absolutely fine.


second i replace
if( ((y % 4) == 0) && ((y % 100) != 0) || ((y % 400) == 0) )

with this code.

if( (DivAndRem(y, 4, 2) == 0) , .....

as you can see i replace (y % 4) with my own function DivAndRem(y, 4, 2) which basically calculates the remainder with subtraction. (last parameter 2 basically indicate that i need Remainder not Muliply of two numbers). NOW The Statement above is working absolutely fine in Debugger as well as on my real 8052 system after burning and running program. No Doubt about it.

I start new thread because i am stuck with another problem
this time with passing parameters to function. like

DivAndRem(long a, long b, int c)

and if i call the above function with this statement

int a, b;
a = 100;
b = 10;

DivAndRem(a, b ,2)

this hangs the system again as you can see the parameter types are different.

then just for testing i make all variables and parameters integer

and this work fine after i burn the program.

also some how if i use long it still hangs the system. but if i replace with int or double. every thing works fine

i am really confused and frustrated with all this debugging.

Shahzad




List of 25 messages in thread
TopicAuthorDate
Keil C Code not working            01/01/70 00:00      
   Desktop turbo c++ ?            01/01/70 00:00      
      Slightly??!!            01/01/70 00:00      
      agreed            01/01/70 00:00      
         i got the math to do div / multiply            01/01/70 00:00      
         Debugger? Simulator? Maths?            01/01/70 00:00      
            Question...            01/01/70 00:00      
               Please use Correct Terms            01/01/70 00:00      
            Re Andy Debugger, Simulator? Math            01/01/70 00:00      
         *unnecessarily* complex!            01/01/70 00:00      
            Re andy            01/01/70 00:00      
               Divide and Conquer!            01/01/70 00:00      
         Bad Burner?            01/01/70 00:00      
            Re Andy Bad Burner            01/01/70 00:00      
         Project Configuration?            01/01/70 00:00      
   debugging?            01/01/70 00:00      
      thanks for the link            01/01/70 00:00      
   Data Sizes - Lesson not yet learned?            01/01/70 00:00      
      Re Andy            01/01/70 00:00      
   brackets ?            01/01/70 00:00      
      (no) brackets            01/01/70 00:00      
   WriteCommandLCD ?            01/01/70 00:00      
      Re Andy            01/01/70 00:00      
         Problem not fixed yet?            01/01/70 00:00      
            Problem not fixed yet?            01/01/70 00:00      

Back to Subject List