Uncategorized

MASM INSTALLATION In Windows/Ubuntu

In this blog, You will learn how to Install 32-bit masm. MASM (Microsoft macro assembler ) is a compiler that is used to compile the Assembly code to your machine.

If you are using Ubuntu or any Debian Linux OS then first you need to download** Virtualbox **and install **Windows OS **on it.

Video Link For Downloading and installing Virtualbox on Ubuntu:
https://youtu.be/NV9Vrm2qa_0

Now we will see how to install MASM in windows.

First, you need to go to your browser and download **MASM **you can go to the following link
https://www.masm32.com/

Click on download
Picture1.png

After that click on Western Europe

Picture2.png

Now Click on Download Dos MASM32 ….(4.72mb)

Picture3.png

Once it is downloaded to download and extract there. Then double click on the install it will start the installation. This will ask for many permission just click OK.

WhatsApp Image 2021-10-02 at 2.30.37 AM.jpeg

This will take some time. Once done, it will open the Welcome file. When you see that it means that the masm has been successfully installed.

WhatsApp Image 2021-10-02 at 2.38.02 AM.jpeg

HELLO WORLD IN ASSEMBLY LANGUAGE

Now open the masm and copy this code into it. This code will produce Hello World.

.

386
.model flat, stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib

.

data

msg db "Hello world!!!", 0
cpt db "MY FIRST PROGRAM!!!", 0

.code
start:

invoke MessageBox, NULL, addr msg, addr cpt, MB_OK

invoke ExitProcess, NULL

end start

Save this file in the directory where you have masm installed. Put this file in the masm32 folder.

Then open masm and click on option project and then click on build all. Then it will Build and compile our code.

Picture4.png

Then you will open **CMD **in the directory in which u saved your **.asm file **and then you simply type your filename without .asm and then hit enter and you are done! You can see the output

Picture5.png

So, that’s it for this web journal. Trust you appreciate it. Do let me know about your criticism within the comment segment. I will truly appreciate it.