	.386

        .MODEL  flat, stdcall

MEMINFO         STRUCT

   present      DWORD   0
   nconvpg      DWORD   0
   reserved1    DWORD   0
   nextpg       DWORD   0
   extlim       DWORD   0
   aphyspg      DWORD   0
   alockpg      DWORD   0
   sysphyspg    DWORD   0
   reserved2    DWORD   0
   begaddr      DWORD   0
   endaddr      DWORD   0
   lasttime     DWORD   0
   numfault     DWORD   0
   numpage      DWORD   0
   numpager     DWORD   0
   numowned     DWORD   0
   swapsize     DWORD   0
   reserved3    DWORD   0
   minconpg     DWORD   0
   maxswap      DWORD   0
   pagefault    DWORD   0
   nfreepg      DWORD   0
   navailpg     DWORD   0
   maxmem       DWORD   0
   padding      DWORD   0

MEMINFO         ENDS


        .DATA


        .CODE


GETMEM PROC USES ebx edx, 
        pMEMINFO:PTR MEMINFO,
        RESET:BYTE
        
        sub     edx, edx
        mov     edx, pMEMINFO    
        mov     bl,  RESET
        mov     eax, 2520h
        int     21h     
        mov     ecx, pMEMINFO
        mov     eax, (MEMINFO PTR [ecx]).maxmem
        mov     ecx, 4096
        mul     ecx
        ret

GETMEM ENDP           
       END
