Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Thread Tools Search this Thread Rate Thread
Old 08-Aug-2014, 10:52
steamerandy steamerandy is offline
New Member
Join Date: Aug 2012
Posts: 27
steamerandy will become famous soon enough

Debug problem with inline assembly


I am having a VS 2010 debug problem. It seams to think it is wrong to pop things off the stack.

I had to switch to VS 2010 and now am having with problems with inline assembly code.

Some instructions that change the stack pointer are causing an exception. It seams to be any
that pop things off the stack.

CPP / C++ / C Code:
//	mov	eax,<node>
//	call	_node
__declspec(naked) void _node() {_asm {

	push	eax			// push node name string ptr
	mov	eax,sznodeh+szptr	// size of node object
	push	eax
	call	malloc			// allocate a node
	lea	esp,[esp+szinta]	// remove alloc size
	lea	eax,[eax+sznodeh]	// object*
	mov	PtrObjTyp_a,_TYP_node	// Set type
	pop	dword ptr [eax]		// drop in name ptr
	mov	ebx,NodePtr		// puting node on node stack
	lea	ebx,[ebx-szptr]         // adjust stack ptr
	mov	NodePtr,ebx		// ....
	mov	[ebx],eax		// Put node pointer on stack.

In the above the lea instruction is causing a "0xC0000005: Access violation".

Tried "pop ecx" same problem.

I was using CodeWorrior but it is now having problems on Windows 7. It is getting a random "unknown error" when starting a debug session. But when it does work I do not have any problems. I can change the esp with an add, lea or a pop instruction.

Is there anyway to disable this exception in VS 2010. Does 2013 have have the same problem?

Is there another debuger that will work on a windows 7 64 bit AMD processor.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats wrong with C++ steamerandy C++ Forum 3 16-Jul-2013 04:42
problem: assembly language (intel 8088/8086) fearsking Assembly Language 0 22-May-2012 18:59
Another FX 5600 problem (but with details that might shed light on this) BobDaDuck Computer Hardware Forum 2 16-Apr-2004 07:53
Inline Assembly language mikhail Assembly Language 7 22-Mar-2004 10:06

Network Sites: GIDNetwork · GIDApp · GIDBlog · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 08:48.

vBulletin, Copyright © 2000 - 2018, Jelsoft Enterprises Ltd.