80 likes | 370 Vues
Comparing three numbers. .model small .stack 100h .code main proc mov ax,@data mov ds,ax mov bl,10 mov cx,3 mov si,offset var1. Comparing three numbers. call get numbers call compare numbers call show numbers mov ax,4c00h int 21h main endp.
E N D
Comparing three numbers .model small .stack 100h .code main proc mov ax,@data mov ds,ax mov bl,10 mov cx,3 mov si,offset var1 Lecture 20
Comparing three numbers call get numbers call compare numbers call show numbers mov ax,4c00h int 21h main endp Lecture 20
Comparing three numbers get numbers proc agn1: mov ah,1 int 21h sub al,30h mul bl mov dl,al mov ah,1 int 21h sub al,30h add dl,al mov [si],dl inc si loop agn1 get numbers endp Lecture 20
Comparing three numbers compare numbers proc mov cx,2 agn2: mov al,var2 cmp var1,al jb l1 xchg var1,al mov var2,al l1: cmp al,var3 jb l2 xchg var3,al mov var2,al l2: loop agn2 compare numbers endp Lecture 20
Comparing three numbers show numbers proc show: mov dl,var1 mov ah,2 int 21h mov dl,var2 mov ah,2 int 21h mov dl,var3 mov ah,2 int 21h show numbers endp Lecture 20
Comparing three numbers .data var1 db 0 var2 db 0 var3 db 0 end main Lecture 20