pkg/vm/compiler: update README
s/opdump/inspect/ and new sample output.
This commit is contained in:
parent
57c7df4dff
commit
1e09037902
1 changed files with 27 additions and 12 deletions
|
@ -68,24 +68,39 @@ By default the filename will be the name of your .go file with the .avm extensio
|
||||||
You can dump the opcodes generated by the compiler with the following command:
|
You can dump the opcodes generated by the compiler with the following command:
|
||||||
|
|
||||||
```
|
```
|
||||||
./bin/neo-go contract opdump -i mycontract.go
|
./bin/neo-go contract inspect -i mycontract.go
|
||||||
```
|
```
|
||||||
|
|
||||||
This will result in something like this:
|
This will result in something like this:
|
||||||
|
|
||||||
```
|
```
|
||||||
INDEX OPCODE DESC
|
INDEX OPCODE DESC
|
||||||
0 0x52 OpPush2
|
0 0x54 PUSH4
|
||||||
1 0xc5 OpNewArray
|
1 0xc5 NEWARRAY
|
||||||
2 0x6b OpToAltStack
|
2 0x6b TOALTSTACK
|
||||||
3 0x 0 OpPush0
|
3 0x1 PUSHBYTES1
|
||||||
4 0x6c OpFromAltStack
|
3 0x2a *
|
||||||
5 0x76 OpDup
|
5 0x6a DUPFROMALTSTACK
|
||||||
6 0x6b OpToAltStack
|
6 0x0 PUSH0
|
||||||
7 0x 0 OpPush0
|
7 0x52 PUSH2
|
||||||
8 0x52 OpPush2
|
8 0x7a ROLL
|
||||||
9 0x7a OpRoll
|
9 0xc4 SETITEM
|
||||||
10 0xc4 OpSetItem
|
10 0x6a DUPFROMALTSTACK
|
||||||
|
11 0x0 PUSH0
|
||||||
|
12 0xc3 PICKITEM
|
||||||
|
13 0x5a PUSH10
|
||||||
|
14 0xa2 GTE
|
||||||
|
15 0x64 JMPIFNOT
|
||||||
|
16 0x7 7
|
||||||
|
16 0x0 0
|
||||||
|
18 0x51 PUSH1
|
||||||
|
19 0x6c FROMALTSTACK
|
||||||
|
20 0x75 DROP
|
||||||
|
21 0x66 RET
|
||||||
|
22 0x0 PUSH0
|
||||||
|
23 0x6c FROMALTSTACK
|
||||||
|
24 0x75 DROP
|
||||||
|
25 0x66 RET
|
||||||
```
|
```
|
||||||
|
|
||||||
### Test invoke a compiled contract
|
### Test invoke a compiled contract
|
||||||
|
|
Loading…
Reference in a new issue