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? : BoolLiteral #

Returns whether the assembly expression requires stack alignment code.


[View source]
def can_throw? : BoolLiteral #

Returns whether the assembly expression might unwind the stack.


[View source]
def clobbers : ArrayLiteral(StringLiteral) #

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


[View source]
def inputs : ArrayLiteral(AsmOperand) #

Returns an array of input operands for this assembly expression.


[View source]
def intel? : BoolLiteral #

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


[View source]
def outputs : ArrayLiteral(AsmOperand) #

Returns an array of output operands for this assembly expression.


[View source]
def text : StringLiteral #

Returns the template string for this assembly expression.


[View source]
def volatile? : BoolLiteral #

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


[View source]