;
; BOOLE.ASM - Sample API using menu functions.
;
; Fox Software System's Group
;
; Copyright (c) 1991 Fox Software, Inc.
; 134 W. South Boundary
; Perrysburg, Ohio  43551
;
; Description: This is an example of a boolean library function
;       which exclusively or's two numbers together and returns
;       the result.
;

            .MODEL large
            .STACK 16               ; need no stack of our own

;            %NOINCL
            INCLUDE pro_ext.inc

            .DATA

            PUBLIC  _myFoxInfo
            PUBLIC  __FoxTable

XOR_name            DB "XOR", 0
XOR_parmTypes       DB "I,I", 0

_myFoxInfo FoxInfo < XOR_name, _XOR, 2, XOR_parmTypes>

sizeof_myFoxInfo = $ - _myFoxInfo

__FoxTable FoxTable <0, sizeof_myFoxInfo/TYPE FoxInfo, _myFoxInfo>


            .CODE

MovParm MACRO reg, i, field

        mov reg, [2+i*sizeof_Parameter+bx.&field]
ENDM


_XOR PROC FAR

        push    ds
        push    bx

        mov     ds, dx                  ; ds:bx = &parm
        mov     bx, ax

        MovParm ax, 0, ev_long+2        ; ax := HiWord(parm->p[0].val.ev_long)
        MovParm dx, 1, ev_long+2        ; cx := HiWord(parm->p[1].val.ev_long)

        xor     dx, ax                  ; dx := dx XOR ax

        MovParm ax, 0, ev_long          ; ax := LoWord(parm->p[0].val.ev_long)
        MovParm cx, 1, ev_long          ; cx := LoWord(parm->p[1].val.ev_long)

        xor     ax, cx                  ; ax := ax XOR cx

        mov     bx, 10
        call    _RetInt                 ; _RetInt(dx:ax, bx)

        pop     bx
        pop     ds
        retf
_XOR    ENDP
        END