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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/22/08 03:36
Read: times


 
#159244 - stacking numbers in memory code problem
Here is some code to stack numbers in memory. The latest number is stored at location 0141H in memory - the 50th number is stored at 0172H in memory.

I can't seem to get more then the latest number position to load with data - the other 49 locations remain blank for some reason.

Location #44H in RAM has the latest number and this number should be put into 0141H in memory.

I use the DPTR as a convenient memory pointer.

Memory is a 25LC640 EEPROM and the CPU is a AT89LP4052

The write and read to memory routines work so I wont show them.

What is wrong with the following code?

INCNXNU:MOV DPTR,#0171H
INCNJ: CALL READEE ;READ MEMORY AND STORE IN 46H
INC DPL
MOV 48H,46H
CALL WRITEEE ;WRITE MEMORY MOVE TO NEXT POSITION DOWN
DEC DPL
DEC DPL
MOV A,DPL
CJNE A,#41H,INCNJ
MOV 48H,44H ;PUT LAST RESULT ON TOP AT 0141H
CALL WRITEEE
RET

List of 16 messages in thread
TopicAuthorDate
stacking numbers in memory code problem            01/01/70 00:00      
   does readee put its value in 46H?            01/01/70 00:00      
      readee reads memory            01/01/70 00:00      
         Your code looks good to me            01/01/70 00:00      
            it looks awful to me            01/01/70 00:00      
               it was indented            01/01/70 00:00      
                  like this            01/01/70 00:00      
                  Instructions            01/01/70 00:00      
                     yes, yes, ok            01/01/70 00:00      
                        Guided/unguided?            01/01/70 00:00      
            EEPROM not final            01/01/70 00:00      
   Hard coded values            01/01/70 00:00      
      that can't be it            01/01/70 00:00      
         Are you 199% sure??            01/01/70 00:00      
            Here is the WRITEEE code            01/01/70 00:00      
               HA! figured it out            01/01/70 00:00      

Back to Subject List