How To Code And Run Assembly Language On Windows



This article is for programmers, crackers and also for computer science students who will like to start coding with assembly language with their computers. Assembly language is easy to learn and understand and in four week you can be a professional with the language. The language requires attention and continuous practice in order to get more similar with it.

First to start coding with assembly language you will need MASM32 which is an assembler and also Visual Studio Code which will help you with the coding you can download the softwares from the links below

MASM32

Visual Studio Code

Run MASM32 setup, you might encounter some error messages but don’t worry say yes/ok to all. When MASM32 is fully installed close the program and run Visual Studio Code setup and when Visual Studio Code is fully installed open the program and write a simple “Hello World” program. For beginners below is an example of a simple assembly language “Hello World” program.


After writing the program choose a folder where all your programs will be saved but it’s more advisable to create a new folder. Then save the program with the file type “asm”. For example helloworld.asm. Then to run the program open command prompt navigate to the folder where you saved the program. For example
 C:/Users/charl/Documents/Projects/hello world>


NOTE : (hello world masm is the folder where I saved the program to)

Then write this line of code

C:/Users/charl/Documents/Projects/hello world masm>\masm\bin\ml /c /Zd /coff helloworld.asm

And press enter


The code above compiled it to an object file and now we will turn it to an executable file.

C:/Users/charl/Documents/Projects/hello world masm>\masm32\bin\Link /SUBSYSTEM:CONSOLE helloworld.obj

And press enter

Now let’s run the program

C:/Users/charl/Documents/Projects/hello world masm>helloworld.exe




There you go!!

 It’s usually annoying that whenever you want to run the program you have to go through/write these three codes. To prevent that open up Visual Studio Code and write these codes and when you are done save it with “.bat” For example compile.bat

set programName=helloworld 
\masm\bin\ml /c /Zd /coff %projectName%.asm 
masm32\bin\Link /SUBSYSTEM:CONSOLE %projectName%.obj 
%projectName%.exe




Then all you will do is to open up command prompt and write compile.bat press enter and the program runs.

C:/Users/charl/Documents/Projects/hello world masm>compile.bat

For beginners here are some documents that will help you to learn and understand Assembly Language.. Download PDF Files below   

Intel Assembly Language Programming

Programming 8085

Assembly Programming
Previous
Next Post »