3

How can I run the code of Masm on Ubuntu? I cannot use Windows as a virtual machine and neither can I use Nasm.

Zanna
  • 72,312
Bilal K
  • 31

2 Answers2

1

You can try using DOSBox with this guide. These instructions will run in all versions of Ubuntu.

  1. Download the all files in the masm folder from here.
  2. Install dosbox with the following command:

    sudo apt install dosbox
    

Usage

  1. Write an masm program (e.g. myProgram) in any text editor and save it.
  2. Mount the location where the downloaded folder is available (e.g. ~/Downloads). To mount, launch dosbox and run this command in dosbox:

    mount c: ~/Downloads/masm  
    
  3. Change the current working directory to c.

    c:
    
  4. Assemble the code.

    masm myProgram;
    
  5. Link the file.

    link myProgram;
    
  6. Run the executable.

    debug myProgram.exe  
    
  7. Type -g and press Enter.

  8. Once the output is displayed, enter q to quit.

karel
  • 122,292
  • 133
  • 301
  • 332
Saxtheowl
  • 2,394
  • 2
  • 12
  • 22
0

To use masm from your terminal, an easy way is with dosemu

sudo apt install dosemu

cd to where your MASM.EXE is located and execute

dosemu MASM.EXE <code.asm>

I've tried it with MASM 5.1, works perfectly.

Hope I have helped :)

Giorgos Saridakis
  • 768
  • 1
  • 5
  • 13