đề: tìm GTLN của 3 số có 1 chữ số
tiện thể giúp em cách tìm GTNN
tiện thể giúp em cách tìm GTNN
HTML Code:
.model small
.stack 100h
.data
f1 db 'nhap so thu 1:$'
f2 db 10,13,'nhap so thu 2:$'
f3 db 10,13,'nhap so thu 3:$'
f4 db 10,13,'so lon nhat la:$'
.code
main proc
mov ax,@data
mov ds,ax
;nhap so thu 1
mov ah,9
lea dx,f1
int 21h
;nhap vao
mov ah,1
int 21h
and al,0fh
xor cx,cx
mov cl,al
;nhap so thu 2
mov ah,9
lea dx,f2
int 21h
;nhap vao
mov ah,1
int 21h
and al,0fh
xor bx,bx
mov bl,al
;hien thi so thu 3
mov ah,9
lea dx,f3
int 21h
;nhap vao
mov ah,1
int 21h
and al,0fh
xor dx,dx
mov dl,al
;hien thi so lon nhat
mov ah,9
lea dx,f4
int 21h
;so sanh thu 1 va 2
cmp bl,cl
jg ht2 ;lon hon
jl ht1 ;nho hon
ht2: add bl,30h
mov ah,2
mov dl,bl
int 21h
jmp thoat
ht1: add cl,30h
mov ah,2
mov dl,cl
int 21h
;so sanh thu 2 va 3
cmp bl,dl
jg ht2
jl ht3
jmp ht1
jmp thoat
ht3: add dl,30h
mov ah,2
int 21h
;so sanh thu 3 va 1
cmp cl,dl
jg ht3
jl ht1
jmp ht2
jmp thoat
jmp ht3
thoat:
;tro ve dos
mov ah,4ch
int 21h
main endp
end main

Comment