aboutsummaryrefslogtreecommitdiffstats
path: root/ethvm/vm.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-22 00:15:09 +0800
committerobscuren <geffobscura@gmail.com>2014-08-22 00:15:09 +0800
commita289a77d5de2a2cfa6b38f294b4ab953ebc1bfb8 (patch)
tree987e3213ab37f1c07d0d917a92fe6654ba271a5d /ethvm/vm.go
parent3def9258be3c212bf405502f84654f45b0306543 (diff)
downloadgo-tangerine-a289a77d5de2a2cfa6b38f294b4ab953ebc1bfb8.tar
go-tangerine-a289a77d5de2a2cfa6b38f294b4ab953ebc1bfb8.tar.gz
go-tangerine-a289a77d5de2a2cfa6b38f294b4ab953ebc1bfb8.tar.bz2
go-tangerine-a289a77d5de2a2cfa6b38f294b4ab953ebc1bfb8.tar.lz
go-tangerine-a289a77d5de2a2cfa6b38f294b4ab953ebc1bfb8.tar.xz
go-tangerine-a289a77d5de2a2cfa6b38f294b4ab953ebc1bfb8.tar.zst
go-tangerine-a289a77d5de2a2cfa6b38f294b4ab953ebc1bfb8.zip
DUP n SWAP n
Diffstat (limited to 'ethvm/vm.go')
-rw-r--r--ethvm/vm.go20
1 files changed, 12 insertions, 8 deletions
diff --git a/ethvm/vm.go b/ethvm/vm.go
index ddad0d366..b27417586 100644
--- a/ethvm/vm.go
+++ b/ethvm/vm.go
@@ -600,16 +600,20 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
case POP:
require(1)
stack.Pop()
- case DUP:
- require(1)
- stack.Push(stack.Peek())
+ case DUP1, DUP2, DUP3, DUP4, DUP5, DUP6, DUP7, DUP8, DUP9, DUP10, DUP11, DUP12, DUP13, DUP14, DUP15, DUP16:
+ n := int(op - DUP1 + 1)
+ stack.Dupn(n)
+
+ self.Printf(" => [%d] 0x%x", n, stack.Peek().Bytes())
+ case SWAP1, SWAP2, SWAP3, SWAP4, SWAP5, SWAP6, SWAP7, SWAP8, SWAP9, SWAP10, SWAP11, SWAP12, SWAP13, SWAP14, SWAP15, SWAP16:
+ n := int(op - SWAP1 + 1)
+ x, y := stack.Swapn(n)
- self.Printf(" => 0x%x", stack.Peek().Bytes())
+ self.Printf(" => [%d] %x [0] %x", n, x.Bytes(), y.Bytes())
+ case DUP:
+ // NOP
case SWAP:
- require(2)
- x, y := stack.Popn()
- stack.Push(y)
- stack.Push(x)
+ // NOP
case MLOAD:
require(1)
offset := stack.Pop()