??? 08/13/07 19:40 Modified: 08/13/07 19:41 Read: times |
#143224 - now it\'s my pencil time... Responding to: ???'s previous message |
... to sit down and figure out how THIS ONE works...
:-) Thanks, Dan. JW PS I tried SDCC just to have a complete picture: 35 cycles (nothing spectacular...) void CRCNib(unsigned char b) 131 ; crc.c:5: CRCLo ^= b; 0005 E5 82 134 mov a,dpl 0007 FA 135 mov r2,a 0008 62*00 136 xrl _CRCLo,a 137 ; crc.c:6: b = CRCHi; 000A AA*01 139 mov r2,_CRCHi 140 ; crc.c:7: CRCHi = CRCLo ^ (CRCLo << 4); 000C E5*00 144 mov a,_CRCLo 000E C4 145 swap a 000F 54 F0 146 anl a,#0xf0 0011 FB 148 mov r3,a 0012 65*00 150 xrl a,_CRCLo 151 ; crc.c:8: CRCLo = b; 153 ; crc.c:9: CRCLo ^= (b = CRCHi >> 4); 0014 F5*01 157 mov _CRCHi,a 0016 8A*00 158 mov _CRCLo,r2 0018 C4 160 swap a 0019 54 0F 161 anl a,#0x0f 001B FB 164 mov r3,a 001C 8B 02 165 mov ar2,r3 001E 62*00 167 xrl _CRCLo,a 168 ; crc.c:10: b = CRCHi ^ (b >> 1); 0020 EA 172 mov a,r2 0021 C3 173 clr c 0022 13 174 rrc a 0023 FB 176 mov r3,a 0024 65*01 178 xrl a,_CRCHi 0026 FA 179 mov r2,a 180 ; crc.c:11: CRCLo ^= CRCHi << 3; 0027 E5*01 184 mov a,_CRCHi 0029 C4 185 swap a 002A 03 186 rr a 002B 54 F8 187 anl a,#0xf8 002D FB 189 mov r3,a 002E 62*00 191 xrl _CRCLo,a 192 ; crc.c:12: CRCHi = b; 0030 8A*01 194 mov _CRCHi,r2 0032 22 196 ret |