Events
Keil C51
References
OPTIMIZE Level
目前主要使用Level 9优化级别 + Favor Size进行编译。经过测试,如果勾选上“Linker Code Packing(max. AJMP / ACALL)”,代码大小可以再降低10%

9 Common Block Subroutines: Recurring instruction sequences are converted into subroutines. This reduces program size but slightly increases execution speed. This optimization is performed on the complete application.
Linker Code Packing (max. AJMP / ACALL) Instructs the Compiler to include information in the object file for the linker-level program optimizations. When enabled, the LX51 linker/locater performs this optimizations.
优化代码
Memory Model
MCU IP (R80515)
Evatronix R80515
1T 8051 Core, Double DPTR, MDU (16 bit Multiplication-division unit)
 
Double DPTR
- Cx51 - Double DPTR
- Enable “Use multiple DPTR registers” 之后,C51编译时会应用多DPTR优化,但实际测试结果,仅减少了20B的代码大小
MDU
- Cx51 - MDU
- R80515 IP中有个 mdu.v 实现,包含这个文件才会支持MDU
- MDU的使用方式,是借助SFR来进行的,先把2个16bit数写到SFR(0xE9-0xEE),然后等待几个CPU Clock就完成了运算
- 详见下图:

|