Class: RMasm::Directive

Inherits:
Object show all
Defined in:
lib/rmasm/directive.rb

Overview

A Directive is the root class for

  • data directive (see data)

  • section directive (see section)

  • instruction directive (see instruction)

Direct Known Subclasses

BinaryDirective, Extern, Instruction, Label, Section

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



32
33
34
# File 'lib/rmasm/directive.rb', line 32

def id
  @id
end

Instance Method Details

#fetchObject

Send this directive to the assembler This method can be overriden by a directive in order to fetch several directive to the assembler



36
37
38
39
40
# File 'lib/rmasm/directive.rb', line 36

def fetch()
  return Report.error("Unable to process this directive. You have to specify an assembler first with [use arch] directive (example: use :x86)") if $rmasm.nil?
  $rmasm << self
  self
end