The MASM Forum Archive 2004 to 2012

Specialised Projects => Compiler Based Assembler => Pelle's C compiler and tools => Topic started by: Vortex on March 20, 2008, 08:42:54 PM

Title: Creating custom DOS stubs for PellesC with Masm
Post by: Vortex on March 20, 2008, 08:42:54 PM
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. (http://website.masm32.com/microsoft/Lnk563.exe)

.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]