Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


assembly in Visual c/c++

This topic is 5899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am looking for a tutorial for assembly in visual c/c++ that uses assembly. I know VERY SIMPLE assembly instructions ...but I want to learn more. I can''t find any tutorials using assembly in visual c++ anywhere. I think this will not work...I want to add asmb to assm and then output the results(I can do the output stuff). if(g_keys->keyDown[''S'']) //use ''s'' to do this asm function { _asm //this is or is not inline?? { mov edx,a //make edx ==a ??? mov edi,b //make edi ==b ??? add edi,a //add b+=a ????? } } Basically I want the (a) added to the (b) and then to output the results. I know this is VERY SIMPLE...but I am new to assembly. By the way I am buiding a Shadow Engine using the assembler.I need it to use assembly instructions(very fast!!!).

Share this post

Link to post
Share on other sites
Why move ''a'' into EDX if you are going to add EDI to ''a''?
Also, I''d use general purpose registers to add with, like EAX, EBX and ECX.
I''d also push and pop ECX before and after I alter any values in the ECX register and I''d move the result of the add operation into a value that can be returned.

Like this:

__asm {

I think that is right. Return ''r'' as the result.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!