| ??? 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
|
| Topic | Author | Date |
| 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 |



