I want to put some trivial code into the prologue of gcc (actually g++) compiled code. Reverse engineering the relevant file is, er, a bit tedious, and gcc won't build if I insert some testing code that makes it generate bad code (yes, I disabled the three-stage build), so I shall have to get it largely right first time. Is anyone familiar enough with this to help? What I want to do is to generate the equivalent of the following, preferably tuned to use only offsets from fixed registers: if (%sp < __stack_limit) __stack_trap(); This SHOULD be possible for two executed instructions in the normal case, and four generated instructions in all, but I can live with slower code for now. Examples of how to generate suitable instructions and so on are all I really need, or pointers to where I can look that up. Almost all the sources I have found are assuming that you are prepared to spend a lot of timing learning how to do a full porting job. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: nmm1@xxxxxxxxx Tel.: +44 1223 334761 Fax: +44 1223 334679