tycho-asm 0.2.5

Rust implementation of TVM Assembler
Documentation
// Single-line comments

// Opcodes must be in uppercase, can start with a digit or minus,
// and can contain '#' or '_'
NOP
2DROP
-ROT
STREF_L

// Opcodes with number as an argument
PUSHINT 12
PUSHINT -0xded
PUSHINT 0b10110101

// Opcodes with stack register as an argument
PUSH s1
XCHG s10, s100
PU2XC s1, s(-1), s(-2)

// Opcodes with control registers (c0, .., c5, c7)
PUSH c3
PUSHCTR c7

// Opcodes with slice or continuation
PUSHSLICE x{123123_}
PUSHSLICE b{10001001}
IFREFELSEREF {
  PUSHINT 1
}, {
  PUSHINT 2
}
// Insert raw slices into code
@inline x{a924}

@inline x{a924}

PUSHINT @method(get_name)

DICTPUSHCONST 19, [
  10 => {
    NOP
  }
]

PUSHREF @{0000000000000000000000000000000000000000000000000000000000000000}

PUSHREF te6ccgEBAQEAAgAAAA==


@define(simpleProg) {
  SETCP 0
  DICTPUSHCONST 19, [
      0 => {
          DUP
          CALLDICT 22
          INC
      }
      22 => {
          MUL
      }
  ]
  DICTIGETJMPZ
  THROWARG 11
}

INT 10 INT 0 INT 2 SLICE @use(simpleProg) RUNVM 1
INT 10 INT 0 INT 2 SLICE @use(simpleProg) RUNVM 0