home *** CD-ROM | disk | FTP | other *** search
- ;*--------------------------------------------------------------------*
- ;* DEMM -- This is a MicroSoft Assembler Version 4.00 program to *
- ;* read the Lotus/Intel/MicroSoft (LIM) Expanded Memory *
- ;* Manager Statistics and display them. *
- ;* *
- ;* Author: J.C. Weilandt II Date: 10-07-87 Last Update: 10-08-86 *
- ;*--------------------------------------------------------------------*
- extrn stdout:far ;declare stdout print char function
- extrn dec16out:far ;declare 16-bit binary to decimal
- extrn return:far ;declare standard DOS Exit
- extrn prtstr:far ;declare DOS Print String function
- extrn clrscr:far ;declare clear screen function
- extrn hex16out:far ;declare 16-bit binary to display hex
- extrn stdcrlf:far ;declare carriage return/lf output
- ;*--------------------------------------------------------------------*
- ;* Define Stack Segment Of 1024 Bytes (2 * 512) *
- ;*--------------------------------------------------------------------*
- stack segment para stack 'STACK' ;Declare stack segment
- dw 512 dup (?) ;Define stack space (1024 bytes)
- stack ends ;terminate stack segment
- ;*--------------------------------------------------------------------*
- ;* Define Data Segment (message holder) *
- ;*--------------------------------------------------------------------*
- data segment para 'DATA' ;Declare data segment
- abuff dw 512 dup (?) ;Define alloc map buffer
- mess0 db ' Weilandt Software International',0dh,0ah
- db ' Expanded Memory Manager Stats ',0dh,0ah
- db 0dh,0ah
- db ' DEMM.EXE Version 1.01 10-08-86 ',0dh,0ah
- db 0dh,0ah,'$'
- mess1 db ' --> Total Pages Expanded Memory',0dh,0ah,'$'
- mess2 db ' --> Free Pages Expanded Memory',0dh,0ah,'$'
- mess3 db ' --> LIM/EMM Version Number ',0dh,0ah,'$'
- mess4 db ' LIM/EMM Memory Manager Not Installed',0dh,0ah,'$'
- mess5 db ' --> LIM/EMM Page Frame Segment Address',0dh,0ah,'$'
- mess6 db ' --> Number of EMM Handles Allocated',0dh,0ah,'$'
- mess7 db 0dh,0ah
- db ' Expanded Memory Allocation',0dh,0ah
- db 0dh,0ah
- db 'Handle Number Of Pages',0dh,0ah
- db '------ ---------------',0dh,0ah,'$'
- mess8 db ' ','$'
- data ends ;terminate data segment
- ;*--------------------------------------------------------------------*
- ;* Define Code Segment *
- ;*--------------------------------------------------------------------*
- demm segment ;segment header declaration
- assume cs:demm,ss:stack,ds:data ;segment register assumptions
- main proc ;main procedure header
- mov ax,data ;get address of data segment
- mov ds,ax ;store address in segment register
- call clrscr ;clear the video screen
- mov dx,offset mess0 ;get address of welcome message
- call prtstr ;print the message
- mov ah,42h ;LIM Function code for Page Stats
- int 67h ;Issue LIM interrupt
- or ah,ah ;q.LIM/EMM Hardware OK ??
- jz next1 ; yes, continue
- jmp not_here ; nope, exit
- next1:
- call dec16out ;write out DX contents (total pg)
- mov dx,offset mess1 ;get address of total message
- call prtstr ;write out total message
- mov dx,bx ;load free pages num into DX
- call dec16out ;write out DX contents (free pg)
- mov dx,offset mess2 ;get address of free message
- call prtstr ;write out the free message
- mov ah,46h ;LIM Version Number Function Code
- int 67h ;Issue LIM interrupt
- or ah,ah ;q.LIM/EMM Hardware OK ??
- jz next2 ; Yes, continue
- jmp not_here ; Nope, error exit
- next2:
- mov bl,al ;save LIM Version Number
- mov cl,4 ;load number of bits to shift
- shr al,cl ;move high nibble to low
- add al,30h ;make number display
- call stdout ;write number out
- mov al,'.' ;load display period
- call stdout ;write out the period
- mov al,bl ;reload LIM/EMM Version Number
- shl al,cl ;move low nibble to high
- shr al,cl ;move it back (cleared of high)
- add al,30h ;make number display
- call stdout ;write number out
- mov dx,offset mess3 ;get address of version message
- call prtstr ;write out the version message
- mov ah,41h ;load get frame address code
- int 67h ;LIM/EMM Manager interrupt
- or ah,ah ;q.LIM/EMM Hardware OK ??
- jz next3 ; Yes, continue
- jmp not_here ; Nope, error exit
- next3:
- mov dx,bx ;move address to output regs
- call hex16out ;display the address
- mov dx,offset mess5 ;get address of segment message
- call prtstr ;write out the segment message
- mov ah,4bh ;load get frame address code
- int 67h ;LIM/EMM Manager interrupt
- or ah,ah ;q.LIM/EMM Hardware OK ??
- jz next4 ; Yes, continue
- jmp not_here ; Nope, error exit
- next4:
- mov dx,bx ;move address to output regs
- call dec16out ;display the address
- mov dx,offset mess6 ;get address of segment message
- call prtstr ;write out the segment message
- mov dx,offset mess7 ;get address of alloc map msg
- call prtstr ;write out the map message
- mov di,seg abuff ;get address of abuff
- mov es,di ;load extended segment register
- mov di,offset abuff ;load index pointer
- mov ah,4dh ;load EMM Function code
- int 67h ;LIM/EMM Manager interrupt
- or ah,ah ;q.LIM/EMM Hardware OK ??
- jz next5 ; Yes, continue
- jmp not_here ; Nope, error exit
- next5:
- mov cx,bx ;number of handles in counter
- mov di,offset abuff ;point to beginning of buffer
- abuffl1:
- push cx ;save counter registers
- mov dx,[di] ;load handle number
- call dec16out ;write out handle number
- inc di ;increment pointer
- inc di ;increment pointer
- mov dx,offset mess8 ;get space message address
- call prtstr ;write out the space
- mov dx,[di] ;load number of pages
- call dec16out ;write out number of pages
- inc di ;increment pointer
- inc di ;increment pointer
- call stdcrlf ;write a carriage return/lf
- pop cx ;restore counter registers
- loop abuffl1 ;process all array elements
- exit:
- mov ax,4c00h ;load DOS Terminate Code
- int 21h ;issue DOS terminate function
- not_here:
- mov dx,offset mess4 ;get address of error message
- call prtstr ;write out error message
- jmp exit ;go to termination processing
- main endp ;main procedure trailer
- demm ends ;segment standard trailer
- end main ;point at entry point (EOF Sysin)