Date: Mon, 6 Oct 1997 18:50:30 -0700 (PDT) Message-Id: <199710070150.SAA24301@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: martsobm AT uv DOT es (Marsel), djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Assembler question Precedence: bulk At 03:03 10/6/1997 GMT, Marsel wrote: >Hi, > Can I get the address of the program counter in a C program ? I don't think there's a good way to do it directly from C, but you can do it with external assembler, I.E. NASM. Note that this is not tested.: -- file getip.asm -- [GLOBAL _getip] [SECTION .text] _getip: mov eax,[esp] ; get the address that was pushed by the parent's CALL ret -- file getip.h -- unsigned getip(void); Nate Eldredge eldredge AT ap DOT net