|
A 2k element array wouldn't be that bad (I've done multi-million-element), but its the principle of wasting RAM unnecesarily. I gave up on conserving disk space long ago, but I'd like to try (for the sake of good software engineering) to find a balance for RAM and speed. As for the speed, a 2sx is 50Mhz, which makes me a little concerned about speed on older computers (especially laptops) due the increased overheard with translating the strings, providing a UI, and Windows hogging a big chunck of it.
I thought about just making the array big enough for the DATA commands, but then I'd still have to resize the array after a WRITE command, as this can be used to write data to a new location on the fly. Using a self-resizing array would still require some kind of indexing because there is nothing saying that DATA has to start at location 1 in eeprom. Either I'd have to use an array the size of the whole eeprom(at which point I may as well make my array 2k elements) to do mappings to my little array, or store the location with the data, at which point I'd have to loop through anyway. And that gets me thinking of my friend the binary search tree...
Anyway, as of right now, it loops through and finds all VAR/CON statements (since PBASIC doesn't care where you put them), so adding the DATA directive to the list should be easy.
Last edited by rbayer : 12-06-2002 at 17:30.
|