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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/15/05 16:26
Read: times


 
#89727 - CJNE : Address out of range >_
I'm learning how to program the 8051 by trying to program it to be an alarm clock using the built-in timer.

I can finally combined 2 tutorials(Realtime clock and LCD programming) together.

But I've one annoying problem. When I try to use a jump command like CJNE, JNB, SJMP, etc... My compiler said "Address out of range". (but LJMP = no problem)

This can be easily solved by moving the "jump destination" somewhere close to the CJNE, JNB, ....

But... now my code is getting larger and larger. I can't move the destination functions somewhere close to the jump commands anymore. And I really need to use the CJNE command.

I wrote 2 programs seperately. One is an alarm clock, another is a timer that can be controlled to start/stop/reset using 2 buttons and can count in detailed of 0.1 seconds. Now I'm going to merge these 2 programs together and I found it impossible to avoid "Address out of range" with CJNE, JNB everywhere in my code.

My program is jusy a learning program, though it exceeds 300 lines already, can no way be compared to many expert's program out there.

Question : How do you solve this kind of problem?

P.S. The compiler used here is my simulator's built-in compiler. The simulator is called Proteus:Isis 6 professional. You can find the detail here.

http://www.labcenter-electronics.com/

Thank you. ^_^

List of 8 messages in thread
TopicAuthorDate
CJNE : Address out of range >_<;            01/01/70 00:00      
   Need a jump table            01/01/70 00:00      
   invert the test            01/01/70 00:00      
      CJNE -> invert?            01/01/70 00:00      
         just what I posted.            01/01/70 00:00      
   divide and conquer            01/01/70 00:00      
      I call them crutches            01/01/70 00:00      
   try this thread            01/01/70 00:00      

Back to Subject List