[an error occurred while processing this directive]
|
4 char Nbits(unsigned word)
5 {
6 char _count = 0;
\ __nearfunc char Nbits(unsigned int);
\ Nbits:
\ 00000000 E020 LDI R18,0
\ 00000002 C007 RJMP ??Nbits_0
7
8 while (word)
9 {
10 word &= word - 1;
\ ??Nbits_1:
\ 00000004 2F40 MOV R20,R16
\ 00000006 2F51 MOV R21,R17
\ 00000008 5041 SUBI R20,1
\ 0000000A 4050 SBCI R21,0
\ 0000000C 2304 AND R16,R20
\ 0000000E 2315 AND R17,R21
11 ++_count;
\ 00000010 9523 INC R18
\ ??Nbits_0:
\ 00000012 2F30 MOV R19,R16
\ 00000014 2B31 OR R19,R17
\ 00000016 F7B1 BRNE ??Nbits_1
12 }
13 return _count;
\ 00000018 2F02 MOV R16,R18
\ 0000001A 9508 RET
14 }
Maximum stack usage in bytes:
Function CSTACK RSTACK
-------- ------ ------
Nbits 0 0
28 bytes in segment CODE
28 bytes of CODE memory
E-mail: info@telesys.ru