.S

Файл S

Assembly Language Source File
Задать вопрос
БЫСТРЫЙ ОТВЕТ

A .s file is an assembly language source file - plain text containing low-level CPU instructions for a specific processor such as x86-64 or ARM. Any text editor opens it for viewing. To build it into a program, run "gcc file.s -o program" on Linux or macOS, or use MinGW or MASM on Windows. The file is safe to open; risk only begins if you assemble and run untrusted code.

Разработчик: N/A (compiler/toolchain convention - GNU, Unix C toolchains) Категория: Файлы разработчика Открыть стандартное MIME: text/x-asm
ОТКРЫВАЕТСЯ НА Windows macOS Linux
Связанные: .DO · .MD · .HEX · .XSD

На этой странице

Проиндексировано расширений: 19k+
Последняя проверка: Aug 4, 2026

Не знаете, что это за файл?

Перетащите любой файл в наш идентификатор - мы прочитаем первые байты, чтобы определить формат.

Идентифицировать файл

Что такое формат файла S?

A .s file is a plain-text assembly language source file used across Unix, Linux, macOS, and embedded toolchains. It contains human-readable CPU instructions - mnemonics, operands, assembler directives, and labels - that an assembler translates directly into object code.

The .s extension is a Unix C compiler pipeline convention dating to the 1970s. Running gcc -S on a C source file halts compilation after code generation and writes a .s file, letting you inspect or hand-tune the compiler's output before assembling. That file is then passed to as (the GNU assembler) to produce a .o object file ready for linking.

A subtle but important convention separates lowercase .s from uppercase .S: .s files go directly to the assembler, while .S files pass through the C preprocessor first, allowing #include, #define, and #ifdef directives - a distinction kernel and firmware codebases rely on heavily.

Syntax varies by toolchain. GNU as defaults to AT&T syntax on x86; Windows assemblers such as MASM and Intel-style NASM use Intel syntax. The same .s file layout is used regardless of target ISA - x86-64, ARM/AArch64, RISC-V, MIPS, and others - so the extension itself conveys no architecture information.

.s files carry no magic bytes and have the MIME type text/x-asm. Any text editor opens them; editors with assembly syntax highlighting such as VS Code, Vim, and Emacs are preferred for larger files. The closely related .asm extension serves the same purpose on many non-Unix toolchains.

Безопасность и защита

РИСК: LOW

A .s file is plain text and does nothing on its own - it cannot run until you deliberately assemble and execute it. The risk is the same as any source code you choose to build: assembly can contain instructions that do anything the CPU allows, so only assemble and run .s files from sources you trust, and read unfamiliar assembly before building it. Opening a .s in a text editor to view it is completely safe.

Детали формата

в двух словах
ПОЛНОЕ НАЗВАНИЕAssembly Language Source Fileтакже известен как Assembly source, Assembler source
РАЗРАБОТЧИКN/A (compiler/toolchain convention - GNU, Unix C toolchains)с 1970s (Unix C compiler toolchain convention)
MIME-ТИПtext/x-asm
ТИПPlain-text assembly source code
СТАНДАРТОткрытый · без роялти
СВЯЗАННЫЕ.do.md.hex.xsd
Это расширение также используется в…
  • S programming language source - Source code for the S statistical language (predecessor of R); rare today, still seen in legacy statistics code.
  • Scheme source (uncommon) - Occasionally a Scheme/Lisp source file, though .scm is the usual extension.

Программы, открывающие файлы S

Windows3 apps
Notepad Открытый код Open directly; Language menu has Assembly highlighting. Lightweight viewing/editing.
Visual Studio Code Бесплатно Open the .s file; install an 'x86/ARM Assembly' extension for syntax highlighting. Edit as plain text.
MASM / MinGW-w64 GCC (to assemble) Бесплатно To build it: 'gcc file.s -o program.exe' (MinGW) or 'ml64' (Visual Studio's MASM).
macOS2 apps
Visual Studio Code Бесплатно Open the .s file; install an 'x86/ARM Assembly' extension for syntax highlighting. Edit as plain text.
Xcode command-line tools (clang/as) Бесплатно Install with 'xcode-select --install', then assemble using clang/as from Terminal.
Linux3 apps
GNU as (binutils) + GCC Открытый код Assemble with 'as file.s -o file.o' or build directly with 'gcc file.s -o program'. The reference toolchain.
GNU Emacs / Vim Открытый код Open in asm-mode (Emacs) or with syntax highlighting (Vim) to read and edit.
gedit / any text editor Открытый код Open as plain text for quick viewing; gedit highlights common assembly syntaxes.

Технические подробности

глубокая спецификация
File typePlain-text assembly language source
MIME typetext/x-asm (also accepted: text/x-assembly, text/plain)
EncodingASCII / UTF-8
File signature (magic bytes)None - plain text with no fixed header; typically begins with a comment (#, ;), a label (ending in :), or a directive such as .text or .global
Line structureOptional label, assembler directive or CPU mnemonic with operands, inline comment - one logical operation per line
Case conventionLowercase .s is assembled directly; uppercase .S is first run through the C preprocessor (supports #include, #define, #ifdef)
Compiler emissiongcc -S or clang -S emits a .s file from C/C++ source, halting the build pipeline after code generation and before assembly
Supported ISAsx86-64, ARM/AArch64, RISC-V, MIPS, POWER/PowerPC, AVR, and others - the extension is ISA-neutral
Syntax variantsAT&T syntax (GNU as default on x86), Intel syntax (MASM, NASM), ARM Unified Assembly Language (UAL)
Common assembler directives.text, .data, .bss, .global, .section, .align, .byte, .word, .long, .string
ToolchainsGNU Binutils (as), LLVM/Clang integrated assembler, Microsoft MASM, NASM, yasm, armasm
Build pipeline roleIntermediate text stage between compiler code-generation and object-file creation; assembled by as or equivalent to produce a .o file
Preprocessing supportThe .S variant (uppercase) is passed through cpp before assembly, enabling conditional compilation and macro expansion inside asm source
Typical file size1 KB - 500 KB
Associated environmentsLinux, Unix, macOS, Windows, embedded/bare-metal (microcontrollers, kernel startup code, bootloaders)
Выпущен1970s (Unix C compiler toolchain convention)
Последняя версияN/A (no versioned spec; depends on target CPU ISA and assembler)
Открыть стандартноеДа · без роялти
Спецификацияsourceware.org

Конвертации S

Вопросы и ответы сообщества

спрошено пользователями
Задать быстрый вопрос
Получите помощь от людей, работающих с файлами S. Будьте конкретны - укажите вашу систему и версию ПО.
Аккаунт не нужен · ответы обычно в течение дня

Вопросов пока нет - станьте первым, кто спросит о файлах S.

Часто задаваемые вопросы

What is a .s file?
It's an assembly language source file - plain-text, low-level CPU instructions for a specific processor (x86, ARM, RISC-V, etc.). It's what a C compiler emits before producing machine code, and what hand-written assembly is saved as.
How do I open a .s file?
Open it in any text editor or IDE - VS Code, Notepad++, vim, Emacs. To actually build it, use an assembler/toolchain such as GNU as or 'gcc file.s -o program'.
What's the difference between .s and .S?
Lowercase .s is pure assembly the assembler reads directly. Uppercase .S is assembly that's first run through the C preprocessor, so it can use #include, #define and #ifdef (common in OS/kernel code). The case matters on Unix/Linux.
How do I compile a .s file?
On Linux/macOS: 'gcc file.s -o program' (assemble + link) or 'as file.s -o file.o' (just assemble). On Windows use MinGW's gcc or MASM's ml64. You need the assembler matching the file's CPU and syntax.
Can I convert assembly (.s) back to C?
Not faithfully. Assembly drops the high-level structure C needs, so there's no true .s-to-C converter. Decompilers like Ghidra produce approximate C from compiled binaries, not equivalent source.
Is .s the same as .asm?
They're both assembly source. .s is the Unix/GNU convention (often AT&T syntax via GNU as); .asm is more common on Windows/DOS (NASM, MASM, often Intel syntax). The CPU and assembler determine the dialect, not the extension.

Ссылки

1GNU Assembler (as) manual - Sourcewaresourceware.org
2GCC - Overall options (-S emits assembly)gcc.gnu.org

Узнать больше

по всей базе данных

Популярные расширения на этой неделе

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

Похожие расширения

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

Бесплатные инструменты для файлов

Идентификатор файлов и конвертер изображений в браузере - все работает на вашем устройстве.

Открыть инструменты

Обзор расширений файлов A-Z