asm-tag

1.0.1 • Public • Published

asm-tag

A toy ES6 template tag to take assembler and compile it into an executable function. All credit goes to Fedor Indutny and Tommi Pisto for jit.js and pasm, respectively.

'use strict'
 
const asm = require('./lib/asm-tag.js')
 
const fn = asm`
  [bits 64]
  mov rbx, [rbp-16]
  add rax, rbx
`
 
console.log(fn(203, 14))  // 217, if everything went according to plan!

License

MIT

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i asm-tag

    Weekly Downloads

    1

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • chrisdickinson