[comp.sys.ibm.pc] Turbo Out of Memory Prob

sl118023@silver.UUCP (06/11/87)

Net Users,
     I am using Turbo Pascal 3.01A and I am running into an out of memory
error.  I have already used excessive overlays, written almost all strings
to disk, written a few subroutines in assembly, put large arrays on the heap,
and other basic code optimazation procedures.  I was wondering what other
things could be done to further reduced the size of my .com file.  An tips
in any way would be greatly appreciated.  The present size of the code is
70k, a little more than 6k too much.  Please either post ideas which may
be useful to all people, or e-mail ideas you do not feel worthy of posting.
Again, please respond with ANY useful tips.
          
                             Many thanks in advance,
                             Sean Connelly
                             sl118023@silver.bacs.indiana.edu  

unicorn@pnet01.CTS.COM (Rich Herzog) (06/13/87)

One counter-intuitive time-and-memory optimization is that for scalars,
n := Succ(n) ;
takes one less byte than
n := n + 1 ;
since it is implemented with an increment rather than an immediate add.
It you use 6000 of these you're home free ...

--rich

smvorkoetter@watmum.UUCP (06/14/87)

In article <1223@crash.CTS.COM> unicorn@pnet01.CTS.COM (Rich Herzog) writes:
|One counter-intuitive time-and-memory optimization is that for scalars,
|n := Succ(n) ;
|takes one less byte than
|n := n + 1 ;
|since it is implemented with an increment rather than an immediate add.
|It you use 6000 of these you're home free ...
|
|--rich

If "n" is an integer (as opposed to a byte), then using Succ() saves two
bytes.  So you'll only need to replace 3000 of them.