In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote: Jon, Thanks for the libraries. As the number of libraries is still small, let me make a suggestion. You enclose the library code in '{$ifused subname}-'{$endif} blocks which is good. You have grouped related subroutines in a single library file which is also good. Something that may become a problem when the number of libraries grows is the limited number of SUB declaration that sxb supports, the limit is 128 because all declared subs require 2 bytes in the lower half of codepage 0. Even if you only need TX_STR, the other subroutines still occupy entries in the subroutine jumptable. If you need to include more libraries as the program grows, this will quickly fill the jumptable. The way I resolve this is by using the '{$USES subname} directive that I place at the top of the main program file, before loading the xxx_DEF.SXB files. eg. '{$USES TX_STR} This informes the sxb compiler TX_STR is to be used so it reserves an entry for it. You then enclose the sub declarations like this: '{$ifused TX_STR} TX_STR SUB 2 ' transmit a string '{$endif} and enclose the subroutine in xxx_INC.SXB likewise: '{$ifused TX_STR} SUB TX_STR ENDSUB '{$endif} This saves jumptable entries. It still is not ideal, but with a single pass compiler probably the best way. regards peter ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=324057#m324088 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)