Crystal::Macros::Asm - Crystal 1.16.3

# class Crystal::Macros::Asm

- Crystal::Macros::Asm
- Crystal::Macros::ASTNode

##
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

- #alignstack? : BoolLiteral

  Returns whether the assembly expression requires stack alignment code.

- #can_throw? : BoolLiteral

  Returns whether the assembly expression might unwind the stack.

- #clobbers : ArrayLiteral(StringLiteral)

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

- #inputs : ArrayLiteral(AsmOperand)

  Returns an array of input operands for this assembly expression.

- #intel? : BoolLiteral

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

- #outputs : ArrayLiteral(AsmOperand)

  Returns an array of output operands for this assembly expression.

- #text : StringLiteral

  Returns the template string for this assembly expression.

- #volatile? : BoolLiteral

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

### Instance methods inherited from class `Crystal::Macros::ASTNode`

!=(other : ASTNode) : BoolLiteral !=, ==(other : ASTNode) : BoolLiteral ==, class_name : StringLiteral class_name, column_number : StringLiteral | NilLiteral column_number, doc : StringLiteral doc, doc_comment : MacroId doc_comment, end_column_number : StringLiteral | NilLiteral end_column_number, end_line_number : StringLiteral | NilLiteral end_line_number, filename : StringLiteral | NilLiteral filename, id : MacroId id, is_a?(type : TypeNode) : BoolLiteral is_a?, line_number : StringLiteral | NilLiteral line_number, nil? : BoolLiteral nil?, raise(message) : NoReturn raise, stringify : StringLiteral stringify, symbolize : SymbolLiteral symbolize, warning(message : StringLiteral) : NilLiteral warning

##
Instance Method Detail

def alignstack? : BoolLiteral #

Returns whether the assembly expression requires stack alignment code.

def can_throw? : BoolLiteral #

Returns whether the assembly expression might unwind the stack.

def clobbers : ArrayLiteral(StringLiteral) #

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

def inputs : ArrayLiteral(AsmOperand) #

Returns an array of input operands for this assembly expression.

def intel? : BoolLiteral #

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

def outputs : ArrayLiteral(AsmOperand) #

Returns an array of output operands for this assembly expression.

def text : StringLiteral #

Returns the template string for this assembly expression.

def volatile? : BoolLiteral #

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