From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4C41D2A6.7080402@bouyapop.org> Date: Sat, 17 Jul 2010 17:56:22 +0200 From: Philippe Anel User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 MIME-Version: 1.0 To: 9fans@9fans.net References: <16b49e4e76df857990ac9dedae73c171@9netics.com> <4C41C578.5080007@bouyapop.org> In-Reply-To: <4C41C578.5080007@bouyapop.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [9fans] acid question Topicbox-Message-UUID: 4003fce0-ead6-11e9-9d60-3106f5b1d025 This one sounds like to work (except it does not save registers) ... defn call(addr) { local pco; // we need stack space, and thus process stopped. if status(pid) != "Stopped" then { print("Waiting...\n"); stop(pid); } // Backup orginal instruction pco = fmt(*PC, bpfmt); // Put a temporary breakpoint **PC = bpinst; // update stack pointer *SP = *SP - 4; // make called function returning to this point **SP = *PC; // set PC to function to call *PC = addr; // do the call startstop(pid); // restore original instruction *PC = pco; } Phil;