新手请教高手指点迷津
题目是:1、 编写程序实现下面的算法:
if
then
lowerCount+1;
else
if(ch≥’A’) and (ch≤’Z’)
then
upperCount+1
else
otherCount+1;
endif
endif
其中ch调用ReadChar输入,lowerCount, upperCount和otherCount的值用WriteUDecByte显示。
我自己写的怎么都通不过:
.386
.MODEL FLAT,stdcall
INCLUDE io.h
include include\io32.inc
INCLUDElib lib\kernel32.lib
ExitProcess PROTO NEAR32 stdcall,dwExitCode:DWORD
cr EQU 0dh
Lf EQU 0ah
.STACK 4096
.DATA
prompt1 BYTE "Please enter the ch:",0
lowerCount DWORD ?
upperCount DWORD ?
otherCount DWORD ?
char1 BYTE 5 DUP (?)
.CODE
_start:
mov lowerCount,0
mov upperCount,0
mov otherCount,0
output prompt1
ifpos:ReadChar char1
cmp char1,61h
jl thenpos
cmp char1,7Ah
jg thenpos
add lowerCount,1
jmp endifpos
thenpos:cmp char1,41h
jl elseifpos
cmp char1,5Ah
jg elseifpos
add upperCount,1
jmp endifpos
elseifpos:add otherCount,1
endifpos:
WriteUDecDword lowerCount
WriteUDecDword upperCount
WriteUDecDword otherCount
INVOKE ExitProcess,0
PUBLIC _start
END _start
拜托高手帮帮忙(注明哪错了,什么原因)