mohitmishra786/low-level-dev-skills/abi-and-calling-conventions
Claude Code and agent skill by mohitmishra786/low-level-dev-skills
- community
Checking that the SKILL.md file is still in the repository.
ABI and calling conventions skill for cross-language boundaries. Use when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Activates on queries about calling convention, ABI, System V AMD64, AAPCS, stack frame, variadic function, or FFI registers.
Install
npx vskill@latest install mohitmishra786/low-level-dev-skills/abi-and-calling-conventionsSKILL.md
ABI and Calling Conventions
Purpose
Document application binary interface (ABI) rules: register roles, stack alignment, argument passing, return values, and variadic conventions across System V AMD64, ARM AAPCS, and RISC-V — essential for assembly, FFI, and debugging.
When to Use
- Writing assembly thunks or inline asm clobbers
- Debugging corrupted stack in mixed C/asm
- FFI between Rust/C/Zig (
skills/rust/rust-ffi,skills/zig/zig-cinterop) - Reading disassembly from
skills/debuggers/gdb
Workflow
1. System V AMD64 (Linux/macOS)
| Item | Rule | |
|---|---|---|
| Integer args | rdi, rsi, rdx, rcx, r8, r9 | |
| XMM args | xmm0–xmm7 (float) | |
| Return int/ptr | rax (+ rdx for 128-bit) | |
| Stack alignment | 16-byte before call | |
| Red zone | 128 bytes below rsp (Linux) | |
| Callee-saved | rbx, rbp, r12–r15 |
Windows x64 differs — see skills/compilers/msvc-cl.
2. ARM AAPCS (AArch32/AArch64)
AArch64:
| Item | Rule | |
|---|---|---|
| Integer args | x0–x7 | |
| Float args | v0–v7 | |
| Return | x0/x1 or v0 | |
| Stack align | 16-byte | |
| Callee-saved | x19–x28, fp (x29), lr (x30) |
Thumb interworking: LSB of function pointer set for Thumb code.
See skills/low-level-programming/assembly-arm.
3. RISC-V psABI (RV64)
| Item | Rule | |
|---|---|---|
| Integer args | a0–a7 | |
| Callee-saved | s0–s11, sp | |
| Return | a0, a1 | |
| Stack align | 16-byte |
See skills/low-level-programming/assembly-riscv.
4. Stack frame layout (conceptual)
5. Variadic functions
System V: al holds number of vector args used; register_save_area on stack for va_start. Prefer typed wrappers over raw va_arg in portable FFI.
6. Verify in compiler output
7. Agent usage
Common Problems
| Symptom | Cause | Fix | |
|---|---|---|---|
Crash on call | Stack misaligned | Align rsp mod 16 | |
| Wrong float arg | XMM vs GPR mismatch | Match prototype | |
| Corrupt callee-saved | Asm clobber missing | List in clobber or save | |
| FFI garbage | Windows vs SysV mix | Match toolchain ABI | |
| Variadic UB | Wrong type to va_arg | Cast to promoted type |
Related Skills
skills/low-level-programming/assembly-x86— x86-64 asmskills/low-level-programming/assembly-arm— AAPCS examplesskills/low-level-programming/assembly-riscv— RISC-V asmskills/rust/rust-ffi—extern "C"guaranteesskills/binaries/elf-inspection— symbol and relocation views
Security
- Security scanPassed, 95 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/computer-architecture/abi-and-calling-conventions/SKILL.md
Popularity
- Repository stars
- 237
- Repository forks
- 28
- 7-day trend score
- 27
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
- 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/mohitmishra786/low-level-dev-skills/abi-and-calling-conventions)