Hi The code generated when I read the value of sfr T7 is as follows.
178: start_time = T7 ; 00005C98 F2FE50F0 MOV R14,DPP3:0x3050 179: _nop_() ;
MOV R14,T7
Hi Jon, You are absolutely right. I must admit, I made a mistake. I got confused at first because in the C166 instruction set there is the instruction MOV Rn,Rm: F0nm. But the 4-bit addressing mode can't be used for T7, so this instruction wouldn't work here. But I would like to point out a different inefficiency in C166. Try compiling this code:
unsigned long l; unsigned int i; void main(void) { i = (unsigned int)(l >> 16) + 1; }
0000 F2F50200 R MOV R5,l+02H 0004 F045 MOV R4,R5 ; <- unnecessary 0006 0841 ADD R4,#01H 0008 F6F40400 R MOV i,R4 000C CB00 RET