Newsgroups: comp.lang.pascal Path: utzoo!utgpu!watserv1!maytag!watstat.waterloo.edu!dmurdoch From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Subject: Re: BINED.OBJ Message-ID: <1991Mar1.035549.11838@maytag.waterloo.edu> Sender: daemon@maytag.waterloo.edu (Admin) Organization: University of Waterloo References: <1991Feb27.153751.23339@rivm.nl> <1991Feb28.161534.26947@ms.uky.edu> Date: Fri, 1 Mar 1991 03:55:49 GMT Lines: 49 In article <1991Feb28.161534.26947@ms.uky.edu> fehr@ms.uky.edu (Jeffrey Davis) writes: >In article <1991Feb27.153751.23339@rivm.nl> pemmc@rivm02.rivm.nl (Mat Claessen) writes: >>Does anyone know a site from which I can FTP the file BINED.OBJ ? >>This is the assembler part of the binary editor, included with >>Borland's Editor Toolbox 4.0. The original version is not compatible >>with TP 6.0. >Post this info if possible. I, too, have that Toolbox and have been unable >to update and do not have Compuserve access. > >Will this be true of all those OBJ files people pass around? I wrote this to Mat, but it looks like it may be of general interest, even though it's rather vague information. First, there are no differences in the interface that will cause bug-free .OBJ files that work with 5.5 to stop working with 6.0. So what's the problem with BINED.OBJ? It's not bug-free. One of the routines in it (and I wish I could find the message I saw on Fidonet saying just which one it is) doesn't clean up the stack properly on return. This is a bug, but in TP 5.5, it didn't matter. Routines there always restore the stack pointer before they do a return, so the extra word(s?) on the stack didn't cause any trouble. However, one of the optimizations in 6.0 is to skip the restore of SP from BP when there aren't any local variables. This means that any routine that you call *must* remove its parameters from the stack properly, or the caller will crash when it tries to return. So, to fix this you have two choices: you can get the fixed up BINED.OBJ from Compuserve or elsewhere, or you can just make sure that when you call that buggy BINED routine you have local variables. This means adding var junk : integer; to the routine that calls into BINED. (I can't remember the name of it, either). You can find which routine is the bad one by tracing through a program using BINED until it crashes, or hoping that my posting will trigger someone's memory and the name will show up here. By the way, one of the plotting routines in the GRAPH3 unit has the same problem: it leaves one of its parameters on the stack. In this case I'm pretty sure it's the PLOT routine. Duncan Murdoch