.asm

What is a .asm file?

Assembly Language Source File · Code and data · various (NASM, MASM, GAS)

An .asm file is assembly language source code: human-readable mnemonics that map almost one-to-one onto a processor's machine instructions. It is used where absolute control or performance matters.

Category
Code and data
MIME type
Type
Plain text
Also seen as
.s
Is a .asm file safe to open? Caution. An .asm file is source code; the text itself is harmless, but assembling and running it executes low-level code. Review before building.

What is a .asm file used for?

Assembly is the lowest-level language people still write by hand: each line typically becomes one CPU instruction. It appears in bootloaders, operating-system internals, embedded firmware, performance hot spots and reverse engineering.

The syntax depends on the assembler (NASM, MASM, GAS) and the target processor, so an x86 .asm file means nothing to an ARM assembler. Unix toolchains often use the .s extension for the same idea.

What opens a .asm file?

The .asm format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.

Windows

  • VS Code
  • NASM/MASM (to assemble)
  • any text editor

macOS

  • VS Code
  • clang/as (to assemble)
  • any text editor

Linux

  • VS Code
  • nasm/as (to assemble)
  • any text editor

Open a .asm file step by step

  1. Confirm the file really is a .asm. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with VS Code or NASM/MASM (to assemble).
  3. On Mac, use VS Code or clang/as (to assemble).
  4. On Linux, try VS Code or nasm/as (to assemble).
  5. Still stuck? Convert the .asm to o (object file), which opens more widely.

Why can't I open my .asm file?

Almost always because no installed app understands Assembly. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .asm at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

How to convert a .asm file

You can convert a .asm file to o (object file), exe using a conversion tool or the export menu of an app that opens it.

Assembly has no fixed magic number, so there is no signature table on this page. Its bytes alone do not prove the format: identification relies on the extension, the structure of the content and the program that created it. The magic-numbers reference lists the formats that do carry one.

Frequently asked questions

What is a .asm file?

An .asm file is assembly language source code: human-readable mnemonics that map almost one-to-one onto a processor's machine instructions. It is used where absolute control or performance matters.

How do I open an .asm file?

Any text editor opens it, since assembly is plain text. To turn it into a program you assemble it with a tool such as NASM, MASM or GNU as.

What is the difference between .asm and .s?

Both hold assembly source. .asm is common on Windows and with NASM/MASM; .s is the Unix convention, and a capital .S usually means it runs through the C preprocessor first.

Why do people still write assembly?

For bootloaders, firmware, OS kernels, tight performance loops and security research, where exact control over instructions matters more than convenience.

Related formats

Sources

Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.