Class: YASM::Program

Inherits:
RProgram::Program
  • Object
show all
Defined in:
lib/yasm/program.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.assemble(options = {}, exec_options = {}) {|task| ... } ⇒ Boolean

Finds the yasm program and assembles a file.

Examples:

Program.assemble(
  :parser => :gas,
  :output => 'code.o',
  :file   => 'code.S'
)
Program.assemble do |yasm|
  yasm.target! :x86

  yasm.syntax = :gas
  yasm.file   = 'code.S'
  yasm.output = 'code.o'
end

Parameters:

  • options (Hash{Symbol => Object}) (defaults to: {})

    Additional options for yasm.

  • exec_options (Hash{Symbol => Object}) (defaults to: {})

    Additional exec-options.

Yields:

  • (task)

    If a block is given, it will be passed a task object used to specify options for yasm.

Yield Parameters:

  • task (Task)

    The yasm task object.

Returns:

  • (Boolean)

    Specifies whether the command exited normally.

See Also:



47
48
49
# File 'lib/yasm/program.rb', line 47

def self.assemble(options={},exec_options={},&block)
  find.assemble(options,exec_options,&block)
end

Instance Method Details

#assemble(options = {}, exec_options = {}) {|task| ... } ⇒ Boolean

Assembles an assembly file.

Examples:

Program.assemble(
  :parser => :gas,
  :output => 'code.o',
  :file   => 'code.S'
)
Program.assemble do |yasm|
  yasm.target! :x86

  yasm.syntax = :gas
  yasm.file   = 'code.S'
  yasm.output = 'code.o'
end

Parameters:

  • options (Hash{Symbol => Object}) (defaults to: {})

    Additional options for yasm.

  • exec_options (Hash{Symbol => Object}) (defaults to: {})

    Additional exec-options.

Yields:

  • (task)

    If a block is given, it will be passed a task object used to specify options for yasm.

Yield Parameters:

  • task (Task)

    The yasm task object.

Returns:

  • (Boolean)

    Specifies whether the command exited normally.

See Also:



89
90
91
# File 'lib/yasm/program.rb', line 89

def assemble(options={},exec_options={},&block)
  run_task(Task.new(options,&block),exec_options)
end