home *** CD-ROM | disk | FTP | other *** search
-
- emm_int equ 67h
-
- if1
- INCLUDE model.mac
- endif
-
- header
-
- begdataseg
- EXTRN _EMSAvPgs :word
- EXTRN _emserr :byte
- enddataseg
-
- begcodeseg
- procstart __emsopen
- push bp
- mov bp,sp
- mov bx,WORD PTR [bp+4] ; get number of pages to allocate
- mov ah,43h ; Get handle and allocate memory function
- int emm_int ; Call EMM
- cmp ah,0 ; check for error
- jnz error
- mov _emserr,0 ; update emserr
- mov ax,_EMSAvPgs ; update EMSAvail
- sub ax,bx
- mov _EMSAvPgs,ax
- mov ax,dx
- jmp fini
- error: mov _emserr,ah ; update emserr
- mov al,ah ; return error code
- xor ah,ah
- fini: pop bp
- ret
- procend __emsopen
- endcodeseg
- END
-
-