org directive

SMarF at gmx.de SMarF at gmx.de
Wed Jul 5 01:00:09 PDT 2006


Hi there,

yes, DOS-COM-programs start at 100h, but I try to build my own EXE-header (no linker, just yasm -> bin and this bin should be an exe-file).

What I'm irritated is: why is the offset of msg not 0x0E, even after the org 0 directive?

Thanks again, Stefan

-------- Original-Nachricht --------
Datum: Tue, 4 Jul 2006 14:00:40 -0400
Von: Vikas Kumar <vikasnkumar at users.sourceforge.net>
An: yasm-devel at tortall.net
Betreff: Re: org directive

> Hi SMarF
> >>From what  I have read on the net, I think DOS programs start at "org
> 100h"
> 
> Vikas
> 
> On 7/4/06, SMarF at gmx.de <SMarF at gmx.de> wrote:
> > Hi there,
> >
> > trying to write my on DOS-EXE-stub, I tried the org directive in YASM
> (can't say enough "thank you" for this nice :) program!), but I don't get it
> run. Perhaps anyone can help me out or note this as a bug report:
> >
> > BITS 16
> > ;DOS-EXE-Header
> >     db 'M','Z'
> > .... ;some more header information
> >     dw 0
> > ORG 0 ;resetting offset from 40h to 0h
> >     push cs
> >     pop  ds
> >     mov  dx,msg              ;dx: offset of message to print
> >     mov  ah,009h             ;ah=09: print string
> >     int  21h                 ;DOS software interrupt
> >     mov  ax,04C01h           ;ah=4C: terminate program, al=01: errorcode
> >     int  21h                 ;DOS software interrupt
> > msg:
> >     db 'This program needs Win32',13,10,'$'
> >
> > After assembling with the latest snapshot (r1590) register dx is loaded
> with offset 0x4E instead of 0xE.
> >
> > Thank you for your help and your work, best regards
> > Stefan
> > --

-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the yasm-devel mailing list