You should look into generated map file. Scroll to the end of file and find smth like this
Total size of all blocks to be downloaded: 133
,where 133 is code size in bytes. You also may be interested in these strings, which are in the middle of map file:
Summary of section sizes per section type:
READ_ONLY (R): 85 (dec: 133)
READ_WRITE (R/W): 2100 (dec: 8448)
NO_INIT (N/I): 27F (dec: 639)
READ_ONLY displays amount of code.
READ_WRITE displays amount of part of RAM, which is zeroed up at program startup. With default PRM file, this string displays total amount of used RAM. You may prevent initializing of some variables in RAM, allocating selected variables in NO_INIT segments. In this case NO_INIT variables will be c ounted in NO_INIT string.
NO_INIT displays space, occupied by peripherals registers and variables, allocated in NO_INIT segments.