Skip to content
Skills Library
Programming · Building & coding

assembly

/assembly

汇编语言开发专家助手。当用户需要进行汇编语言编程、x86/ARM指令集、底层系统开发、逆向工程或嵌入式汇编时调用。

Repository
hello-skill ↗
Licence
MIT
Last repository change
02.07.2026

Assessment and security

86/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability21 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

汇编语言开发专家助手。当用户需要进行汇编语言编程、x86/ARM指令集、底层系统开发、逆向工程或嵌入式汇编时调用。

Original author description

汇编语言开发专家助手。当用户需要进行汇编语言编程、x86/ARM指令集、底层系统开发、逆向工程或嵌入式汇编时调用。

How it works

  1. 技术栈强制约束
  2. 命名规范
  3. 代码结构规范
  4. 寄存器使用规范
  5. 注释规范
  6. 格式规范
  7. 代码质量强制要求
  8. 安全规范
  9. 优化规范
  10. 调试规范
Original SKILL.md headings · 103 lines, 216 words
SKILL.md preview
---
name: "assembly"
description: "汇编语言开发专家助手。当用户需要进行汇编语言编程、x86/ARM指令集、底层系统开发、逆向工程或嵌入式汇编时调用。"
---

# 汇编语言开发技能

你是一位资深汇编语言开发工程师。在协助汇编项目时,请遵循以下规范。

## 技术栈强制约束

- x86/x64 使用 NASM 或 GAS 汇编器
- ARM 使用 GNU Assembler(GAS)
- 使用各自平台的标准调用约定
- 与 C 语言互操作时遵循 ABI 规范

## 命名规范

- 标签名:snake_case(`loop_start`、`error_handler`)
- 宏名:UPPER_SNAKE_CASE(`MAX_BUFFER_SIZE`、`SAVE_REGS`)
- 常量名:UPPER_SNAKE_CASE(`SYS_WRITE`、`STDOUT`)
- 段名:小写(`.text`、`.data`、`.bss`)
- 文件名:snake_case(`string_utils.asm`、`math_ops.s`)
- 命名语义化,禁止拼音、无意义缩写

## 代码结构规范

- 段划分:
  - `.data`:已初始化数据
  - `.bss`:未初始化数据
  - `.text`:代码段
- 程序入口标签:`_start`(独立程序)或 `main`(C 调用)
- 函数结构:
  - 序言(Prologue):保存寄存器、分配栈帧
  - 函数体
  - 结语(Epilogue):恢复寄存器、释放栈帧、返回

## 寄存器使用规范

- x86-64 System V ABI:
  - 参数传递:`rdi`、`rsi`、`rdx`、`rcx`、`r8`、`r9`
  - 返回值:`rax`
  - 调用者保存:`rax`、`rcx`、`rdx`、`rsi`、`rdi`、`r8`-`r11`
  - 被调用者保存:`rbx`、`rbp`、`r12`-`r15`
- ARM AAPCS:
  - 参数传递:`r0`-`r3`
  - 返回值:`r0`
  - 被调用者保存:`r4`-`r11`
- 使用被调用者保存寄存器必须先保存后恢复

## 注释规范

- 每个函数必须有中文注释说明功能、输入、输出
- 每条关键指令必须添加中文注释
- 寄存器用途变更必须注释说明
- 算法逻辑必须注释说明步骤
- TODO 注释格式:`; TODO(作者): 具体待办事项描述`
- 禁止无意义注释

## 格式规范

- 标签顶格写
- 指令缩进 8 空格或 1 个 Tab
- 操作数对齐
- 注释对齐到固定列(第 40 列或更后)
- 单行不超过 100 字符

## 代码质量强制要求

- 栈必须对齐(x86-64 要求 16 字节对齐)
- 函数调用前必须保存需要的寄存器
- 系统调用号必须正确
- 内存访问必须检查边界
- 禁止未初始化的内存读取
- 退出程序必须使用正确的系统调用

## 安全规范

- 栈缓冲区必须检查溢出
- 输入验证必须在处理前完成
- 禁止执行栈上的代码(NX 位)
- 使用 ASLR 和 Stack Canary 保护

## 优化规范

- 减少内存访问,优先使用寄存器
- 使用 `lea` 替代 `mov` + `add` 计算地址
- 循环展开减少分支预测失败
- 使用条件移动(`cmov`)替代分支
- 对齐数据访问(4/8/16 字节对齐)
- 使用 SIMD 指令加速向量操作

## 调试规范

- 使用 GDB 调试
- 使用 `objdump` 反汇编
- 使用 `strace` 跟踪系统调用
- 使用 `ltrace` 跟踪库调用

## 最佳实践

- 使用宏简化重复代码
- 使用条件汇编处理平台差异
- 与 C 语言混合编程时遵循 ABI
- 使用 `extern` 声明外部函数
- 使用调试信息(`-g`)便于调试

Versions

RepositoryScoreLicence
This page · dkbnull/hello-skill86MIT
G1Joshi/Agent-Skills100MIT

Database snapshot: 13.11.2026 · package version 6a2120262a03 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100assembly-guide
    Assembly language guardrails, patterns, and best practices for AI-assisted development. Use when working with assembly files (.asm, .s, .S), or when the user mentions Assembly/x86/ARM. Provides calling convention guidelines, register usage patterns, and debugging techniques…
  • 86cpp
    C++开发专家助手。当用户需要进行C++系统编程、高性能计算、游戏引擎、嵌入式开发或底层库开发时调用。
  • 100vibe-assembly
    Write a function directly in assembly instead of a high-level language, verified against a reference and benchmarked against the optimizing compiler, using this repository's `vibeasm` harness. Use when the user asks for assembly, for "the fastest possible" version of a hot…
  • 100assembly-arm
    AArch64 and ARM assembly skill for reading and writing ARM assembly code. Use when reading GCC/Clang output for AArch64 or ARM Thumb targets, writing inline asm in C/C++, understanding the ARM ABI (AAPCS64/AAPCS), or debugging register and stack state on ARM hardware or QEMU.…
  • 95assembly-arm
    Use when reading or writing AArch64 or AArch32 Thumb assembly, inline asm in C, AAPCS64 register roles, or NEON and SVE vector code. Not for ABI detail across ISAs: use abi-and-calling-conventions.
  • 100assembly-arm
    Use when reading or writing AArch64 or AArch32 Thumb assembly, inline asm in C, AAPCS64 register roles, or NEON and SVE vector code. Not for ABI detail across ISAs: use abi-and-calling-conventions.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.