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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/05/04 10:12
Read: times


 
#67944 - RE: Shifting/Rotating
Responding to: ???'s previous message

#include <reg51.h>

unsigned char findrow( void )   // FindRow:
{
  unsigned char i, j;

  j = P1;                       // mov a,P1 ;read rows

  for( i = 4; i; i-- ){         // mov r0,#4 ;initialize counter
    if( j & 1 ){
      j >>= 1;                  // rrc a ;read next row
      continue;
    }
    break;                      // jnc Rowfound
  }                             // djnz r0,TryNextRow

  return 4 - i;                 // subb a,r0 ;compute row number - note C=0
}


Peter


List of 15 messages in thread
TopicAuthorDate
Shifting/Rotating            01/01/70 00:00      
   RE: Shifting/Rotating            01/01/70 00:00      
      RE: Shifting/Rotating            01/01/70 00:00      
         RE: Shifting/Rotating            01/01/70 00:00      
   RE: Shifting/Rotating            01/01/70 00:00      
   Horses for Courses            01/01/70 00:00      
   RE: Shifting/Rotating            01/01/70 00:00      
      RE: Shifting/Rotating            01/01/70 00:00      
         RE: Shifting/Rotating            01/01/70 00:00      
         RE: Shifting/Rotating            01/01/70 00:00      
            RE: Shifting/Rotating            01/01/70 00:00      
               RE: Shifting/Rotating            01/01/70 00:00      
                  RE: Shifting/Rotating            01/01/70 00:00      
                  RE: Shifting/Rotating            01/01/70 00:00      
                     RE: Shifting/Rotating            01/01/70 00:00      

Back to Subject List