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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/30/04 14:40
Read: times


 
#67625 - RE: mistake in my code
Responding to: ???'s previous message
hi,
I think it is not error after label XRAM: but inside sorting logic instead.
So have some questions:
1) what do you copy bytes into 0x40...0x4F locations for?
2) your sorting algorithm comes to dead loop if there are two bytes with same value; look at your code more carefully:
CLR C 
SUBB A,@R0 
JNC MOVE
So, if two bytes are the same then it means they will be exchanged. As result, R5 will be increased and so after 15 iterrations your code will go to LOOP1 again. Then it will find these two bytes again and exchange them yet another time and ...look above - it is dead loop. To avoid such situation you should do something like:
CLR C 
SUBB A,@R0
JC COUNT
JZ COUNT 
MOVE:

In fact, next time I will try to look at your code more complex due have no time yet :(

Regards,
Oleg

List of 19 messages in thread
TopicAuthorDate
mistake in my code            01/01/70 00:00      
   RE: mistake in my code            01/01/70 00:00      
   RE: mistake in my code            01/01/70 00:00      
      RE: mistake in my code            01/01/70 00:00      
         RE: mistake in my code            01/01/70 00:00      
      RE: mistake in my code            01/01/70 00:00      
         RE: mistake in my code            01/01/70 00:00      
            RE: mistake in my code            01/01/70 00:00      
               RE: mistake in my code            01/01/70 00:00      
         RE: mistake in my code            01/01/70 00:00      
            RE: mistake in my code            01/01/70 00:00      
   RE: mistake in my code            01/01/70 00:00      
   RE: mistake in my code            01/01/70 00:00      
      RE: a comment on comments            01/01/70 00:00      
      RE: mistake in my code            01/01/70 00:00      
         RE: mistake in my code            01/01/70 00:00      
      Comments            01/01/70 00:00      
         RE: Comments            01/01/70 00:00      
            RE: Comments            01/01/70 00:00      

Back to Subject List