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 13:05
Read: times


 
#84264 - OK, New Thread
Responding to: ???'s previous message
Shahzad said:
I start new thread because i am stuck with another problem this time with passing parameters to function.

OK - see http://www.8052.com/forum/read.phtml?id=84261

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.

Please, please, please can we get this terminology right?!
You do mean the Keil Simulator, don't you - not the Debugger?!
http://www.8052.com/forum/read.phtml?id=84202
http://www.8052.com/forum/read.phtml?id=84212

You are saying that your code now "works" in the Simulator as well as your real target hardware?

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.

Does this just hang the real target, or also the Simulator?

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

Again, have you double-checked all your Project settings:
http://www.8052.com/forum/read.phtml?id=84253

Do you get any warning messages when you build the project?


List of 16 messages in thread
TopicAuthorDate
different data types            01/01/70 00:00      
   Compiler-dependent            01/01/70 00:00      
   True, but irrelevant            01/01/70 00:00      
      Go back to the original thread            01/01/70 00:00      
   OK, New Thread            01/01/70 00:00      
      sorry terminology            01/01/70 00:00      
         Still wrong terminology?            01/01/70 00:00      
         Wrong Target!            01/01/70 00:00      
            i am again wrong            01/01/70 00:00      
               Debugger!            01/01/70 00:00      
                  Huu,,,,            01/01/70 00:00      
   bad programming style !            01/01/70 00:00      
      Underlying problem!            01/01/70 00:00      
   Not The Problem            01/01/70 00:00      
      Re: Neil            01/01/70 00:00      
         RTFM!            01/01/70 00:00      

Back to Subject List