帮忙看那个程序,怎样改
题目是一个字符串中的数字字符放到NUM,大写字母放到BCHAR ,小写放到LCHAR,其他字符放到OTHER DATA SEGMENT
STRING DB '53Aa*#'
NUM DB ?
BCHAR DB ?
LCHAR DB ?
OTHER DB ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
LEA SI,STRING
AGAIN:MOV AL,[SI]
CMP AL,30H
JC L1
CMP AL,3AH
JC L2
CMP AL,41H
JC L1
CMP AL,5BH
JC L3
CMP AL,61H
JC L1
CMP AL,7BH
JC L4
MOV OTHER,AL
INC SI
JMP AGAIN
L1:MOV OTHER,AL
JMP NEXT
L2:MOV NUM,AL
JMP NEXT
L3:MOV BCHAR,AL
JMP NEXT
L4:MOV LCHAR,AL
NEXT:MOV AH,4CH
INT 21H
CODE ENDS
END START
我的思路是用 SI+1/2/3 循环去做,但是这样做好像不行,要用指针做吗?
[ 本帖最后由 沧声笑 于 2011-4-6 19:45 编辑 ]