Git Product home page Git Product logo

asm2plan9s's Introduction

asm2plan9s

Tool to generate BYTE sequences for Go assembly as generated by YASM.

Installation

Make sure YASM is installed on your platform. Get the code and compile with go install.

Example

$ more example.s
                                 // VPADDQ  XMM0,XMM1,XMM8
$ asm2plan9s example.s
$ echo example.s
    LONG $0xd471c1c4; BYTE $0xc0 // VPADDQ  XMM0,XMM1,XMM8

The instruction to be assembled needs to start with a // preceded by either a single space The preceding characters will be overwitten by the correct sequence (irrespective of its contents) so when changing the instruction, rerunning asm2plan9s will update the BYTE sequence generated.

Starting position of instruction

The starting position of the // comment needs to follow the (imaginary) sequence with either a single space or a space followed by a back slash plus another space (see support for defines below). Upon first entering an instruction you can type eg LONG $0x00000000; BYTE $0x00 // VZEROUPPER to trigger the assembler.

Support for defines

If you are using #define for 'macros' with the back-slash delimiter to continue on the next line, this will be preserved.

For instance:

                                 \ // VPADDQ  XMM0,XMM1,XMM8

will be assembled into

    LONG $0xd471c1c4; BYTE $0xc0 \ // VPADDQ  XMM0,XMM1,XMM8

asmfmt

asm2plan9s works nicely together with asmfmt in order to format the assembly code (in a similar style to go fmt).

Extensive example

For a more extensive example see compressAvx_amd64.s

License

Released under the Apache License v2.0. You can find the complete text in the file LICENSE.

Contributing

Contributions are welcome, please send PRs for any enhancements.

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.