CompuServe Messages

#Small code

    09-Dec-87 17:14:33
Sb: #97502-#Small code
Fm: Glenn Nielsen 75115,444
To: Paul Montgomery 71500,3525
Paul, Here are some things I do to limit size of executables with Lattice 4.0. This in no way encompasses all ways of reducing code size, but it's a start. 1. If you don't want the stack checking code or the features of the lattice stdio functions, you can link with AStartup.obj instead of c.o. In order to do this, you need to: a. Remove <lattice/stdio.h> include from your source code. b. If you need to use the limited stdio features of Amiga.lib then declare extern LONG stdin, stdout, stderr; c. Compile with the -v option of LC. d. Link with AStartup.obj instead of c.o and list Amiga.lib first in your list of libraries. NOTE: If you have the 1.2 Dev update, look at the doc file in the startups dir. Also, check out the limited features for doing stdio with Amiga.lib. 2. You can also use PC relative addressing ( -r compiler option ) for smaller programs. 3. For small programs you can use the SC option of the linker to combine all code hunks into one. This will reduce the size of the resulting executable file. I haven't had a chance yet to play with Base register relative data addressing (-b compiler option) or the short integers (-w compiler option) features of 4.0 yet. <Glenn