Project

ruby-yasm

0.0
A long-lived project that still receives updates
ruby-yasm provides a Ruby interface to YASM assembler.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0

Runtime

 Project Readme

ruby-yasm

Description

A Ruby interface to YASM.

YASM is a complete rewrite of the NASM assembler, YASM currently supports the x86 and AMD64 instruction sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source debugging information in STABS, DWARF 2, and CodeView 8 formats.

Features

  • Supports all of the yasm command-line options.

Examples

Assemble a binary file:

YASM::Command.run(syntax: :gas, file: 'hello_world.S', output: 'hello_world.o')

Assemble amd64 assembly, in GAS syntax, into an ELF64 file with debugging information:

YASM::Command.run do |yasm|
  yasm.target = :amd64

  yasm.syntax = :gas
  yasm.file   = 'hello_world.S'

  yasm.output        = 'hello_world.o'
  yasm.output_format = :elf64
  yasm.debug_format  = :stabs
end

Requirements

Install

$ gem install ruby-yasm

yasm

  • Debian / Ubuntu:
$ sudo apt install yasm
  • RedHat / Fedora:
$ sudo dnf install yasm
  • Homebrew:
$ brew install yasm

License

See {file:LICENSE.txt} for license information.