flat assembler
Message board for the users of flat assembler.

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

Thread Post new topic Reply to topic

Joined: 04 Sep 2009
Posts: 368
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.
; Maximum Memory Driver for QEMM's DOSDATA.SYS/DOS-UP.SYS
;My CONFIG.SYS (M$DOS 7.1) looks like:
        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

        push    es bx
        pop     [cs:CmdPtr]

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

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
        mov     al,-1
        mov     bx,4D45h
        mov     cx,4D44h
        mov     dx,5652h
        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
        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
        retfw   2


        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

        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]
        pop     es ds

Filename: MAXMEM.7Z
Filesize: 46.64 KB
Downloaded: 123 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.