8-bit mcu,51 kernel:
New Pond n76e003at20, more than STM8 with a little more port, more specific what can Baidu, here do not repeat.
Note 1: Reasonable allocation of local variables, generally in the 8-bit microcontroller running on the program logic is relatively simple, single cycle + interrupt.
According to N76 's characteristics, some large array local variables are allocated in Xram. Refer to the EEPROM demo.
Note 2: The 8-bit machine has limited computational power , and the finite and divisible operations can be used directly.
1 th0= (65536-50000)/; 2 tl0= (65536-50000)%; 3 // is equivalent to 4 th0= (65536-50000) >>8; 5 tl0= (65536-50000) &0x00ff;
This does not know that the compiler will not go to active optimization, write their own more at ease.
Note that point 3: 8-bit and 32-bit problems with some data length:
1serialprintf ("Char:%d \n\r",sizeof(Char));2serialprintf ("Short :%d \n\r",sizeof( Short));3serialprintf ("int:%d \n\r",sizeof(int));4serialprintf ("Long:%d \n\r",sizeof(Long));5serialprintf ("Long Long:%d \n\r",sizeof(Long Long));6 //8 Guests7 Char:18 Short:29 int:2Ten Long:4 One Long Long:4 A //32 Guests - Char:1 - Short:2 the int:4 - Long:4 - Long Long:8
So, please use typedef signed Char int8; To define
Note 4: Use the TIMER0 interrupt 1, which is second only to INT0 in the interrupt priority, while the Ri/ti interrupt is 4.
About the limited resources on 8-bit MCU some points to note