all repos — min @ 8b12c40913b7ce7ab4c1ec7aa2512817ac0d53d3

A small but practical concatenative programming language.

minpkg/core/opcodes.nim

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42

type MinOpCode* = enum
  opUndef = 0x00   # Undefined
  #### Header
  opHead = 0x01    # Header
                   # 9 bytes in total
                   # language: 3
                   # version:  3
                   # bytecode: 1
                   # undefined:2

  #### Start
  opStart = 0x02   # Program start

  #### Literal Values
  opPushIn = 0x11  # Push integer value
                   # value:    8
  opPushFl = 0x12  # Push float value
                   # value:    8
  opPushNl = 0x13  # Push null value
  opPushTr = 0x14  # Push true value
  opPushFa = 0x15  # Push false value
  opStrBeg = 0x16  # Begin string
  OpStrEnd = 0x17  # End String
  OpQuotBeg = 0x18 # Begin quotation
  OpQuotEnd = 0x19 # End quotation
  OpDictBeg = 0x1A # Begin dictionary
                   # typelength: 2
                   # typevalue: ...
  OpDictEnd = 0x1B # End dictionary
  OptCmdBeg = 0x1C # Begin command
  OptCmdEnd = 0x1D # End command

  #### Symbols
  opSym = 0x20     # Push symbol
                   # length: 2
                   # value: ...
  #### Stop
  opStop = 0xFF    # Program stop