Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!hollie.rdg.dec.com!decuk.uvo.dec.com!nntpd.lkg.dec.com!jareth.enet.dec.com!edp From: edp@jareth.enet.dec.com (Eric Postpischil (Always mount a scratch monkey.)) Newsgroups: comp.sys.handhelds Subject: Re: HP48SX: How much room needed to edit? Message-ID: <23317@shlump.lkg.dec.com> Date: 10 Jun 91 13:33:05 GMT References: <1991Jun8.225931.16298@nntp-server.caltech.edu> Sender: newsdaemon@shlump.lkg.dec.com Reply-To: edp@jareth.enet.dec.com (Eric Postpischil (Always mount a scratch monkey.)) Organization: Digital Equipment Corporation Lines: 32 In article <1991Jun8.225931.16298@nntp-server.caltech.edu>, tim@nijinsky.ipac.caltech.edu (Tim Conrow) writes: > Could someone please briefly describe what happens when the hp48 >edits a large object, particularly wrt how much room is needed? > This request is prompted by the following: I have a 2442 byte program >object. With >9k available in the calc I got an "insufficient memory" >message upon hitting ENTER after editing the program (I only made a 1 >character change). Caveat: I have not looked at the code; the following is from my own knowledge of software engineering. Consider what happens when you edit a program. First, there is a copy of the program in memory. Then, the 48 must create an ASCII representation of the program -- taking all the internal codes and changing them into S I N for SIN, or whatever else is in your program. You say your program is 2442 bytes, but how many bytes does it take to represent it in ASCII? This could well be thousands of bytes larger than the program itself, using up most of the remaining 9 kilobytes. Then when you press ENTER, the 48 must parse the ASCII string while building a new program object -- with the ASCII string and the old object still in memory. Programs should not be so large. You should break it into subroutines, so that they can be edited (and designed and conceived of) as parts. If you can transfer the program to another computer, you can edit it there and send it back in parts. -- edp (Eric Postpischil) "Always mount a scratch monkey." edp@jareth.enet.dec.com