Agent skill · research science · mohitmishra786

abi-and-calling-conventions

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.

Why this skill is useful

Provides detailed ABI rules and calling conventions for multiple architectures that the AI wouldn't reliably generate on its own.

What it needs

About 2k tokens when loaded. Last updated 2026-06-27. 156 stars on the source repository.

What this skill does

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; registersavearea on stack for vastart. Prefer typed wrappers over raw vaarg in portable FFI. 6. Verify in compiler output 7. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills mohitmishra786/abi-and-calling-conventions

View the source on GitHub

Browse the @skills marketplace