Would this be a reasonable (if not accurate) technique to determine length of code snippet ?
For example my code snippet is a function called myISR().
step-1) place the code snippet in myISR() and compile in Arduino IDE. Note the no. of bytes reported for "Binary sketch size:", say it is X bytes.
step-2) comment out the code snippet in myISR() and compile again. Note the no. of bytes reported for "Binary sketch size:", say it is Y bytes.
step-3) the length of the code snipped is (X - Y) ?
I suspect that this is over simplification. Since I have some strings that I print using Serial.println(), I am guessing that those go into the static data segment, and not the entire chuck of (X-Y) are instructions, right ? Can, I then make an assumption that 90% would be instructions, and all of them a 1-byte instructions, with an avg. 2 clock/cycles per instruction ?
Of course, if there is a precise deterministic way, that doesn't involve JTAG/ICE, would be great.