Subject: Re: General Questions
To: Richard Ibbotson <richard@sheflug.co.uk>
From: D'Arcy J.M. Cain <darcy@NetBSD.org>
List: netbsd-help
Date: 10/22/2003 09:47:21
On Wednesday 22 October 2003 09:13, Richard Ibbotson wrote:
> Is there a DOS emulator that would allow one to use dos-based
> assembler, like TASM?

Absolutely.  I haven't used it for a while but when I was compiling DOS 
programs I used the Borland command line compiler and assembler from the Unix 
command line using doscmd from the pkgsrc tree 
(ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/emulators/doscmd/README.html) 
to run the commands.  I even created the following make (GNU make - not 
tested on BSD make) rules to handle this.  That way I can work entirely in 
Unix except for the actual command to compile, assemble or link.  Note that 
Borland command line utilities accept the Unix EOL convention so you can use 
your Unix editors and CVS/RCS/etc. utilities as well.

# MakeDos.inc
# Written by D'Arcy J.M. Cain
# Rules to build DOS executibles

TASM =      doscmd tasm
TLINK =     doscmd tlink
TLIB =      doscmd tlib
BCC =       doscmd bcc

ifndef  MODEL
MODEL = SMALL
endif

AMODEL =    -dAMODEL=$(MODEL)

ifeq    ($(MODEL), TINY)
    CMODEL =    -mt
endif

ifeq    ($(MODEL), SMALL)
    CMODEL =    -ms
endif

ifeq    ($(MODEL), MEDIUM)
    CMODEL =    -mm
endif

ifeq    ($(MODEL), COMPACT)
    CMODEL =    -mc
endif

ifeq    ($(MODEL), LARGE)
    CMODEL =    -ml
endif

ifeq    ($(MODEL), HUGE)
    CMODEL =    -mh
endif

TASMFLAGS = $(_TASMFLAGS) $(AMODEL)

.SUFFIXES:  .obj .exe .asm

.c.obj:
    $(BCC) $(DOSCFLAGS) -c $<

.obj.exe:
    #$(BCC) $(DOSCFLAGS) -e$@ $^ $(DOSLDFLAGS) $(DOSLIBS)
    $(BCC) $(DOSCFLAGS) $^ $(DOSLDFLAGS) $(DOSLIBS)

.c.exe:
    #$(BCC) $(DOSCFLAGS) -e$@ $^ $(DOSLDFLAGS) $(DOSLIBS)
    $(BCC) $(DOSCFLAGS) $^ $(DOSLDFLAGS) $(DOSLIBS)

.asm.obj:
    $(TASM) /mx $(TASMFLAGS) $<, $@

-- 
D'Arcy J.M. Cain <darcy@netbsd.org>
http://www.NetBSD.org/