g1joshi/agent-skills/assembly
Claude Code and agent skill by g1joshi/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Expert x86-64 and ARM64 assembly assistance covering registers, calling conventions, stack frames, and inline asm. Use when writing low-level code, optimizing hot loops, or reverse engineering binaries.
Install
npx vskill@latest install g1joshi/agent-skills/assemblySKILL.md
The same SKILL.md was published earlier as g1joshi/agent-skills/assembly.
Assembly
Low-level language with a very strong correspondence between the instruction in the language and the architecture's machine code instructions.
When to Use
- Low-Level Hardware & OS Kernel Programming: Writing bootloaders, CPU context switches, interrupt handlers, and page table setup.
- Micro-Architectural SIMD Vector Optimization: Crafting hand-tuned AVX-512, Neon, or SSE assembly kernels for game physics and matrix multiplication.
- Reverse Engineering & Exploit Analysis: Disassembling binary executables to audit firmware, analyze malware, or debug compiler crashes.
- Embedded Bare-Metal Firmware: Direct CPU register manipulation on microcontrollers without operating system abstractions.
Quick Start
Core Concepts
CPU Registers & Memory Addressing Modes (x86-64 / ARM64)
Registers hold immediate state for execution; addressing modes compute memory operands:
The System V AMD64 Calling Convention
Governs how functions receive parameters and return values in Linux and macOS:
| Register | Argument Role | |
|---|---|---|
rdi | 1st function argument | |
rsi | 2nd function argument | |
rdx | 3rd function argument | |
rcx | 4th function argument | |
r8, r9 | 5th and 6th function arguments | |
rax | Function return value (and syscall number) |
SIMD Vectorization (AVX-512 / AVX2)
Processes multiple data elements simultaneously across 256-bit or 512-bit vector registers:
Common Patterns
Syscall Invocation with Proper Register Arguments (Linux x86-64)
Problem: Invoking kernel system calls directly without C runtime dependencies.
Solution: Load syscall number into rax and arguments in rdi, rsi, rdx, r10, r8, r9:
Best Practices
Do:
- Preserve Callee-Saved Registers: Always preserve
rbx,rsp,rbp,r12-r15across function boundaries. - Maintain 16-Byte Stack Alignment: Ensure
rspis 16-byte aligned before issuingcallinstructions to avoid segmentation faults in libc. - Use Inline Assembly Sparingly in C/Rust: Rely on compiler intrinsic headers (
<immintrin.h>) whenever possible instead of raw inline assembly. - Comment Every Assembly Routine Thoroughly: Document input register assumptions, output registers, and modified flags.
Don't:
- Rewrite algorithms in assembly without profiling: Modern LLVM/GCC compilers generate near-optimal machine code for standard loops.
- Ignore processor architecture differences: x86-64 CISC code is incompatible with ARM64 RISC instruction sets.
- Bypass platform calling conventions: Mixing calling conventions causes silent stack corruption and elusive crashes.
Troubleshooting
| Error | Cause | Solution | |
|---|---|---|---|
Segmentation fault (core dumped) | Dereferencing invalid pointer or misaligned stack before call. | Ensure stack pointer rsp is 16-byte aligned before function calls. | |
Undefined reference to '_start' | Linker entrypoint missing or global _start not exported. | Declare global _start or compile with gcc -nostartfiles. | |
relocation R_X86_64_32S against ... can not be used | Position-independent executable (PIE) requires RIP-relative addressing. | Use [rel symbol] addressing in NASM. |
References
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/languages/assembly/SKILL.md
Popularity
- Repository stars
- 15
- Repository forks
- 2
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/g1joshi/agent-skills/assembly)