所以这是我的代码,我似乎无法想到我在哪里弄错了。我正在尝试做一个接受5位数字作为输入的练习,并告诉你这个数字是奇数还是偶数。如果数字超过5位,程序应该能够处理错误,并且有非数字字符作为输入。我仍然是汇编语言的初学者,几乎在谷歌的每个地方搜索,以回答每一步和功能
getNumber:
push offset msg ; put in to stack the effective addr of msg
call StdOut ; call console display API
push 100 ; set the maximum input character
push offset buffer ; put in to stack the effective addr of input storage
call StdIn ; call console input API
push offset input ; put in to stack the effective addr of msg2
call StdOut ; call console display API
push offset buffer ; put in to stack the effective addr of input storage
call compare
compare:
lea edx, [buffer]
mov al, byte ptr [edx]
cmp al,'/'
jle notNumber
cmp al, 'a'
jb notNumber
cmp al, 'z'
ja notNumber
cmp al,':'
jge notNumber
cmp al,30h
jge aNumber
ret
aNumber:
push offset aNum
call StdOut
call exit
notNumber:
push offset notNum
call StdOut
call exit
end getNumber