.ASM

ASM File

Assembly Language Source Code File
Ask a question
QUICK ANSWER

An ASM file is assembly language source code - a plain-text file of low-level CPU instructions. Open it in any text editor to read or edit it. To run the code, assemble it with NASM, MASM, or GNU as into an object file, then link it into an executable. Note that some CAD programs (Pro/ENGINEER, SolidWorks) also use .asm for binary 3D assembly documents - those are unrelated to source code.

Developer: N/A (open text format; assembler syntax varies by toolchain - MASM, NASM, GAS, ARM as) Category: Developer Files Open standard MIME: text/x-asm
OPENS ON Windows macOS Linux
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Sep 3, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the ASM file format?

.asm files store source code for applications written in a low-level programming language. This format stores data in plain text, which can be accessed using any text editor. However, dedicated editors are recommended for editing such files, as they offer helpful features such as line numbering and syntax highlighting.

Assembly language is a low-level programming language that works closely with a processor architecture's machine code instructions. Assembly code is stored in .asm files. The first assemblers were created in the late 1940s. The language was highly popular until the 1980s (or 1990s, depending on the architecture), when higher-level languages were introduced, such as C or Pascal. High-level programming languages offered a cleaner syntax and a more intuitive programming interface, as well as significantly expanded functionality. Nevertheless, assembly is still the language of choice when performance is critical or when code must interact directly with hardware - used in OS kernels, bootloaders, embedded firmware, and device drivers.

Assembly languages are also used for writing malware or computer viruses that directly target CPUs and bypass many operating system routines.

Source code stored in an .asm file must be processed by an assembler - not a compiler - which converts it into a machine-code object file (.obj or .o). A linker then combines one or more object files into a runnable executable such as an EXE file. Common assemblers include MASM (Microsoft Macro Assembler), NASM, and GNU as (GAS). Each uses a distinct dialect; .asm source written for MASM is generally not compatible with GAS without modifications.

Security & safety

RISK: LOW

Reading or editing a .asm is completely safe - it is plain text and does nothing until assembled and run. The risk is only in what the code DOES once you assemble and execute it: like any source, an .asm can contain malicious logic, and assembly is a common form for shellcode and malware proof-of-concepts. Inspect unfamiliar assembly before building it, and never run a compiled binary from an untrusted .asm without understanding it. The file itself carries no macros or auto-execution.

Format details

in a nutshell
FULL NAMEAssembly Language Source Code Fileaka Assembler source file, ASM source
DEVELOPERN/A (open text format; assembler syntax varies by toolchain - MASM, NASM, GAS, ARM as)since 1940s-1950s (assembly languages); .asm convention popularized by DOS/MASM era (1980s)
MIME TYPEtext/x-asm
TYPEPlain-text assembly-language source code (human-readable)
STANDARDOpen · royalty-free
This extension is also used by…
  • SolidWorks / Pro-ENGINEER (Creo) Assembly file - Some CAD tools use .asm for binary 3D assembly documents (Pro/E .asm, and informally for SolidWorks); these are binary CAD files, unrelated to assembly source code - see .sldasm.
  • Generic 'assembly' data files - Various niche apps name part-assembly or build-assembly data files .asm; identify by the owning application.

Programs that open ASM files

Windows4 apps
Notepad Open-source Open the .asm as text; built-in Assembly syntax highlighting under Language > A > Assembly.
Visual Studio Code Free Open the .asm to read/edit with syntax highlighting (x86/ARM extensions available). It's plain text.
NASM (assembler) Open-source Assemble to an object file: nasm -f win64 file.asm -o file.obj, then link to build an EXE.
MASM (Microsoft Macro Assembler, in Visual Studio) Free Use ml64.exe (ships with Visual Studio Build Tools) to assemble MASM-syntax .asm files.
macOS3 apps
VS Code / BBEdit Free Open the .asm to read/edit as text with assembly highlighting.
NASM Open-source brew install nasm, then nasm -f macho64 file.asm to assemble (link with clang/ld).
GNU as (Xcode command-line tools) Free Assemble GAS/AT&T-syntax .s/.asm with the as that ships in Xcode CLT; build with clang.
Linux3 apps
GNU as / binutils Open-source Assemble: as file.asm -o file.o then ld to link; or use gcc to assemble+link in one step.
NASM Open-source nasm -f elf64 file.asm -o file.o, then ld file.o -o prog.
Any text editor (Vim, gedit, nano) Open-source Open the .asm to read/edit - it's plain text.

Technical details

deep spec
File typePlain-text assembly-language source code
MIME typetext/x-asm (also text/x-assembly, text/plain)
Character encodingASCII or UTF-8; legacy DOS sources may use code pages such as CP437
File signatureNone - no magic bytes; identified by extension and content (mnemonics and directives)
Line structureEach line holds an optional label, a mnemonic with operands, and an optional comment
Comment syntax; in MASM/NASM; # or @ in GNU as (GAS); * in some 6502/68k assemblers
Typical file size1 KB - 500 KB; generated listing files may be larger
Output artifactAssembled into an object file (.obj / .o), then linked into an executable
Common assembler dialectsMASM, NASM, GNU as (AT&T syntax), TASM, ARM/Keil assembler
Target ISAsx86/x86-64, ARM/AArch64, MIPS, RISC-V, AVR, 6502, Z80, and many others
Dialect portabilityNot portable across assembler dialects without modification; syntax and directives differ significantly
Macro supportSupported in most assemblers: MACRO/ENDM in MASM, %macro/%endmacro in NASM, .macro/.endm in GAS
Include mechanismINCLUDE (MASM), %include (NASM), .include (GAS) - splits source across multiple files
Typical use casesOS kernels, bootloaders, firmware, cryptographic routines, game-engine hot paths, malware analysis
Released1940s-1950s (assembly languages); .asm convention popularized by DOS/MASM era (1980s)
Latest versionN/A (text source; depends on the target ISA and assembler dialect, not a versioned file format)
Open standardYes · royalty-free
Specificationsourceware.org

ASM conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with ASM files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about ASM files.

Frequently asked questions

How do I run an ASM file?
You don't run it directly - it's source code. Assemble it with an assembler (NASM, MASM or GNU as) into an object file, then link that into an executable. For example: nasm -f elf64 file.asm -o file.o && ld file.o -o prog.
How do I open an ASM file to read it?
Open it in any text editor or code editor - VS Code, Notepad++, Vim. It's plain text. Editors with assembly syntax highlighting make it easier to read.
What assembler do I need for a .asm file?
It depends on the dialect the file is written in: NASM for NASM syntax, MASM (ml64.exe in Visual Studio) for MASM syntax, GNU as for AT&T/GAS syntax, or an ARM/Keil assembler for embedded ARM. The comment style and directives hint at which one.
Why can't I convert my ASM file to STEP or IGES?
Because that .asm is probably a CAD assembly file (Pro/ENGINEER, SolidWorks), not assembly source code. Those conversions are CAD exports done inside the CAD program. An assembly-language text file cannot become a 3D model.
What's the difference between .asm and .s?
Both hold assembly source. .asm is common on Windows/DOS (MASM, NASM); .s (lowercase) is the conventional extension for GNU assembler / compiler-generated assembly on Unix-like systems. The syntax (Intel vs AT&T) usually differs accordingly.
Is an ASM file a virus?
The file itself is harmless text. It only matters what the code does after you assemble and run it. As with any source code, review unfamiliar assembly before building it.

References

1GNU as - The GNU Assembler manualsourceware.org
2Microsoft - MASM (ML) referencelearn.microsoft.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.EXEWindows Executable (Portable Executable)
4.DATProgram Data File (generic)
5.PARTPartial Download File
6.NOMEDIAAndroid No-Media Marker File
7.RPMSGRestricted Permission Message
8.BINCD/DVD Disc Image (BIN/CUE)
9.TMPTemporary File
10.XDWDocuWorks Document

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z