Saturday, 2 March 2013

Visual Studio 2008-2010 - configure Assembly

1 . To configure on Visual Studio 2010
2. To congfigure on Visual Studio 2008
1 . To configure on Visual Studio 2010
x86 processor:
The visual studio 2010 will supports to build assembly code for  x86 processor  by macro ."_asm"





















  1. #include <Windows.h>
    #include <iostream>
    using namespace std;
    int GetValue()
    {
     _asm
     {
      mov eax ,100;
     }
    }
    int main()
    {
     cout<<" Call ASM :"<< GetValue()<<endl;
     return 0;
    }


x64 processor :


     picture 1: 
Picture 2 :
Picture 3 :
Picture 4 :
 Picture5

  1. #include <iostream>
    using namespace std;
    extern  "C" int getValueFromASM();
    #include <conio.h>
    int main()
    {
    cout<<" Assembly :" << getValueFromASM()<<endl;
    _getch();
    return 0;
    }
  
  1. .code
    getValueFromASM proc
    MOV eax , 2783
    ret
    getValueFromASM endp
    end

2. To congfigure on Visual Studio 2008 (Run as Admin)
resource  :link instruction
x64 processor
Picture 1 :
Picture 2 :
 Run Admin Picture 3 :
                                                                     Picture 4:                            
                                                                         ThongLT 3/6/2013  Ho Chi Minh City

No comments:

Post a Comment