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

Back to Subject List

Thread Closed: Issue successfully resolved

???
03/13/04 14:02
Read: times


 
#66647 - RE: I need help
Responding to: ???'s previous message
How in the world can you expect this code, the way you have it, to work when three things are greatly wrong.

#1) You think somehow that this sequence should fetch the first element from the table when you set the index in R6::R7 to 864? Strange......for the first element of the table the index should be ZERO. R6::R7 = 0000h.

#2) You show a very short program with an ORG at 030h. This would seem to me to place the base of the table at some low address like 0x0042 or something close to that. Yet in your comments you are saying the "table" label is at 0x038B. How can this be???

#3) You show instructions to load R6 and R7 and then you immediately fall into the subroutine. This is not the correct way to use the subroutine. Instead use code similar to what I showed before where the subroutine is called with the CALL instruction. Before making CALL's also make sure the SP (stack pointer) is aimed at a safe place.

Michael Karas


List of 36 messages in thread
TopicAuthorDate
C Programe for 8051            01/01/70 00:00      
   Reading List            01/01/70 00:00      
      RE: Reading List            01/01/70 00:00      
   RE: C Programe for 8051            01/01/70 00:00      
   Sorry for the new thread            01/01/70 00:00      
   I need help            01/01/70 00:00      
      Learning 'C'            01/01/70 00:00      
      RE: I need help            01/01/70 00:00      
         RE: I need help            01/01/70 00:00      
            RE: I need help            01/01/70 00:00      
               RE: C table lookup            01/01/70 00:00      
            RE: I need help            01/01/70 00:00      
               RE: I need help            01/01/70 00:00      
                  RE: I need help            01/01/70 00:00      
      RE: I need help            01/01/70 00:00      
         RE: I need help            01/01/70 00:00      
         RE: I need help            01/01/70 00:00      
            RE: I need help            01/01/70 00:00      
               RE: I need help            01/01/70 00:00      
                  RE: I need help            01/01/70 00:00      
                     RE: I need help            01/01/70 00:00      
                        RE: I need help            01/01/70 00:00      
                           RE: I need help            01/01/70 00:00      
                              RE: I need help            01/01/70 00:00      
                                 RE: I need help            01/01/70 00:00      
                                    RE: I need help            01/01/70 00:00      
                                 RE: I need help            01/01/70 00:00      
         RE: I need help            01/01/70 00:00      
            RE: I need help            01/01/70 00:00      
               RE: I need help            01/01/70 00:00      
                  RE: I need help            01/01/70 00:00      
            RE: I need help            01/01/70 00:00      
               RE: I need help            01/01/70 00:00      
                  RE: I need help            01/01/70 00:00      
                     RE: I need help            01/01/70 00:00      
                  RE: I need help            01/01/70 00:00      

Back to Subject List