/* * ===================================================================================== * * Filename: ASM-1.cpp * Environment: * Description: C++内联汇编实验二 * * Version: 1.0 * Created: 2013/10/30 21:24:15 * Author: yuliyang * * Mail: wzyuliyang911@gmail.com * Blog: http://www.cnblogs.com/yuliyang * * ===================================================================================== */ // ASM-1.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> #include <Windows.h> #include <stdio.h> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { DWORD32 c1,a1,b1; __asm { mov c1 ,ecx; mov a1 ,eax; mov b1 ,ebx; } /*printf("ECX的内容是:%X ",c1); printf("%X ",c1>>24); printf("EAX的内容是:%X ",a1); printf("%X ",a1>>24); printf("EBX的内容是:%X ",b1); printf("%X ",b1>>24);*/ char a[30]; sprintf(a,"%X,%X,%X",c1,a1,b1); MessageBox(NULL,a,"寄存器内容",0); return 0; }