Nhập vào 2 số a và b. Tính tổng?
code segment
assume cs:code
org 100h
start:jmp over
tb1 db 'nhap a:$'
tb2 db 10,13,'nhap b:$'
tb3 db 10,13,'tong la:$'
over:
lea dx,tb1
mov ah,9
; lea dx,tb1
int 21h
mov ah,1
int 21h
mov bl,al
lea dx,tb2
mov ah,9
;lea dx,tb2
int 21h
mov ah,1
int 21h
mov cl,al
mov ah,9
lea dx,tb3
int 21h
add bl,cl
sub bl,30h
cmp bl,39h
jbe inra
sub bl,0Ah
mov dl,'1'
mov ah,2
int 21h
inra:mov dl,bl
mov ah,2
int 21h
int 20h
code ends
end start
assume cs:code
org 100h
start:jmp over
tb1 db 'nhap a:$'
tb2 db 10,13,'nhap b:$'
tb3 db 10,13,'tong la:$'
over:
lea dx,tb1
mov ah,9
; lea dx,tb1
int 21h
mov ah,1
int 21h
mov bl,al
lea dx,tb2
mov ah,9
;lea dx,tb2
int 21h
mov ah,1
int 21h
mov cl,al
mov ah,9
lea dx,tb3
int 21h
add bl,cl
sub bl,30h
cmp bl,39h
jbe inra
sub bl,0Ah
mov dl,'1'
mov ah,2
int 21h
inra:mov dl,bl
mov ah,2
int 21h
int 20h
code ends
end start
0 comments:
Post a Comment