MOV AH,09H MOV DX,OFFSET THONG_BAO INT 21H CALL XUONG_DONG MOV AH,09H MOV DX,OFFSET THONG_BAO1 INT 21H CALL KT_SO CMP AX,256 JA EXIT MOV N1,AX CALL XUONG_DONG MOV AH,09H MOV DX,OFFSET THONG_BAO2 INT 21H CALL KT_SO CMP AX,256 JA EXIT MOV N2,AX CALL XUONG_DONG MOV AH,09H MOV DX,OFFSET THONG_BAO3 INT 21H CALL TICH2SO CALL XUONG_DONG EXIT: MOV AH,4CH INT 21H ; TICH2SO PROC XOR AX,AX MOV AX,N1 XOR BX,BX MOV BX,N2 MUL BX CALL INSO RET TICH2SO ENDP ; KT_SO PROC PUSH BX PUSH CX PUSH DX XOR DX,DX MOV N3,0 MOV CX,1 LOOP_1: CALL NHAP_LAI CMP AL,0DH JE EXIT_2 SUB AL,30H XOR AH,AH MOV DX,AX MOV AX,N3 CMP CX,1 JE NOT_SUM_UP MOV BL,10 MUL BL NOT_SUM_UP: ADD AX,DX MOV N3,AX INC CX CMP CX,3 JA EXIT_2 JMP LOOP_1 EXIT_2: MOV AX,N3 POP DX POP CX POP BX RET KT_SO ENDP ; XUONG_DONG PROC PUSH AX PUSH DX MOV AH,02 MOV DL,13 INT 21H MOV DL,10 INT 21H POP DX POP AX RET XUONG_DONG ENDP ; NHAP_LAI PROC PUSH DX LOOP2: MOV AH,08 INT 21H CMP AL,0DH JE EXIT1 CMP AL,30H JB LOOP2 CMP AL,39H JA LOOP2 MOV DL,AL MOV AH,02 INT 21H EXIT1: POP DX RET NHAP_LAI ENDP ; INSO PROC MOV BX,10 XOR CX,CX N_ZERO: XOR DX,DX DIV BX PUSH DX INC CX OR AX,AX JNZ N_ZERO INSOLOOP: POP DX ADD DL,'0' MOV AH,02 INT 21H LOOP INSOLOOP RET INSO ENDP ; CSEG ENDS END BEGIN a.Chuyển một chuỗi . XUONG_DONG ENDP ; NHAP_LAI PROC PUSH DX LOOP2: MOV AH,08 INT 21H CMP AL,0DH JE EXIT1 CMP AL,30H JB LOOP2 CMP AL,39H JA LOOP2 MOV DL,AL MOV AH,02 INT 21H EXIT1: POP