Run MASM 8086 Assembler in Ubuntu or Windows 7(x64) using DOSBox
Here’s how to run 16 bit DOS executables like the MASM assembler or Turbo C compiler in Ubuntu (GNU/Linux) or in 64 bit editions of Windows 7 using DOSBox, a DOS environment emulator. DOSBox is available for Linux as well as Windows.
DOSBox installation
For Ubuntu users (using repository)
Open the terminal and type in the following commands to download and install DOSbox in Ubuntu
sudo apt-get update
sudo apt-get install dosbox
You will find it installed under Applications_Menu->Games->DOSBox Emulator
For other GNU/Linux users
Download DOSbox from here.
Open terminal and cd to the directory containing the downloaded tar.gz file. Type in the following commands to build and install :
tar -xzvf dosbox-0.74.tar.gz
cd dosbox-0.74
./configure
make
Check the src subdir for the binary.
For Windows users
Download DOSbox from here.
Run the downloaded .exe file and install it like any other software.
Now that you’ve installed DOSBox, you’ll be able to run any 16bit or 32bit DOS executable inside it.
Download the 8086 MASM Assembler from here. The zip file contains the following files :
masm.exe, tasm.exe, link.exe, bin2hex.exe, exe2bin.exe, td.exe, edit.com and debug.exe
Windows users extract the .zip file into C:\ so that the path C:\8086 contains all the above mentioned files. GNU/Linux users can extract it and place it in say /home/prashanth/8086
Launch DOSBox and type the following commands :
For Linux users :
mount c /home/prashanth/8086
c:
For Windows :
mount c c:\8086
c:

DOSBox running in Ubuntu
Now the contents of the folder /home/prashanth/8086 or c:\8086 is mounted as c: drive inside the DOS emulator. You can assemble programs inside DOSBox as you do in your Microprocessor Lab under Windows XP; i.e your usual sequence of commands -
edit file.asm
masm file.asm
link file
debug file.exe
When you are done, type exit to quit DOSBox.
P.S : For GNU/Linux users, there’s an alternative assembler known as the NASM. NASM is considered to be one of the most popular assemblers for GNU/Linux.
Downloads :
DOSBox for Linux : dosbox-0.74.tar.gz
DOSBox for Windows : DOSBox0.74-win32-installer.exe
8086 Assembler : 8086_Assembler.zip


Awesome! Link added to the article on my blog!
Thnx alot! much appreciated. .
its run ok………but while debbuging using f8……..its not showing line………..and color also not same.
Hi… gud info buddy…
i guess u won’t be able to run a program on c or c++ using dos box .74 on a 32 bit or lower machine…there ll be a object code errror in the same…
can some one help me by telling the procedure to view the code after
edit xyz.asm ; and writing the code
save it
masm xyz;
link xyz;
xyz
then i m not able to find the code view window
thanx a lot. Very helpful it was.
Hello,
The window gets stuck after i use the “g” (Go command under DEBUG). I cannot type anything nor do i get an output. Please help me out!
P.S. Brilliant stuff
@Anil
Umm..no, it doesn’t, at least on my side. I get a “Program terminated normally” response.
Thanks!! Saved me from the trouble of installing xp on virtual box.
thank u very much man!!!!!!!i got it run on my w7!!!!!thank u very much!!!!!
Thanks a ton!….
Thnx….
Works absolutely Fine…
Added the link…
dude help me out ….wats the equivalent command for cv/p after
edit filename.asm;
masm/zi filename.asm;
link/co filename.obj;
“”"”cv/p filename “”"”"”"not working….saying cv isillegal command….
someone plzz help me out…
how to check the output ….like suppose if we have written a code….for printing a msg ….how to see that ???
How to go to the output window?
Thank you!! I will add this link to an article on my blog!!
Thanks a lot…….it works very well…….
Thnx a lot dud…..
Just how do we see the output of our asm? It only debugs errors. How? Thanks.
dosbox window does not display anything here in my computer , please help
respected sir,
how to edit assembling programing and how to compile it
this software dosnt support 64bit w7.. pls help…
good
very good
How to see the output window?
guys how i have run the prog of 8086
wen i tried to run it shows nthng
still no errors
plzzz help..
Thanks a lot! very helpful.
thanks for ur help…
it’s show error .exe file not found plz tell me any solution
i am not getting output when i type
debug file.exe
its not working
thanks a lot….
error a2105:expected : instruction or directive..
i think .code and .exit are shown as errors..
wat am i supposed to do??
pls help
why cant i use cv filename.exe ……………… it says that cv can’t be used ………..
my hello.exe file isnt running on win 7… when ever i write hello.exe.. my Dos Box closes. n if i try to open up my hello.exe manually it gives an error
“Write falut writing error PRN”"
some thin like dat.. kindly help me
thanks you very much!!! It really helps me!
thanks
i want the command which should b writen on the dos box window soo it starts 2 mount d c drive
well this is good but the only problem is that debug doesnt work
reply to this qstn….
what to do if there is extended error 2…
after debug command
im gettin an error sayin io.h file not found
can u please help to resolve this issue
How do run tasm in this? please help….
thanx for the stuff buddy……..
kindly help me for my error,
i tried to include a .mac file in the program with the path
include c:\8086\read.mac in the program
but still it is giving error the file not found (the file is there in the folder)
howto run the program in massm give me
commands
hay.. everyone….
when i had tried for code viwer for detaild view and allocation of data in registers.. it said the code i used is illegal.. the code was “cv file name.exe”…. how to get code viewer.. plz help me out..
thnx… with regards .
thanks a lot!!
thanks prashanth
please tell how to debug and run the program
‘g’ command is not working
please help me…how to debug
What is the equivalent command for cv ? please reply asap.
What is the commmand to execute the program?
Thanks! Was very helpful.
thank u so much
it helped me a lot………….also to the users who r not able to see the output…here is the suggestion…….
type
masm filename.asm;
link filename.obj;
debug filename.exe
after this press ” t ” n enter……ur memory window opens n repeat the process for further steps
press “t” n press enter after the debug
am nt able to terminate the program….after the total execution of the program am nt able to exit it….help me out some1
Thanks man…..
thank u very much ……………
thanks bro for helping me in working on masm in windows 7
Guys who are facing the problems with CV command here is the solution
-Download cv.exe from online and paste it in the 8086 folder
u vil get the same o/p as u see in the lab though the graphics is a bit different
but much better than using the debug command
Hope it helps you out
thank u vry much 4 supporting…….
good work….thanks for sharing this info dude….
while running a progarm im getting an error 2000: stack overflow why im getting this error?and how can rectify this?
hey guys, memory window doesn’t open at all.
also on 32-bit windows there’s a command “cv file_name” after “link file_name”. doesn’t work here??
help me out please (i tried pressing “t” after debug command and enter,but then no separate memory window opens)
Is there any way to use masm on windows 7 64 bit… please mention
Is there any way to use masm assembler on windows 7 64 bits…
HEY ROHIT,
after copying cv.exe into 8086 file when i give cv command it is showing cannot run in dos mode..
what shud i do??
hello sir how u prepared emulated turbo c++ can we bulid emulated masm to run it on windows 7 64bit os?
hey pls anyone help……
after typing edit file.asm ,it is showing illegal command edit
what to do .pls tell
thanx man….
really gud share…..
cannot debug :error 2 heeelp
(((
I am not able to change directory or open any file. Windows 64 bit. Please help.
thanks bro….
but command -t is not working…..
Pai mamu, masth thanx.. thanx a lot!!
try this command TD file.exe it may help…
@Krithika
type
z:\>mount c c:\8086
c:\>edit file.asm
@arun
mount c c:\8086
c:
edit file.asm
I am Bangladeshi
close ur computer
i’m nt to change directory. it is saying directory does not exits.
pls tel how to change my computer name.
mine is a 32 bit Ubuntu UE 3.0
I’m not able to change directory in Dosbox. what to do. plsss help
thank u very much…earlier i use to run win95 in dosbox to access debug option but this solution has made it more simple..thanks a lot
please help . it says program not found
how to run ?
am gettin a EXTENDED error aft i debug even though i fin get it durin the masm file.asm; part of compiling……… anybody HELP !!!!!!!!!!!!!!!!! i hv got exams tom ……..plzzzzzzzzzzzzzzzzz
I use windows 7(x64),I dont get o/p. All I get is this
edit pa.asm
masm pa.asm
link pa.asm
debug pa.asm
_
_
_ can someone plzzzzzzz help? ASAP!!
thanks a lot…
Thanks a lot! faculty in my college said debugging on windows 7 x64 was not possible and you proved it wrong…Appreciate your post
you need to enter ‘t’ for getting output at every step or enter ‘g’ to directly get the final output…:)@jj
am unable to mount it on c…. i tried with the given command bt its of no use, can any one help me with this
when i try to edit is saying that illegal command :edit
any solution?
can anyone tell me how to find out the path…like /home/name/8086 dosent work…shows up directory dosent exist:((
@ people getting illegal command : Did you forget to download/extract 8086 assembler files into your directory?
@priya The easiest way to find a path is to drag the file/directory and place it on the terminal
If i type debug file.exe , its showing in correct dos version.. im using MASM64. please help me out to debug
thank u so much,its working but not in full screen mode on my laptop
when i type masm file.asm, it shows
object filename[filename.obj]:
what am i supposed to type here???
with ref to #93
i had downloaded the masm 64 bit version for windows 7 from the following link:
http://masm64bit.blogspot.in/
pl help me……