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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Craig Steiner
08/05/05 10:10
Read: 1076 times

#98882 - Changed last night
Responding to: Jan Waclawek's previous message
Jan Waclawek said:
It now says (maybe Craig changed meanwhile?):

I added some instruction cycle information last night (Thursday). I haven't added any more information this morning.

17 instruction cycles best case (1-bit shift) and 467 instruction cycles, worst-case (31-bit shift).

My question: Does this include the final ret?


By the way, couldn't the unoptimized version be published here, for reference?

Sure. I'm going to adjust the 17-best/467-worst to 18-best/468-worst because I was assuming that the number of bits to shift were passed to it in R3 rather than ACC. Since the challenge specifies that it should be received in ACC, I added a MOV R3,A at the beginning which adds one instruction cycle.

The unoptimized reference code for the challenge is:

   MOV         R3,A
   CLR         C
   MOV         A,R4
   RRC         A
   MOV         R4,A
   MOV         A,R5
   RRC         A
   MOV         R5,A
   MOV         A,R6
   RRC         A
   MOV         R6,A
   MOV         A,R7
   RRC         A
   MOV         R7,A
   DJNZ        R3,Loop

Craig Steiner

List of 17 messages in thread
Code Challenge operational      Craig Steiner      08/03/05 18:09      
   Questions for current challenge ?      Steve M. Taylor      08/04/05 07:20      
      Instruction Cycles?      Andy Neil      08/05/05 08:06      
         best case/worst case      Jan Waclawek      08/05/05 08:30      
            how about 30 instructions      Erik Malund      08/05/05 08:51      
               30 instructions?      Jan Waclawek      08/05/05 09:22      
                  i did count inside loops      Erik Malund      08/08/05 08:07      
            Changed last night      Craig Steiner      08/05/05 10:10      
      Tester/Counter      Jan Waclawek      08/05/05 08:47      
         Wow!      Craig Steiner      08/05/05 10:30      
   The 3 better solutions      Robert Perez      08/04/05 16:02      
   Definition of BEST      Graham Cole      08/05/05 10:24      
      Definition of best      Craig Steiner      08/05/05 10:56      
         Good idea      Graham Cole      08/10/05 06:06      
   pre tags?      Dan Henry      08/06/05 11:15      
      Yes      Craig Steiner      08/06/05 13:56      
         A highlight please      Jerson Fernandes      08/06/05 23:17      

Back to Subject List