From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JThVp-0004yb-7R for qemu-devel@nongnu.org; Mon, 25 Feb 2008 12:53:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JThVm-0004xu-RV for qemu-devel@nongnu.org; Mon, 25 Feb 2008 12:53:12 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JThVm-0004xr-JC for qemu-devel@nongnu.org; Mon, 25 Feb 2008 12:53:10 -0500 Received: from wr-out-0506.google.com ([64.233.184.236]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JThVm-0007eY-8R for qemu-devel@nongnu.org; Mon, 25 Feb 2008 12:53:10 -0500 Received: by wr-out-0506.google.com with SMTP id 50so2985232wra.18 for ; Mon, 25 Feb 2008 09:53:08 -0800 (PST) Message-ID: <761ea48b0802250953r4304df24m7528ecd4e30d7dea@mail.gmail.com> Date: Mon, 25 Feb 2008 18:53:07 +0100 From: "Laurent Desnogues" Subject: Re: [Qemu-devel] [ARM] add with PC in argument In-Reply-To: <47C169A0.1020705@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47C169A0.1020705@wanadoo.fr> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 2/24/08, claude vittoria wrote: > So in qemu I don't get the same comportement. The add of lr = pc + 4 > gives lr = pc + 8 into qemu. > I think that s->pc += 4 at start of disas_arm_insn alters the result. > Could you confirm ? > > 0x7c add lr, pc, #4 > 0x80 ldr pc, =SystemInterrupt > > 0x84 ldr r3, [sp, #PSR_OFF] <= never executed in Qemu > 0x88 msr spsr_cxsf, r3 @ put cpsr in SPSR > 0x8c ldmia sp, {r0-r15}^ @ restore Context The add lr,pc, #4 will put 0x88 into lr. As Daniel wrote, in ARM mode, when an instruction which address is addr reads the PC, it will read addr + 8. Given the mutekh link you provide has no source code for ARM (at least I couldn't find it), we can't guess where the ldr pc jumps to. Laurent