Path: utzoo!censor!geac!torsqnt!tmsoft!masnet!canremote!stephen.dawson From: stephen.dawson@canremote.uucp (STEPHEN DAWSON) Newsgroups: comp.lang.pascal Subject: SWAP A RUNNING PROGRAM Message-ID: <421fb810bf262744bb24@canremote.uucp> Date: 17 Nov 90 01:23:00 GMT Organization: Canada Remote Systems Limited, Mississauga, ON, Canada Lines: 28 in a message from Zhou@brazil.psych.purdue. to All in the U-PASCAL conference was written... z.>I am planning to write a TSR program in the following way. I wonder z.>if anybody will comment on its feasibility: z.> (1) Interrupt a running program; z.> (2) Save all RAM content into hard disk; z.> (3) Run the TSR program; z.> (4) Upon finishing, load the original RAM content into the z.>memory. z.> (5) Return the control to the running program. Two points. 1) You must also save, and restore, all the register values in the CPU; and 2) the difficult part, make sure you do not interrupt while a DOS call is being processed, otherwise you will destroy DOS's stacks and corrupt the system. I don't have the specifications, but DOS sets some flags when you cannot interrupt; that's how PRINT works. STEPHEN ****************************************************************** stephen.dawson@canremote.uucp, Canada Remote Systems, Toronto. entered 11-16-90 at 8:23pm in Downsview, Ontario --- %a #3969