summaryrefslogtreecommitdiff
path: root/vm/opcodes.go
blob: b3d4229d153f940c54130cbb0e9c391aaba67e54 (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package main

type Opcode byte

const (
	STOP = iota
	ADD 
	MUL
	SUB
	DIV
	SDIV
	MOD
	SMOD
	ADDMOD
	MULMOD
	POP = 0x50
	MLOAD = 0x51
	MSTORE = 0x52
	MSTORE8 = 0x53
	PUSH1 = 0x60
	PUSH2 = 0x61
	PUSH3 = 0x62
	PUSH4 = 0x63
	PUSH5 = 0x64
	PUSH6 = 0x65
	PUSH7 = 0x66
	PUSH8 = 0x67
	PUSH9 = 0x68
	PUSH10 = 0x69
	PUSH11 = 0x6a
	PUSH12 = 0x6b
	PUSH13 = 0x6c
	PUSH14 = 0x6d 
	PUSH15 = 0x6e
	PUSH16 = 0x6f
	PUSH17 = 0x70
	PUSH18 = 0x71
	PUSH19 = 0x72
	PUSH20 = 0x73
	PUSH21 = 0x74
	PUSH22 = 0x75
	PUSH23 = 0x76
	PUSH24 = 0x77
	PUSH25 = 0x78
	PUSH26 = 0x79
	PUSH27 = 0x7a
	PUSH28 = 0x7b
	PUSH29 = 0x7c
	PUSH30 = 0x7d
	PUSH31 = 0x7e
	PUSH32 = 0x7f
	//...
) 

func (op *Opcode) String() string {
	return Instructions[*op].name
}