任意五个数字相加 要求判断 求助!!!!
程序代码:
这个是我做的 但是我不知道怎么回事输进去的数字相加错误 求解... DATA SEGMENT X DB 5 DUP(?) Y DB 5 DUP(?) Z DB 5 DUP(?) STR DB "Please input the string numbers$" DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX GO: LEA DX,STR MOV AH,09H INT 21H MOV SI,0 MOV CX,5 ;+++++++++++++++++++++++++++++++++++++++++++++++++++++ BG: MOV AH,01H INT 21H CMP AL,3O ;判断al减去30h是否大于等于0 JS GO ;小于0继续跳到输入BG CMP AL,3AH JNS GO SUB AL,3O MOV X[SI],AL INC SI LOOP BG ;+++++++++++++++++++++++++++++++++++++++++++++++++++++ MOV DL,2BH ;'+' MOV AH,02H INT 21H ;++++++++++++++++++++++++++++++++++++++++++++++++++++ BG1: MOV SI,0 MOV CX,5 ;+++++++++++++++++++++++++++++++++++++++++++++++++++ BG2: MOV AH,01H INT 21H CMP AL,30H JS BG1 CMP AL,3AH JNS BG1 SUB AL,30H MOV Y[SI],AL INC SI LOOP BG2 ;++++++++++++++++++++++++++++++++++++++++++++++++++ MOV DL,3DH MOV AH,02H INT 21H ;++++++++++++++++++++++++++++++++++++++++++++++++++ MOV SI,4 MOV CX,5 MOV AH,0 OPR1: MOV AL,X[SI] MOV BL,Y[SI] ADD AL,BL AAA MOV Z[SI],AL DEC SI LOOP OPR1 ;+++++++++++++++++++++++++++++++++++++++++++++++++++ SUB AH,0 JNZ OPR2 JMP OPR3 OPR2: MOV DL,AH ADD DI,30H MOV AH,02H INT 21H OPR3: MOV SI,0 MOV CX,5 FINAL: MOV AL,Z[SI] ADD AL,30H INC SI MOV DL,AL MOV AH,02H INT 21H LOOP FINAL JMP $ CODE ENDS END START ;+++++++++++++++++++++++++++++++++++++++++++++++++++