home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGASM.ZIP / PROG030.ASM < prev    next >
Assembly Source File  |  1988-04-10  |  1KB  |  26 lines

  1.  
  2. ;************************************************************************
  3. ; Determine amount of installed EGA memory using constants in segment 0 *
  4. ; Exit: AX - Number of KiloBytes installed                              *
  5. ;       64  =>  64KBytes                                                *
  6. ;       128 => 128KBytes                                                *
  7. ;       256 => 256KBytes                                                *
  8. ;************************************************************************
  9.  
  10.         PUBLIC  _Get_Memory_Size
  11.  
  12. _Get_Memory_Size PROC NEAR
  13.         PUSH    ES                      ;Preserve ES
  14.         XOR     AX,AX                   ;Move segment zero into ES
  15.         MOV     ES,AX
  16.         MOV     AL,ES:[BIOS_Equipment]  ;Fetch info byte
  17.         AND     AX,60H                  ;Isolate bit1 and bit2 and
  18.         MOV     CL,5
  19.         SHR     AX,CL                   ; move it onto bit0 and 1
  20.         INC     AX                      ; map 0-3 into 1-4
  21.         MOV     CL,6                    ;Convert to multiple of 64
  22.         SHL     AX,CL
  23.         POP     ES                      ;Restore ES
  24.         RET
  25. _Get_Memory_Size ENDP
  26.