AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Abi And Calling Conventions

skill-mohitmishra786-low-level-dev-skills-abi-and-calling-conventions · by mohitmishra786

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.

No reviews yet
0 installs
6 views
0.0% view→install

Install

$ agentstack add skill-mohitmishra786-low-level-dev-skills-abi-and-calling-conventions

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-mohitmishra786-low-level-dev-skills-abi-and-calling-conventions)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Abi And Calling Conventions? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

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 | xmm0xmm7 (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 |

/* void foo(int a, int b, int c, int d, int e, int f, int g); */
/* a–f in regs, g on stack */

Windows x64 differs — see skills/compilers/msvc-cl.

2. ARM AAPCS (AArch32/AArch64)

AArch64:

| Item | Rule | |------|------| | Integer args | x0x7 | | Float args | v0v7 | | Return | x0/x1 or v0 | | Stack align | 16-byte | | Callee-saved | x19x28, 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 | a0a7 | | Callee-saved | s0s11, sp | | Return | a0, a1 | | Stack align | 16-byte |

See skills/low-level-programming/assembly-riscv.

4. Stack frame layout (conceptual)

high addresses
├── return address
├── saved frame pointer
├── local variables
├── spill slots / alignment padding
└── outgoing args (if any)
low addresses (rsp)

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

gcc -O2 -S -o - foo.c   # study .cfi_* and mov args
objdump -d -M intel ./a.out

7. Agent usage

/abi-and-calling-conventions Which registers hold args 5–8 in AArch64 for my C function?

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 asm
  • skills/low-level-programming/assembly-arm — AAPCS examples
  • skills/low-level-programming/assembly-riscv — RISC-V asm
  • skills/rust/rust-ffiextern "C" guarantees
  • skills/binaries/elf-inspection — symbol and relocation views

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.