Giter Site home page Giter Site logo

streamich / ass-js Goto Github PK

View Code? Open in Web Editor NEW
133.0 12.0 14.0 1.2 MB

Assembler.js — X86_64 and Ethereum

Home Page: https://www.npmjs.com/package/ass-js

License: The Unlicense

JavaScript 1.11% TypeScript 97.36% Assembly 1.50% CoffeeScript 0.03%
assembler asm x86-64 ethereum

ass-js's Introduction

(‿*‿)
Assembler.js

Assembler implemented in JavaScript:

Install

npm i ass-js

Getting Started

Store 0xBABE in RAX register

import {X64} from 'ass-js';

const asm = X64();
asm._('mov', ['rax', 0xBABE]);

Compile to machine code

console.log(code.compile()); // <Buffer 48 c7 c0 be ba 00 00>

Show text representation

console.log(String(code));
// 000 main:
// 001   movq rax, 0x0000BABE ; 000000|000000 0x48, 0xC7, 0xC0, 0xBE, 0xBA, 0x00, 0x00 7 bytes

Use templates

const template = _ => {
    _('mov', ['rdx', 0xC001]);
    _('mov', ['rax', 0xBABE]);
};

asm.code(template);

Docs

License

Unlicense — public domain.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.