Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 11th, 2006, 9:24 PM   #1
rsnd
Hobbyist Programmer
 
rsnd's Avatar
 
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4 rsnd is on a distinguished road
Visual c++ inline assembly

How do i stop vc++ from adding default inline codes at the start and end of functions?

e.g. my code
__declspec(dllexport) __stdcall XY(ST1*param1){
	__asm{
		mov ecx, 0x06;
		mov	esi, [param1];
		mov edi, [local1];
		rep movsd;
	}
}
gets converted into
 _XY@4:
  		push	ebp
  		mov	ebp,esp
  		push	ebx
  		push	esi
  		push	edi
  		mov	ecx,00000006h
  		mov	esi,[ebp+08h]
  		mov	edi,[L100075C0]
  		rep movsd
  		pop	edi
  		pop	esi
  		pop	ebx
  		pop	ebp
  		retn	0004h

I mean...i know it needs those...but i want to do them manually.
Thanks

win Xp, Visual c++ 6.0
__________________
Spread your wings and fly! Chicken!
rsnd is offline   Reply With Quote
Old Jan 23rd, 2006, 7:50 AM   #2
maro25
Newbie
 
Join Date: Oct 2005
Posts: 6
Rep Power: 0 maro25 is on a distinguished road
I am not sure, but I think you should change the calling convension and use something else
__________________
Password Spyer 2k: Password Recovery Software
My NEW SEO forum
maro25 is offline   Reply With Quote
Old Jan 23rd, 2006, 8:02 AM   #3
Polyphemus_
Expert Programmer
 
Polyphemus_'s Avatar
 
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 3 Polyphemus_ is on a distinguished road
Put _declspec(naked) in the declaration. Not sure how you can combine it with the _declspec(dllexport), maybe just by doing it .
Polyphemus_ is offline   Reply With Quote
Old Jan 31st, 2006, 6:36 PM   #4
rsnd
Hobbyist Programmer
 
rsnd's Avatar
 
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4 rsnd is on a distinguished road
kooooooooooolllllllllllllllllllllll thanks
__________________
Spread your wings and fly! Chicken!
rsnd is offline   Reply With Quote
Old Jan 31st, 2006, 6:49 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You could also write your code in an assembler and link it in, if you think you can roll your own correctly.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:16 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC