| 74 | } |
| 75 | |
| 76 | func opSdiv(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { |
| 77 | x, y := math.S256(stack.pop()), math.S256(stack.pop()) |
| 78 | res := evm.interpreter.intPool.getZero() |
| 79 | |
| 80 | if y.Sign() == 0 || x.Sign() == 0 { |
| 81 | stack.push(res) |
| 82 | } else { |
| 83 | if x.Sign() != y.Sign() { |
| 84 | res.Div(x.Abs(x), y.Abs(y)) |
| 85 | res.Neg(res) |
| 86 | } else { |
| 87 | res.Div(x.Abs(x), y.Abs(y)) |
| 88 | } |
| 89 | stack.push(math.U256(res)) |
| 90 | } |
| 91 | evm.interpreter.intPool.put(x, y) |
| 92 | return nil, nil |
| 93 | } |
| 94 | |
| 95 | func opMod(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Stack) ([]byte, error) { |
| 96 | x, y := stack.pop(), stack.pop() |