Hello, in this post i will be presenting a very simple step-by-step procedures through which you can execute MASM programs with ease.
Now, there may be a lot of reasons for you to be able to execute the MASM programs on a Linux machine. One them could be:
- You are not using windows anymore.(And yes, you may try this guide on Windows7 or above and give me feedback. It should work the same way. I have run and tested in Ubuntu 14.04 successfully).
My reason was quite simple, i used Ubuntu(and still do) and was in need to get a way around this. After all the acronym MASM stands for Microsoft Macro Assembler. Which means the original installation supports only windows. Not anymore, i have another way around. 🙂
- So to begin with download the masm folder from the below link. https://drive.google.com/folderview?id=0B1DiPkxLHBZHTWVQVVNlYVptU3M&usp=sharing
(You may not be able to download immediately, add these files to your Google drive ,then prepare the download by right-clicking the folder.) - Then install the legendary dosbox
- To install dosbox on ubuntu, fire up the terminal( ctrl+alt+t) and run the command
sudo apt-get install dosbox
That’s it, you are done.!
Yes, Now you can run MASM programs.
So, let me show you a demo of how to run the programs using dosbox and the files downloaded from the drive.
- step1:Write your MASM program in you favorite text editor say: notepad/geany etc and save it in the masm folder, the folder which contains all the downloaded files from Google drive.
- step2: Mount the location where the downloaded folder is available.
To mount, open the dosbox and use the command
mount c: ~/Downloads/masm
and hit enter.
(This command assumes that you have downloaded all the files from the drive and stored in folder masm in location Downloads. If you have done it differently change the command appropriately)
once done, you should see something like this on your screen. - Step3: Once it is mounted,change the present working directory to c.
To do this use the command
c:
This should look like this:
- Step4: Verify if you have done above steps correctly by using the DOS command
dir
the dir command will list out all the files inside the masm folder, so if you have your program listed in, then you have done the above steps prefectly!.
Along with these files you must see your asm file in the list.
- step5: I have already included a program inside it namely count99.asm, which counts from 00 to 99 and displays the output, so i will be using this file as example and demonstrate, you may use the file which you have recently saved in that folder. So now lets assemble the code, run the command
masm count99;
the general syntax could be masm filename;
It should look like this.
I - step6: To link the file use the command
link count99;
the general syntax could be link filename;
- Step7: If there were no errors in assembling and linking( is said no errors 🙂 ) Then lets run the executable. The command is
debug count99.exe
the general syntax could be debug filename.exe
- Step8: enter g before the hyphen(‘-‘) and enter.
And you are done, you must the output on the screen.
- Once the output is displayed, enter q to quit.
Tip: As you are using dosbox and sometimes you may want to run the output in fullscreen mode, then you can try this:
- ctrl+f10
to lock the mouse for the dosbox. - ctrl+enter
to enter into full screenmode.
Now you can see your output running in fullscreen.
I hope this guide was useful, Thank you.
thank you so much.helped a lot .working in ubuntu 14.04 LTS .u cleared all the doubts
LikeLiked by 1 person
Glad to hear!
LikeLike
please tell how to see contents of memory and registers.
LikeLike
how can i use Irvine32.inc
LikeLike
How can i work on logic controller kit, seven segment kit in ubuntu ? can you help me with this.
LikeLike
Sure, which framework are you using?
LikeLike
Thank you very much brother,it helped me a lot.
LikeLike
bro how can i open code view… in it
LikeLike
heyy… You have explained how to run it on dosbox.. i am pretty noob to this…But, we have installed dosbox on ubuntu..then how did you run the asm code in application dosbox?
LikeLike