Does anyone know why a blank Arduino Sketch Uses 450 Bytes of Program Storage Space and has 9 Bytes of Global Variable? Why?
How does this compare with other AVR compilers?
Does anyone know why a blank Arduino Sketch Uses 450 Bytes of Program Storage Space and has 9 Bytes of Global Variable? Why?
How does this compare with other AVR compilers?
thanks for the link. do you know if using other AVR compilers will use the about the same amount of space?
They do vary, but something in the order of 400-500 bytes would be expected. If the AVR has more interfaces/pins, this would have more initialization code to setup. Even X86 has code on the boot drive to find what to load or put a message saying boot sector missing!
Clem
The concept - valid on any other kind of environment too - is that the system when creates a blank stuff as in your case, it is NOT creating nothing, it is creating ONE THING: the blank stuff. So first of all you should see this apparently strange behaviour in the right perspective: the concept of "no program" should be represented just as any other program, and it occupy a space in the environment. Obviously minimal but it needs.
The other aspect that is involved to this other "strange" behaviour, is related to the hardware and how the system represent data and bytes, instruction and so on. Bytes data architecture should follow internal hardware architecture so there is a standard bytes alignment, a minimal number of words occupied and so on. Then as your program grows a bit, if the aligned memory storage is sufficient it does not increase in size. This phenomenon is more explicitly visible as much you go near the machine language, as it occur in the case of microcontrollers programming.
The concept - valid on any other kind of environment too - is that the system when creates a blank stuff as in your case, it is NOT creating nothing, it is creating ONE THING: the blank stuff. So first of all you should see this apparently strange behaviour in the right perspective: the concept of "no program" should be represented just as any other program, and it occupy a space in the environment. Obviously minimal but it needs.
The other aspect that is involved to this other "strange" behaviour, is related to the hardware and how the system represent data and bytes, instruction and so on. Bytes data architecture should follow internal hardware architecture so there is a standard bytes alignment, a minimal number of words occupied and so on. Then as your program grows a bit, if the aligned memory storage is sufficient it does not increase in size. This phenomenon is more explicitly visible as much you go near the machine language, as it occur in the case of microcontrollers programming.