Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!bturner From: bturner@hpcvlx.HP.COM (Bill Turner) Newsgroups: comp.windows.ms Subject: Re: Windows prolog/epilog Message-ID: <106580035@hpcvlx.HP.COM> Date: 23 May 89 16:57:00 GMT References: <1992@dataio.Data-IO.COM> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 25 > In examining the Windows prolog and epilog code for functions, it is: > prolog: > [deleted] > Can anybody explain what's going on with the DS manipulation, the NOP > and the inc and dec of BP? I suspect that the MOV AX,DS NOP is replaced > at runtime with a MOV AX,VALUE, but I can't figure the INC BP. I strongly suggest you read Petzold's "Programming Windows", Chapter 8 (Memory Management), especially the section on "How Windows Moves and Reloads Program Segments." First, I'll say "you don't want to know this..." But if you do want to know, Petzold is the only place I've seen a good, concise description of what's going on. (I was told by one of the Windows developers) This is basically stuff to handle the fact that in Windows the code segments may be moving (if the old BP value on the stack is odd, then this is a FAR call frame). The DS junk is dealing with the fact that data segments may also move, and that a single program may have multiple instances (multiple data segments). Read Petzold. --Bill Turner (bturner@hp-pcd.hp.com) HP Corvallis Information Systems