;this program compares two numbers
;  VERSION 3
;input:  byte ptr 300h & 301h
;output:  in byte ptr 302h
;                          = 0 if they are equal
;                          = 1 if 300h > 301h
;                          = 2 if 300h < 301h
;
;
        mov     al, byte ptr 300h        ;get the input
        mov     ah, byte ptr 301h
        cmp     al, ah                   ;compare the two numbers
        je      equal                    ;they are equal (zero flag on)
        jb      less                     ; al < ah because carry is on
; else first is greater than second number
        mov     byte ptr 302h, 1
        hlt
less:   mov     byte ptr 302h, 2
        hlt
equal:  mov     byte ptr 302h, 0
        hlt
        end