tinhtong
.model small
.stack 200
.data
msg1 db 'a=$'
msg2 db 13,10,'b=$'
msg3 db 13,10,'nhap lai b de a+b<10'
msg4 db 13,10,'c=(a+b)/2'
; hin thi ket qua
.code
main proc
mov ax,@data
mov ds,ax
mov ah,9
lea dx,msg1
int 21h
mov ah,1
int 21h
mov bl,al
sub bl,30h
nhap:
mov ah,9
lea dx,msg2
int 21h
mov ah,1
int 21h
sub al,30h
add al,bl
cmp al,10
jl tinh
mov ah,9
lea dx,msg3
int 21h
jmp nhap
tinh:
shr al,1
add al,30h
mov bl,al
mov ah,9
lea dx,msg4
int 21h
mov ah,2
mov dl,bl
int 21h
mov ah,4ch
int 21h
main endp
end main
Bạn đang đọc truyện trên: AzTruyen.Top