Git Product home page Git Product logo

evmasm's Introduction

 ____  _____    _    ____  __  __ _____ 
|  _ \| ____|  / \  |  _ \|  \/  | ____|
| |_) |  _|   / _ \ | | | | |\/| |  _|  
|  _ <| |___ / ___ \| |_| | |  | | |___ 
|_| \_\_____/_/   \_\____/|_|  |_|_____|

The contents of the assembly source file should be enclosed in parentheses, like so:

(
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; Comments work pretty much the same way they do in Lisp.  ;;
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
  push #xdeadbeef ;; EVMASM provides an implicitly-typed push instruction
  push1 #x01      ;; But you can use explict typing if you like.
  add             ;; Everything is cast into 256bit ints on the stack.
)

Comments may be included, and must be prefixed with semicolons.

This script should work fine with CLISP, SBCL, or CCL implementations of Common Lisp. You'll just need to change the shebang line.

Numerical literals are base-10, by default. Prefix with '#x' for hexadecimal.

Literal strings may be used as arguments to the PUSH operations. They will be converted to bytes, via ASCII encoding. Strings used in this way should not be more than 32 bytes long.

Generic PUSH operations are supported, without an explicit length suffix. If no length suffix is given, it will be calculated as

(1) (min 32 (ash (ceiling (log ARGUMENT 2)) -3)) if the argument is an integer, or

(2) (min 32 (length ARGUMENT)) if the argument is a string.

"GOTO labels" are supported, as arbitrary symbols preceded by a colon, :like_so. When processed, they will be replaced with JUMPDEST instructions, and references to them will be dereferenced to the corresponding position in the code. Note that JUMP does not take a literal argument, but draws its argument, instead, from the stack, so instead of JUMP :foo, use

  PUSH :foo
  JUMP
Usage: evmasm.lisp <src> [-o out] [-d|-a]
Options:
-o <out>  designate output path
-d        disassemble
-a        assemble [default]

evmasm's People

Watchers

James Cloos avatar Olivia Lucca Fraser avatar  avatar

Forkers

clflush

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.