DOSBox for Linux

Today I installed DOSBox on Ubuntu in order to learn some Assembly and prepare for the oncoming exams.

First step:

sudo apt-get install dosbox

dosbox

First I needed to mount a drive using as location an already existing directory. So I made a directory called “dosprogs” in home folder and then ran in DOSBox environment:

mount D ~/dosprogs

D:

Files needed for compiling and debugging: debug.exe, tasm.exe, tlink.exe. I found those on the Internet and uploaded them here.

To automate this process even more so I don’t have to do it every time DOSBox runs, I changed the configuration file from ~/.dosbox by adding the following lines at the end of it:

mount D ~/dosprogs
D:
SET PATH=Z:\;D:\

To make my Assembly programming more pleasant I created a Batch script that runs the assembler, linker and executable file for me:

D:\TASM\tasm %1
if ERRORLEVEL 1 exit \B
D:\TASM\tlink %1
if ERRORLEVEL 1 exit \B
%1

Unfortunately the “exit” command will also close DOSBox even if I add ‘\b’ afterwards. I don’t know yet how to stop the execution of the script in case of error without also closing DOSBox so the script will actually look like:

D:\TASM\tasm %1
if ERRORLEVEL 1 echo Error
D:\TASM\tlink %1
if ERRORLEVEL 1 echo Error
%1

[UPDATE] Found the solution:

D:\TASM\tasm %1
if ERRORLEVEL 1 goto end
D:\TASM\tlink %1
if ERRORLEVEL 1 goto end
%1
:end

The last line I wrote in the DOSBox configuration file makes it possible to run this script from anywhere using:

make assembyFileName

The file should be sent without its extension (helloW.asm => make helloW).