From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] Fresh (relatively speaking) Graphviz From: "Russ Cox" Date: Wed, 5 Mar 2008 13:00:54 -0500 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20080305180137.F41AA1E8C57@holo.morphisms.net> Topicbox-Message-UUID: 6f9ac45a-ead3-11e9-9d60-3106f5b1d025 cpu% cat getcallerpc.s TEXT getcallerpc(SB), $0 MOVL v+0(FP), AX MOVL -4(AX), AX RET > .globl getcallerpc > getcallerpc: > movl 0(%esp),%edx > movl -4(%edx),%eax > ret not quite. 0(%esp) is going to be the saved %eip. getcallerpc: movl 4(%esp), %eax movl -4(%eax), %eax or uint getcallerpc(void *a) { return ((uint*)a)[-1]; } russ