W3cubDocs

/Crystal

class Crystal::Macros::Asm

Overview

An inline assembly expression.

Every assembly node is equivalent to:

asm(
  {{ node.text }} :
  {{ node.outputs.splat }} :
  {{ node.inputs.splat }} :
  {{ node.clobbers.splat }} :
  {% if node.volatile? %} "volatile", {% end %}
  {% if node.alignstack? %} "alignstack", {% end %}
  {% if node.intel? %} "intel", {% end %}
  {% if node.can_throw? %} "unwind", {% end %}
)

Defined in:

compiler/crystal/macros.cr

Instance Method Summary

Instance Method Detail

def alignstack? : BoolLiteralSource

Returns whether the assembly expression requires stack alignment code.

def can_throw? : BoolLiteralSource

Returns whether the assembly expression might unwind the stack.

def clobbers : ArrayLiteral(StringLiteral)Source

Returns an array of clobbered register names for this assembly expression.

def inputs : ArrayLiteral(AsmOperand)Source

Returns an array of input operands for this assembly expression.

def intel? : BoolLiteralSource

Returns true if the template string uses the Intel syntax, false if it uses the AT&T syntax.

def outputs : ArrayLiteral(AsmOperand)Source

Returns an array of output operands for this assembly expression.

def text : StringLiteralSource

Returns the template string for this assembly expression.

def volatile? : BoolLiteralSource

Returns whether the assembly expression contains side effects that are not listed in #outputs, #inputs, and #clobbers.

© 2012–2026 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/1.19.0/Crystal/Macros/Asm.html