我必须将数字与0进行比较,如果它低于或等于0,我必须重新读取数字。我设计了一种在while条件之前读取数字的方法,但如果数字等于或小于0,则不会重新读取该数字,因为它应该遵循该方法。
我的代码看起来像这样
{
char number1[] = "Enter Number(>0):";
char format[] = "%d"; // format string for the scanf function
int number;
_asm
{
atat:
lea eax, number1// ask for the number
push eax
call printf
add esp, 4
lea eax, number// read it in
push eax
lea eax, format
push eax
call scanf
add esp, 8
//
while:
mov eax, number
cmp eax, 0
jg end_while
jmp atat
end_while: