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


[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]