+ -
当前位置:首页 → 问答吧 → 内联汇编向int变量中输入字符报错的问题

内联汇编向int变量中输入字符报错的问题

时间:2011-11-21

来源:互联网

在VC内联汇编中,
myarray[]是个int型的数组
用循环来输入数组,以下是循环内的代码
C/C++ code
char inputformat[]="%d";

Assembly code

lea eax,myarray[ebx];    //
push eax;                //
lea eax,inputformat;    // achieve the number input
push eax;                //    
call scanf;                //
add esp,8;                //


输入数字都不会有问题,一旦输入字母,就会无限循环.请问如何处理这种问题啊?
谢谢各位汇编大神~

作者: hnjydtw   发布时间: 2011-11-21

你的循环是怎么写的?代码贴上看看

作者: wangliangffaflgh   发布时间: 2011-11-21