8086 ASSEMBLY LEVEL PROGRAM TO ENTER 6(4 DIGIT)BCD NUMBERS THROUGH KEYBOARD AND DISPLAY THE RESULT ON CONSOLE


DATA SEGMENT
MSG1 DB 10,13,'ENTER THE NUMBERS:$'
MSG2 DB 10,13,'ENTERED NUMBERS ARE:$'
NEW DB 10,13,'$'
INST DB 50 DUP(0)
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,09H
INT 21H
LEA DX,NEW
MOV AH,09H
INT 21H
MOV CX,06
LEA SI,INST
UP:
MOV AH,01H
INT 21H
MOV [SI],AL
INC SI
MOV AH,01H
INT 21H
MOV [SI],AL
INC SI
MOV AH,01H
INT 21H
MOV [SI],AL
INC SI
MOV AH,01H
INT 21H
MOV [SI],AL
INC SI
LEA DX,NEW
MOV AH,09H
INT 21H
LOOP UP
LEA SI,INST
LEA DX,MSG2
MOV AH,09H
INT 21H
LEA DX,NEW
MOV AH,09H
INT 21H
MOV CX,06
UP1:
MOV DL,[SI]
MOV AH,02
INT 21H
INC SI
MOV DL,[SI]
MOV AH,02
INT 21H
INC SI
MOV DL,[SI]
MOV AH,02
INT 21H
INC SI
MOV DL,[SI]
MOV AH,02
INT 21H
INC SI
LEA DX,NEW
MOV AH,09H
INT 21H
LOOP UP1
INT 3
CODE ENDS
END START
END

Comments