
;************************************************************************
; Using BIOS to determine amount of installed EGA memory                *
; Exit: AX - Number of KiloBytes installed                              *
;       64  =>  64KBytes                                                *
;       128 => 128KBytes                                                *
;       256 => 256KBytes                                                *
;************************************************************************

        PUBLIC  _BIOS_get_mem

_BIOS_Get_Mem PROC NEAR
        MOV     AH,12H                  ;Select function 12hex
        MOV     BL,10H                  ;       subfunciton 10hex
        INT     10H                     ;Call BIOS to get memory size
        MOV     AL,64                   ;Convert memory size in BL to
        INC     BL                      ; remap BL from 0-3 into 1-4
        MUL     BL                      ; a multiple of 64
        RET
_BIOS_Get_Mem ENDP
