flat assembler
Message board for the users of flat assembler.

Index > DOS > MAXMEM.SYS driver for M$DOS 7.1

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 414
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 04 Jun 2022, 12:23
I wrote a driver for M$DOS 7.1 which pretends to be QEMM and allows you to transfer some DOS data to UMB memory. After use, my system only uses 8KB of conventional memory. Compile/assemble source code using fasm.
Code:
;
; Maximum Memory Driver for QEMM's DOSDATA.SYS/DOS-UP.SYS
;
;My CONFIG.SYS (M$DOS 7.1) looks like:
;DEVICE=UMBPCI.SYS /I=D000-E7FF
;DEVICE=UMBM.EXE /I=D000-E7FF
;DEVICE=D:\QEMM\DOSDATA.SYS
;DEVICEHIGH=D:\QEMM\MAXMEM.SYS
;DEVICEHIGH=D:\QEMM\DOS-UP.SYS
;DEVICEHIGH=XMGR.SYS
;
        format  binary as 'sys'
;
; Device Driver
;
struc   InitRequest
{
.Length         db      ?
.Unit           db      ?
.Function       db      ?
.Status         dw      ?
.Reserved       rb      8
.Units          db      ?
.EndAddress     dd      ?
.ParamAddr      dd      ?
}

virtual at 0
InitRequest     InitRequest
end virtual

        dd      -1
        dw      0xC000
        dw      Strategy
MainDevInt      \
        dw      DevInt1st
MyNewMagic      \
        db      '$MAXMEM'       ;7 chars
Counter db      2               ;#2->#0

Strategy:
        push    es bx
        pop     [cs:CmdPtr]
        retf

DevInt: push    ds bx
        pushd   0xAAAA5555
label CmdPtr dword at $-4
        pop     bx ds
        mov     [bx+InitRequest.Status],0100h
        pop     bx ds
        retf

New2Fh: pushfw
        cmp     ax,$D200
JumpsA: jz      short IsD200
        cmp     ax,$D201
JumpsB: jz      short IsD201
Jmp2Fh: popfw
        jmp     0:0
label Old2Fh dword at $-4

IsD200: cmp     bx,5144h
        jne     Jmp2Fh
        cmp     cx,4D45h
        jne     Jmp2Fh
        cmp     dx,4D30h
        jnz     Jmp2Fh
        popf
        mov     al,-1
        mov     bx,4D45h
        mov     cx,4D44h
        mov     dx,5652h
        clc
        retfw   2

IsD201: cmp     bx,4849h
        jnz     Jmp2Fh
        cmp     cx,5241h
        jnz     Jmp2Fh
        cmp     dx,4D30h
        jnz     Jmp2Fh
if 1
        dec     [cs:Counter]
        jnz     @F
        mov     word [cs:JumpsA],9090h
        mov     word [cs:JumpsB],9090h
@@:
end if
        popf
        ;
        push    es
        mov     ah,52h
        int     21h
        mov     cx,[es:008Ch]   ;DOS 7.1/8.0 UMB
        mov     es,cx
        inc     cx
        add     cx,[es:3]
        pop     es
        ;
        mov     bx,4F4Bh
        xor     dx,dx
        clc
        retfw   2

Resident:

InitFunc:
        mov     ax,3000h
        int     21h
        mov     ax,8103h
        xor     dx,dx
        cmp     bh,-1   ;MS-DOS?
        jnz     .Exit
        push    cs
        pop     ds
        mov     [MainDevInt],DevInt
        mov     ax,352Fh
        int     21h
        push    es bx
        pop     [Old2Fh]
        mov     ax,252Fh
        mov     dx,New2Fh
        int     21h
        mov     ax,0100h
        mov     dx,Resident
.Exit:  ret

DevInt1st:
        pusha
        push    ds es

        lds     bx,[cs:CmdPtr]
        cmp     [bx+InitRequest.Function],0
        jnz     OtherCmd

        push    ds bx
        call    InitFunc
        pop     bx ds
        mov     [bx+InitRequest.Status],ax
        push    cs dx
        pop     [bx+InitRequest.EndAddress]
OtherCmd:
        pop     es ds
        popa
        retf    


Description:
Download
Filename: MAXMEM.7Z
Filesize: 46.64 KB
Downloaded: 522 Time(s)


_________________
smaller is better
Post 04 Jun 2022, 12:23
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.