3 bytes of overhead + eqn length Message #4 Posted by Paul Brogger on 1 Mar 2004, 9:14 p.m., in response to message #3 by bill platt
It appears that all program lines take at least three bytes, including the "placeholder" (or whatever) for an equation. The actual length of the equation, plus the three-byte program line entry is the memory cost of an equation in a program.
For example, if in PRGM mode, EQN enters equation mode, with the cursor on a new, blank program line. If I enter, say, 5 ENTER then the numeral 5 is entered as the equation. If I then look at MEM for the program, it will show the program using 4 bytes more than before.
If, however, in PRGM mode I simply type "5" and then look at MEM, it will show the program using fifteen bytes more than before.
If I do one after the other and scroll through them in PRGM mode, the only apparent difference between the program lines with the 4-byte EQN "5" and the 15-byte numeric "5" is the little "EQN" annunciator that flashes on when an EQN line is in the lower display area.
Execution time seems to be impacted by use of equations rather than numeric constants. (There's GOT to be a trade-off, right?) Each equation must have to be evaluated and stored as a numeric value on the stack. My test of 500 iterations through a "0" numeric and then through 500 "0" equations showed the latter took about 1/3 longer (15 seconds for the simple number vs. 20 for the equation).
(All of which tends not to matter much with 32K memory ... )
|