Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Nhập vào 2 số có một chữ số
- ; Hiển thị tổng của 2 số đó
- .MODEL small
- .STACK 10h
- .DATA
- td1 DB 'Nhap so thu 1: $'
- td2 DB 0Ah,0Dh,'Nhap so thu 2: $'
- td3 DB 0Ah,0Dh,'Tong cua 2 so: $'
- .CODE
- main PROC
- MOV AX,@Data
- MOV DS,AX
- MOV AH,09h
- LEA DX,td1
- INT 21h ; 'Nhap so thu 1: '
- MOV AH,01
- INT 21h
- MOV BL,AL
- SUB BL,30h
- MOV AH,09h
- LEA DX,td2
- INT 21h ; 'Nhap so thu 2: '
- MOV AH,01
- INT 21h
- SUB AL,30h ; 'AL = so thu 2'
- ADD Bl,AL ; 'BL = AL + Bl = tong cua 2 so'
- MOV AH,09h
- LEA DX,td3
- INT 21h ; 'Tong cua 2 so: '
- MOV AH,02h
- MOV DL,BL
- ADD DL,30h
- INT 21h
- main Endp
- END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement