;program to compare two numbers
; byte ptr 700h = input 1
; byte ptr 701h = input 2
; byte ptr 702h =  output = 1 if 700h < 701h
;                         = 2 if 700h = 701h
;                         = 3 if 700h > 701h
;
        mov     al, byte ptr 700h
        mov     bl, byte ptr 701h       ;get input
        sub     al, bl                  ;compare bytes, set flags
        je      equal                   ;zero flag on - therefore, equal!
        jb      less                    ;carry flag on - therefore al<bl
        ja      greater
        mov     byte ptr 702h, 0ffh
        int     20h                     ;can't get here!!!
; not less than, not equal, must be greater than!
greater:        mov     byte ptr 702h, 3
        int     20h
less:   mov     byte ptr 702h, 1
        int     20h
equal:  mov     byte ptr 702h, 2
        int     20h
        end