tag:blogger.com,1999:blog-1746745451277571533.post6640300941690261129..comments2024-02-17T12:36:21.608+05:30Comments on Computers, Technology, and Anything in Between: How to find address of stack top : Cosgeekhttp://www.blogger.com/profile/12045857609474816436noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-1746745451277571533.post-78414310638912929332009-09-12T07:55:50.819+05:302009-09-12T07:55:50.819+05:30How can find stack bottom?
or data section start a...How can find stack bottom?<br />or data section start and end?Amit Gnoreply@blogger.comtag:blogger.com,1999:blog-1746745451277571533.post-24824813113024276082007-06-11T13:35:00.000+05:302007-06-11T13:35:00.000+05:30the above code is not just C. it uses assembly ins...the above code is not just C. it uses assembly instructions!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1746745451277571533.post-51493706280594055542007-06-06T00:50:00.000+05:302007-06-06T00:50:00.000+05:30More accurate - at least for the Intel x86 series ...More accurate - at least for the Intel x86 series processors:<BR/><BR/>#include <stdio.h><BR/>int main(int argc,char* argv[])<BR/> {<BR/> unsigned int i;<BR/> __asm mov i, esp<BR/> printf("stack head: 0x%0X\n",i);<BR/> return 0;<BR/> }<BR/><BR/>The above code works with the Visual Studios 2005 VC++ compiler, and is for 32-bit software. 16-bit software would need to reference 'sp' (Stack Pointer) instead of 'esp' (Extended Stack Pointer); and 64-bit software would need to (a) change 'unsigned int' to a larger type (e.g. possibly size_t) and reference lsp (Long Stack Pointer).TemporalBeinghttps://www.blogger.com/profile/06247647473502902350noreply@blogger.com