;**************************************************************
;***    XMS03.ASM                                           ***
;***                                                        ***
;***    function        XMS_Xms.globEnabA20                 ***
;***                        : Boolean;                      ***
;***                                                        ***
;***    Enables the A20 address line allowing 21 bit        ***
;***    addressing and access to the HMA                    ***
;***                                                        ***
;**************************************************************

        .model  large,pascal 

        include xmsdefs.asm 

        extrn   errno:WORD  
        extrn   xmsHandler:DWord

;
;   Define entry point
;
        public  XMS_Xms@globEnabA20

        .code

XMS_Xms@globEnabA20 proc    self:DWord

        mov     ah,XMSGlobEnabA20   ; Function code
        call    xmsHandler          ; call the guy

        or      ax,ax               ; AX=0 means error
        jz      errorReturn

        mov     ax,XMSErrOK         ; No error
        ret

errorReturn:
        mov     al,bl               ; Move error code to AL
        xor     ah,ah               ; Zero extend to 16 bits
        mov     errno,ax            ; Copy to errno
        ret

XMS_Xms@globEnabA20 endp            ; end of procedure

        end

