Class: YASM::Program Deprecated

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

Overview

Deprecated.

Please use Command instead.

Constant Summary

Constants inherited from Command

Command::TARGETS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

#target, #target=

Class Method Details

.assemble(options = {}) {|program| ... } ⇒ 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.

Yields:

  • (program)

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

Yield Parameters:

  • program (Program)

    The yasm program object.

Returns:

  • (Boolean)

    Specifies whether the command exited normally.

See Also:



45
46
47
# File 'lib/yasm/program.rb', line 45

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

Instance Method Details

#assemble(options = {}) {|program| ... } ⇒ 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.

Yields:

  • (program)

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

Yield Parameters:

  • program (Program)

    The yasm program object.

Returns:

  • (Boolean)

    Specifies whether the command exited normally.



81
82
83
84
85
86
87
88
89
# File 'lib/yasm/program.rb', line 81

def assemble(options={})
  options.each do |name,value|
    self[name] = value
  end

  yield self if block_given?

  run_command()
end

#target!(name) ⇒ Object

Deprecated.

Please use Command#target= instead.



94
95
96
97
# File 'lib/yasm/program.rb', line 94

def target!(name)
  self.target = name
  return true
end