How to Start Programming in Assembly

This article was co-authored by wikiHow Staff. Our trained team of editors and researchers validate articles for accuracy and comprehensiveness. wikiHow's Content Management Team carefully monitors the work from our editorial staff to ensure that each article is backed by trusted research and meets our high quality standards.

This article has been viewed 216,869 times.

Assembly programming is often a crucial starting point when computer programmers are learning their craft. Assembly language (also known as ASM) is a programming language for computers and other devices, and it's generally considered a low-level variant when compared to more advanced languages that offer additional functionality. Once you've written the code, an assembler converts it into machine code (1s and 0s). While the applications for assembly programming have grown more limited given the growing complexity of processors, Assembly remains useful for a number of purposes including writing code for stand-alone executables or device drivers.

Things You Should Know Part 1 of 3:

Familiarizing Yourself With Assembly Language

Step 1 Read up on Assembly Language.

Fair Use (screenshot)
\n">

Read up on Assembly Language. Before embarking upon any attempt to write code, it's always a good idea to first understand the language itself. There are a number of available resources ranging from textbooks to online guides.

Step 2 Learn basic terms.

Fair Use (screenshot)
\n">

Learn basic terms. For example, you'll want to know that an IDE (integrated development environment) provides a coding interface that handles things like text editing, debugging and compiling. You may also wish to better understand the way assembly actually works, like the fact that "registers" are what store the numbers associated with program code. Better understanding terminology will make it easier to learn the code-writing process itself.

Advertisement

Step 3 Decide whether assemblers are right for you.

Fair Use (screenshot)
\n">

Decide whether assemblers are right for you. Remember that there are a number of programming languages, including some that provide far more functionality than assembly. There are, however, still a range of applications for which assembly is useful—from creating standalone executables for telephone firmware and air-conditioning control systems to developing certain processor-specific instructions.

Step 4 Determine which assembler you wish to use.

Fair Use (screenshot)
\n">

Determine which assembler you wish to use. Assemblers like A86, NASM or GNU generally perform less complex functions and may be appropriate starting points for beginners. Every assembler works a bit differently, so subsequent instruction will work under the assumption that you're using MASM (Microsoft Macro Assembler)—a basic assembler that works with Windows operating systems. It uses x86 assembly language and Intel syntax. [1] X Research source

Advertisement Part 2 of 3:

Downloading and Installing the Assembler and IDE

Step 1 Download the assembler itself.

Fair Use (screenshot)
\n">

Step 2 Download an IDE.

Fair Use (screenshot)
\n">

Download an IDE. Simply perform a search for "WinAsm download" to find and install the WinAsm IDE, which generally works well with MASM. Other IDEs may be more appropriate depending on which programming language you're using. One popular alternative is RadAsm.

Step 3 Install MASM 8.0.

Fair Use (screenshot)
\n">

Install MASM 8.0. You may begin the installation right away by clicking Run once the program has downloaded. Alternatively, you may wish to install it at a later date, in which case simply click Save. Upon clicking Run, MASM 8.0 will be installed to your “[Visual C++ Express]\bin” directory and labeled ml.exe.

Step 4 Install your IDE.

Fair Use (screenshot)
\n">

Install your IDE. After WinAsm has been downloaded, you simply extract the files and copy them to your "c:\program files\" folder. You may also wish to place a shortcut on your desktop in order for easier access.

Step 5 Configure Your IDE.

Fair Use (screenshot)
\n">

Configure Your IDE. First, launch the WinAsm program. If you've placed a shortcut on your desktop, simply double-click it. Note that this process will differ if you're using another assembler or IDE.

Step 6 Integrate WinAsm with MASM 8.0.

Fair Use (screenshot)
\n"> Advertisement Part 3 of 3:

Writing Code

Step 1 Start writing code.

Fair Use (screenshot)
\n">

Start writing code. Begin by launching WinAsm and clicking on the File tab. Then select New Projects, and you'll see several options. Those options include Console Application and Standard EXE. If you're attempting created a GUI (graphical user interface) based application, for example, you'd select the latter.

Step 2 Use assembly program structure.

Fair Use (screenshot)
\n">

Use assembly program structure. A typical structure might include a line defining architecture, a data section (section.data) including initialized data or constants, a bss section (section.bss) that declares variables and a text section (section.text) in which you place your actual program code. That final section always begins with a global _start declaration. Each sequence is known as a block of code.

Step 3 Understand basic commands.

Fair Use (screenshot)
\n">

Understand basic commands. There are three kinds of statements in assembly language: executable instructions or instructions (these tell processors what to do via operation code), assembler directives or pseudo-ops (these describe assembly processes to the assembler) and macros (these serve as a text-substitution mechanism).

Advertisement

Community Q&A

I can't register an account for the download link for some reason. What should I do? Community Answer

It may be because the email or username you used to register is already in use, or the password may be too weak. As a last resort, try using a VPN and then registering.

Thanks! We're glad this was helpful.
Thank you for your feedback.
If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow

Ask a Question 200 characters left Include your email address to get a message when this question is answered. Advertisement

Writing effective code in assembly language (or any other) generally requires somewhat significant study. You'll especially want to learn the required syntax for assembly language statements and how to compile and link an assembly program.

If you experience any difficulties when attempting to set up a specific assembler, it may be wise to join a forum in which particular questions may be addressed.

Some programming languages have facilities for mixing assembly into them, such as the ASM ("") function in C and C++. This is a good way to start.

Submit a Tip All tip submissions are carefully reviewed before being published Please provide your name and last initial Thanks for submitting a tip for review!

Advertisement

You Might Also Like

Start Programming in Python

Start Programming in Python

Start Learning to Program

Start Learning to Program

Change Code on Schlage Lock

How to Change 4-Digit User Codes on Schlage Locks

Convert from Binary to Decimal

Converting Binary to Decimal: Positional Notation & Doubling

Format Text as Code in Discord

2 Simple Ways to Format Text Into Code on Discord

Reset Schlage Keypad Lock Without Programming Code

How to Factory Reset a Schlage Lock & Restore the Default Programming Code

Run a Program from the Command Line on Linux

Run a Program from the Command Line on Linux

Delay a Batch File

How to Delay a Batch File: Timeout, Pause, Ping, Choice & Sleep

Write Pseudocode

Learn to Write Pseudocode: What It Is and Why You Need It

Make an Exe File

Make an Exe File

Convert from Decimal to Hexadecimal

Convert from Decimal to Hexadecimal: A Quick Guide + Examples

Make a Program Using Notepad

Make a Program Using Notepad

View Source Code

How to View Source Code

Download a GitHub Folder

3 Ways to Download GitHub Directories and Repositories