asm-guidance

Guide safe inline assembly usage in UMRS Rust projects.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/jamieadams-nerd/umrs-project --skill asm-guidance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: asm-guidance
Source: https://github.com/jamieadams-nerd/umrs-project/tree/main/.claude/jamies_brain/archive/asm
Command: npx skills add https://github.com/jamieadams-nerd/umrs-project --skill asm-guidance

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides detailed guidance on when and how to write inline assembly in Rust for UMRS projects. Use this skill to prevent unsafe ASM usage and to ensure safe, verifiable integration with core::arch intrinsics.

Core Features & Use Cases

  • Step 1 — Check core::arch first
  • Step 2 — Verify CPU feature availability
  • Step 3 — When raw asm! is genuinely required
  • Step 4 — options() selection guide
  • Step 5 — Verification before committing

Quick Start

Review the core::arch alternatives, verify CPU features, and then only use raw asm! with full safety documentation.

Frequently Asked Questions about asm-guidance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
When do I need inline assembly in Rust projects?

Inline assembly in Rust is needed when you require low-level CPU control that core::arch intrinsics cannot provide. You should use it only after verifying that no portable intrinsic alternative exists for your specific hardware operation.

How do I safely use asm! blocks in Rust?

To safely use asm! blocks in Rust, apply safety gating by checking core::arch first, verifying CPU feature availability, and documenting your raw assembly blocks with provided templates before committing.

Should I use core::arch intrinsics or raw asm! in Rust?

You should use core::arch intrinsics in Rust whenever possible because they provide safe, verifiable access to CPU features. Raw asm! blocks are a last resort when no intrinsic covers your specific instruction set requirement.

How do I select the right options() for Rust inline assembly?

Selecting the right options() for Rust inline assembly involves using a dedicated selection guide to configure compiler constraints. This ensures your asm! block interacts safely with the compiler's register and memory allocation.

What are the limitations of using global_asm! in Rust?

global_asm! in Rust bypasses many compiler safety checks and requires strict safety gating. You must verify CPU feature availability and document the block fully before introducing raw global assembly into your project.

Can I use Rust inline assembly without checking CPU features?

You cannot safely use Rust inline assembly without verifying CPU feature availability. Checking target CPU support is a required step to prevent runtime crashes and ensure your core::arch intrinsics or asm! blocks execute correctly.