[汇编] 输入字符比较大小
菜鸟求教~要求用户输入单个字符 (比如+— */&¥ 等等),不是字符串哦。。。怎么读取这个字符额,,,
下面这个思路是不是完全不对?
要用到MOV AH,0AH INT 21H 嘛?
char message1[] = "Input a character: ";
char format [] = "%c";
char character;//假设用户只会输入+—*/中的某一个
_asm{
lea eax, message1;
push eax;
call printf;
add esp, 4;
lea eax, character;
push eax;
lea eax, format;
push eax;
call scanf;
add esp, 4;
mov eax, character;
cmp eax, 2Bh; //比较输入字符的asc码与+对应的asc码的大小
je label1;
jne label2;
...
...
}
return 0;
}