??? 06/14/07 06:53 Read: times |
#140740 - 20 bytes. Responding to: ???'s previous message |
As you might expect, the shorter C programs generally produced less generated code.
UC r,i=7;DO{r=r*2|c&1;c/=2;}WH(--i);RT r; compiles to C:0x0003 7D07 MOV R5,#0x07 C:0x0005 EF MOV A,R7 C:0x0006 5401 ANL A,#0x01 C:0x0008 FC MOV R4,A C:0x0009 EE MOV A,R6 C:0x000A 25E0 ADD A,ACC(0xE0) C:0x000C 4C ORL A,R4 C:0x000D FE MOV R6,A C:0x000E EF MOV A,R7 C:0x000F C3 CLR C C:0x0010 13 RRC A C:0x0011 FF MOV R7,A C:0x0012 DDF1 DJNZ R5,C:0005 C:0x0014 AF06 MOV R7,0x06 C:0x0016 22 RET |