Hello
Does the length of variable names affect the size of code loaded into an ARMweb. How are the names resolved between the compiled code and that used in web pages?
Thanks
size of variable names and compiled code size
Re: size of variable names and compiled code size
From what I've read of OS sytems and compilers/tools - in a compiled method the variable name is turned into an address in memory;
then anywhere in the program that the variable name shows up the value at that address is inserted into the program to be used in
computations [or the address pointer is used -ie a pointer value into a table]. The compiler on the host has memory limits so that is
where the size of the variable name is limited, plus ease of searching (and readability in the source or output listing).
'
now for a web address AFAIK the url would be hard-coded into the program -- as it is treated as 'data value' The way the compiler is set
up on the host computer could have limits on its size. [ I would imagine the url would only be in one place in the target's memory and then
it would be 'pointed to' when it is referenced - the compiler would determine how to manipulate it ]
'
I don't have an ArmWeb to really know-but reading the forum answers -- it appears that there is the main compiled program that you
created along with an 'onboard' compiler that can take in dynamic data/program and be fairly interactive. I do believe most strings
are limited to 256 bytes(characters) though - a design trade off . Onboard memory is always an issue and a limited resource.
'
when you compile your program and download it to the target - ARMbasic reports some of your memory figures so you can have a
rough idea of how much you have left over for the dynamic/web side of things.
'
Hope this sheds a little info - it is light on specifics......Olzeke51
then anywhere in the program that the variable name shows up the value at that address is inserted into the program to be used in
computations [or the address pointer is used -ie a pointer value into a table]. The compiler on the host has memory limits so that is
where the size of the variable name is limited, plus ease of searching (and readability in the source or output listing).
'
now for a web address AFAIK the url would be hard-coded into the program -- as it is treated as 'data value' The way the compiler is set
up on the host computer could have limits on its size. [ I would imagine the url would only be in one place in the target's memory and then
it would be 'pointed to' when it is referenced - the compiler would determine how to manipulate it ]
'
I don't have an ArmWeb to really know-but reading the forum answers -- it appears that there is the main compiled program that you
created along with an 'onboard' compiler that can take in dynamic data/program and be fairly interactive. I do believe most strings
are limited to 256 bytes(characters) though - a design trade off . Onboard memory is always an issue and a limited resource.
'
when you compile your program and download it to the target - ARMbasic reports some of your memory figures so you can have a
rough idea of how much you have left over for the dynamic/web side of things.
'
Hope this sheds a little info - it is light on specifics......Olzeke51
Re: size of variable names and compiled code size
The symbol table (variable names, types and locations) is added to the compiled code for compiles with the ARMweb. However it is tacked onto an area of 4K in Flash above the code space.
So it does not subtract from code space available, but conceivably you could run out of symbol table space if all you variables look like thisisalongvariablenameforholdingthepriceofcheese.
But BASIC also truncates variable names to 32 characters, with the last one being a hash of the rest of the name.
So it does not subtract from code space available, but conceivably you could run out of symbol table space if all you variables look like thisisalongvariablenameforholdingthepriceofcheese.
But BASIC also truncates variable names to 32 characters, with the last one being a hash of the rest of the name.
Re: size of variable names and compiled code size
Thanks basicchip, thats what I imagined would be done, but wasn't sure.