inline assembly problem.

Hello.

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//
//	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.
	ret
}}


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 with the stack. I can change the esp with an add, lea or a pop.

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.

Thanks
Last edited on
Registered users can post here. Sign in or register to post.