Size of code

Để biết được sau khi viết mã nguồn, dung lượng chương trình sẽ chiếm trong Vi điều khiển là bao nhiêu thì trong chương trình IAR cũng có hỗ trợ việc này.

Chỉnh tùy chọn 1 chút trong IAR:

Vào Option -> Messages -> Ở mục Show build messages: chọn All

Messages Option

Đây là dạng log sẽ hiển thị trong khung Messages:

Building configuration: ADC10_MSP430G2553_A0_3.5VREF – Debug
Updating build tree…
C:\Users\Admin\Desktop\Mach T3\Code\Debug\Obj\ADC10_MSP430G2553_A0_3.5VREF.r43
C:\Users\Admin\Desktop\Mach T3\Code\Debug\Obj\ADC10_MSP430G2553_A0_3.5VREF.pbi
C:\Users\Admin\Desktop\Mach T3\Code\Debug\Exe\ADC10_MSP430G2553_A0_3.5VREF.d43
C:\Users\Admin\Desktop\Mach T3\Code\Debug\Obj\ADC10_MSP430G2553_A0_3.pbd

4 file(s) deleted.
Updating build tree…

ADC10_MSP430G2553_A0_3.5VREF.c
icc430.exe C:\Users\Admin\Desktop\Mach T3\Code\ADC10_MSP430G2553_A0_3.5VREF.c -o C:\Users\Admin\Desktop\Mach T3\Code\Debug\Obj\ –no_cse –no_unroll –no_inline –no_code_motion –no_tbaa –debug -D__MSP430G2452__ -e –double=32 –dlib_config C:\Program Files\IAR Systems\Embedded Workbench 6.0 Evaluation\430\LIB\DLIB\dl430fn.h -Ol

IAR C/C++ Compiler V5.30.1.20284/W32, Evaluation edition for MSP430
Copyright 1996-2011 IAR Systems AB.

2 792 bytes of CODE memory => Dung lượng CODE.
40 bytes of CONST memory (+ 4 bytes shared) => Dung Lượng RAM chứa các biến CONSTANT.
84 bytes of DATA memory (+ 27 bytes shared) => Dung Lượng RAM chứa các biến thông thường.

Errors: none
Warnings: none

Linking
xlink.exe C:\Users\Admin\Desktop\Mach T3\Code\Debug\Obj\ADC10_MSP430G2553_A0_3.5VREF.r43 -o C:\Users\Admin\Desktop\Mach T3\Code\Debug\Exe\ADC10_MSP430G2553_A0_3.5VREF.d43 -IC:\Program Files\IAR Systems\Embedded Workbench 6.0 Evaluation\430\LIB\ -f C:\Program Files\IAR Systems\Embedded Workbench 6.0 Evaluation\430\CONFIG\lnk430G2452.xcl -D_STACK_SIZE=50 -rt C:\Program Files\IAR Systems\Embedded Workbench 6.0 Evaluation\430\LIB\DLIB\dl430fn.r43 -e_PrintfLarge=_Printf -e_ScanfLarge=_Scanf -D_DATA16_HEAP_SIZE=50 -s__program_start -D_DATA20_HEAP_SIZE=50

IAR Universal Linker V5.2.1.11
Copyright 1987-2011 IAR Systems AB.

3 290 bytes of CODE memory
148 bytes of DATA memory (+ 27 absolute )
4 bytes of CONST memory

Errors: none
Warnings: none

Total number of errors: 0
Total number of warnings: 0