; The program calls a proc to check if the square of the first
; two parameters equals to the square of the third (pitagoras)
; If yes, ax gets 1, otherwise ax gets zero, so it prints the
; correct message

IDEAL
MODEL small
STACK 20h
DATASEG

nopit         db  'No pitagoras$'
pit           db  'Pitagoras$' 

x             dw   4
y             dw   4
z             dw   5
CODESEG

proc          pitagoras
              push bp
              mov  bp,sp
              xor  dx,dx
              mov  ax, [bp+8]   ; x
              mul  al
              mov  dl,al
              mov  ax, [bp+6]   ; y
              mul  al
              add  dl,al
              mov  ax,[bp+4]    ; z
              mul  al
              cmp  al,dl
              jne  nopitag
              mov  ax,1
              jmp  endp1
nopitag:      mov  ax,0   
endp1:
              pop  bp 
              ret  6
endp          pitagoras


start:        mov ax, @data
              mov ds, ax

              ; your code here 
              push [x]
              push [y]
              push [z]
              call pitagoras
              mov   dx, offset nopit
              cmp   ax,0
              je    continue1
              mov   dx, offset pit
continue1:    mov   ah,9h
              int   21h
              mov   ah,2
              mov   dl,10
              int   21h
              mov   dl,13
              int   21h

exit:         mov  ax, 4c00h
              int  21h
END start  