Creating custom DOS stubs for PellesC with Masm

Started by Vortex, March 20, 2008, 08:42:54 PM

Previous topic - Next topic

Vortex

Here is a PellesC demo built with a custom DOS stub. To create the 16-bit DOS stob, you need the 16-bit DOS linker.

.model small
.stack
.data

string  db 'This is a custom DOS stub.'
        db '$'    ; the DOS string terminator

.code

start:

    mov     ax,@data
    mov     ds,ax
    mov     dx,OFFSET string
    mov     ah,9
    int     21h
    mov     ah,04Ch
    int     21h

END start


\masm32\bin\ml /c CustomStub.asm
\masm32\bin\link16 /KNOWEAS CustomStub.obj


KNOWEAS is a special linker directive to mark an executable as DOS stub.

[attachment deleted by admin]