#include <stdio.h>

void main()

{

int a=98;

__asm

{

    mov al,a

    and al,11011111B

    mov a,al

}

printf("%c\n",a);

}

编译出现下面的错误:

--------------------Configuration: cc - Win32 Release--------------------

Compiling...

cc.cpp

D:\soft\VC\MyProjects\cc\cc.cpp(8) : error C2443: operand size conflict

D:\soft\VC\MyProjects\cc\cc.cpp(10) : error C2443: operand size conflict

Error executing cl.exe.



cc.exe - 2 error(s), 0 warning(s)

原因:

是编译出错。

类型冲突:

C/C++ code

?

1
2
3
4
5
6
7
8
9
10
11
12
#include   <stdio.h> 
void   main() 
int   a=98;     //int类型一般是32位,你把a定义成8位的 char型
__asm 
        mov   al,a  //因为这里你引用的是8位长的 al寄存器
        and   al,11011111B 
        mov   a,al 
printf("%c\n",a); // 这里也需要是char类型的参数

error C2443: operand size conflict的更多相关文章

  1. Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 64 bytes) in D

    Fatal error: Allowed memory size of 524288000 bytes exhausted (tried to allocate 64 bytes) in D 从数据库 ...

  2. Solution for Latex error: "Cannot determine size of graphic"

    I'm trying to include graphics in my Latex-file, which I compiled with latex+dvipdf on OS X. Latex h ...

  3. Fatal error: Allowed memory size of 8388608 bytes exhausted

    这两天安装bugfree,更换了一个数据量较大的库,结果打开bug详情页要么是空白页,要么就报如题的错误,错误信息还包括C:\wamp\www\bugfree\Include\Class\ADOLit ...

  4. Error response from daemon: conflict: unable to remove repository reference 解决方案

    由于前一章演示用的镜像没什么用准备删除 docker image rm hello-world:latest Error response from daemon: conflict: unable ...

  5. *** FATAL ERROR L250: CODE SIZE LIMIT IN RESTRICTED VERSION EXCEEDED

    *** FATAL ERROR L250: CODE SIZE LIMIT IN RESTRICTED VERSION EXCEEDED 在软件已经执行破解仍然出现,是因为工程是破解前建立的,要先执行 ...

  6. 解决访问 jar 包里面的字体报错:OTS parsing error: incorrect file size in WOFF header

    前言:jar 包里面的字体加载,浏览器 console 中报警告信息,这里记录一下解决方案. 附:自己的一个 jar 包源码 https://github.com/yuleGH/querydb 错误问 ...

  7. Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2611816 bytes)

    一段PHP程序执行报错: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 261181 ...

  8. error: Allowed memory size

    错误提示 error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 35 bytes) in D:\www\Th ...

  9. Double prefix overrides to provide 16-bit operand size in a 32/64 operating mode

    A processor supports an operating mode in which the default address size is greater than 32 bits and ...

随机推荐

  1. API equals方法 toString方法

    API  API: Application(应用) Programming(程序) Interface(接口)  不需要关心这些类是如何实现的,只需要学习这些类如何使用即可. equals方法 1.在 ...

  2. psecurity配置

    <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.spr ...

  3. 莫队算法 sqrt(n)分块思想

    在此说一下本渣对莫队算法思想的一些浅薄理解 莫队算法的思想就是对真个区间的分块,然后按照每块来分别进行计算,这样最终的复杂度可以达到n*sqrt(n) 小Z的袜子是一道非常经典的题目.:题目链接htt ...

  4. HBase与Sqoop集成案例

    HBase与Sqoop集成 案例:将RDBMS中的数据抽取到HBase中 Step1.配置sqoop-env.sh如下: Step2.在Mysql中创建一张数据库library,一张表book CRE ...

  5. App应用推广

    Android应用推广渠道: 360手机助手: http://dev.360.cn/ 应用宝: http://open.qq.com/ 百度手机助手: http://shouji.baidu.com/ ...

  6. 剑指offer——数组中出现次数超过一半的数字(c++)

    题目描述数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字.例如输入一个长度为9的数组{1,2,3,2,2,2,5,4,2}.由于数字2在数组中出现了5次,超过数组长度的一半,因此输出2.如 ...

  7. ssm+mysql 时间显示相差了12小时的问题 Gson

    怎么改时区,连接字符串加时区都无效,后来才发现原来返回的是对的,并不是时区问题. 后来感觉是gson问题,关键是在其他数据表并没有这个问题. 把 gson改成 Gson gson = new Gson ...

  8. 剑指offer第二版面试题10:斐波那契数列(JAVA版)

    题目:写一个函数,输入n,求斐波那契数列的第n项.斐波那契数列的定义如下: 1.效率很低效的解法,挑剔的面试官不会喜欢 使用递归实现: public class Fibonacci { public ...

  9. 拾遗:Git 与 Svn hook 不执行问题

    要点: GIT 或 SVN 的 hook 执行之前,会将所有环境变量清空,因此在其中执行命令时,必须指定绝对路径或重新设置必要的环境变量,如:$HOME 等 修改为正确的名称,如:post-commi ...

  10. 剑指offer——03二维数组中的查找

    题目描述 给定一个数组A[0,1,...,n-1],请构建一个数组B[0,1,...,n-1],其中B中的元素B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*...*A[n-1].不 ...