.model small .data r1 db "enter first number","$" r2 db "enter second number","$" msg db "the sum is","$" nl db ,0dh,0ah, "$" n1 db ? n2 db ? sum db ? max db ? oneg db "number one is grater" , "$" twog db "number two is grater" , "$" equal db "number two an one are equal" , "$" maxstring db "max number is" , "$" .stack 200 .code .startup x: lea dx,nl call printstring lea dx,r1 call printstring mov ah,01h ;read char int 21h ;char will be in al sub al,30h mov n1,al cmp al,0 jg test1 jmp x test1: cmp al,9 jl go jmp x go: lea dx,nl call printstring lea dx,r2 call printstring mov ah,01h int 21h sub al,30h mov n2,al mov bl,n1 add bl,n2 mov sum,bl lea dx,nl call printstring lea dx,msg call printstring mov ah,0 mov al,sum ;(00000000 00001100) --> (00000001 00000010) aam ; ax/10 --> ah ax%10 -->al ( ax =12)--> (ah=1, al=2) mov bx,ax mov ah,02h ; print char mov dl,bh add dl,30h int 21h ;print 1 mov ah,02h mov dl,bl add dl,30h int 21h ;print 2 mov bh,n1 mov bl,n2 lea dx,nl call printstring cmp bh,bl ; if bh > bl then n1g else ... jg n1g je le lea dx, twog call printstring mov max,bl jmp l2 n1g: lea dx,oneg call printstring mov max,bh jmp l2 le: lea dx, equal call printstring mov max,bh l2: lea dx,nl call printstring lea dx,maxstring call printstring mov ah,02h mov dl,max add dl,30h int 21h jmp quit printstring proc mov ah,09h int 21h ret printstring endp quit: .exit end