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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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



List of 32 messages in thread
TopicAuthorDate
CRC16 CCITT - What a challenge!            01/01/70 00:00      
   Have you seen this?            01/01/70 00:00      
      Of course!            01/01/70 00:00      
         Balance            01/01/70 00:00      
            I know, Russ,            01/01/70 00:00      
         Code? What code?            01/01/70 00:00      
            in the code library - look to the left column            01/01/70 00:00      
               Thanks! I missed that note in the first post.            01/01/70 00:00      
   I need a hint            01/01/70 00:00      
      write down the bits            01/01/70 00:00      
         Thanks for the hint            01/01/70 00:00      
            Your observations plus a comparison in C            01/01/70 00:00      
               The rest of the story ...            01/01/70 00:00      
                  Compilers, but Keil C51 8.09 for the stated 28~            01/01/70 00:00      
                  and this processes only a nibble, isn't it...            01/01/70 00:00      
                     No, it process the entire byte.            01/01/70 00:00      
                        now it\'s my pencil time...            01/01/70 00:00      
                           FYFI            01/01/70 00:00      
                              Clarification re: 8-bit optimized term            01/01/70 00:00      
                              on optimisation            01/01/70 00:00      
                                 Jan's optimization            01/01/70 00:00      
                                    Re: on optimization            01/01/70 00:00      
                                       Can you please be more specific?            01/01/70 00:00      
                                          More specifically ...            01/01/70 00:00      
            and what            01/01/70 00:00      
               More on checksums            01/01/70 00:00      
   No reason to hide the excreted code            01/01/70 00:00      
      Excreted code needs context like any other code            01/01/70 00:00      
   One More Comment            01/01/70 00:00      
      ... and a marginal remark ...            01/01/70 00:00      
         Init all ones frequently specified            01/01/70 00:00      
   18 cycles            01/01/70 00:00      

Back to Subject List