Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!bbn!mephisto!udel!gvlv2!gvlf1-c!markw From: markw@gvlf1-c.gvl.unisys.com (Mark H. Weber) Newsgroups: comp.sys.m68k Subject: Re: Code too Big to ROM - where do we optimize Message-ID: <590@gvlv2.GVL.Unisys.COM> Date: 26 Mar 90 15:08:46 GMT References: <5873@tekig5.PEN.TEK.COM> Sender: news@gvlv2.GVL.Unisys.COM Reply-To: markw@gvl.unisys.com Distribution: usa Organization: Unisys Defense Systems, Great Valley Labs, Paoli, Pa Lines: 19 In article <5873@tekig5.PEN.TEK.COM> barbaras@tekig5.PEN.TEK.COM (Barbara Ann Siefken) writes: >Our code is too big to ROM. Are there some assembly language >statements or processes that are known to take less space if >done another way? Is that simplifying the question too much. > One area to check would be the usage of macros vs. subroutines. A macro is expanded in place each time it is used, so there may be many copies of the same code being generated. A subroutine may be substituted for the macro so that only one copy of the code is generated. Unfortunately there is slightly more overhead in a subroutine call (pushing/popping things from the stack). Generally, macros are used to optimize for high speed, and subroutines are used to optimize for small code size. Hope this helps! Mark -- Mark H. Weber | Internet: markw@GVL.Unisys.COM Unisys - Great Valley Labs | UUCP: ...!uunet!lgnp1!gvlv2!markw Paoli, PA USA (215) 648-7111 | ...!psuvax1!burdvax!gvlv2!markw