首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

哪位高手会汇编,看这为啥老是冲突

2013-09-05 
谁会汇编,看这为啥老是冲突源文件的扩展名是C,不是CPP#include stdafx.h#includewindows.h#includetc

谁会汇编,看这为啥老是冲突
源文件的扩展名是C,不是CPP


#include "stdafx.h"
#include<windows.h>
#include<tchar.h>
#include<stdio.h>
#include<stddef.h>
int _tmain(int argc, _TCHAR* argv[])
{
char s,s1;
char sb=0,sb1[3];
int a=0;
//ZeroMemory(sb,1);
ZeroMemory(sb1,3);
s=s1='a';
_asm
{
mov ebx,0
mov eax,0
mov esi,dword ptr sb
mov al,[s1]
lods sb//换了几种方法都冲突
}

return 0;
}

[解决办法]
改过的程序如下:

#include<windows.h>
#include<tchar.h>
#include<stdio.h>
#include<stddef.h>
int _tmain(int argc, _TCHAR* argv[])
{
    char s,s1;
    char sb='A';
    char *p=&sb;
    char sb1[3];
    int a=0;
//    ZeroMemory(sb,1);
    ZeroMemory(sb1,3);
    s=s1='a';
    _asm
    {
        mov ebx,0
        mov eax,0
        mov esi,dword ptr p;
        mov al,byte ptr s1
        lods sb//换了几种方法都冲突
    }
 
    return 0;
}

热点排行