opcode1Add treats the top item on the data stack as an integer and replaces it with its incremented value (plus 1). Stack transformation: [... x1 x2] -> [... x1 x2+1]
(op *opcode, data []byte, vm *Engine)
| 1428 | // |
| 1429 | // Stack transformation: [... x1 x2] -> [... x1 x2+1] |
| 1430 | func opcode1Add(op *opcode, data []byte, vm *Engine) error { |
| 1431 | m, err := vm.dstack.PopInt() |
| 1432 | if err != nil { |
| 1433 | return err |
| 1434 | } |
| 1435 | |
| 1436 | vm.dstack.PushInt(m + 1) |
| 1437 | return nil |
| 1438 | } |
| 1439 | |
| 1440 | // opcode1Sub treats the top item on the data stack as an integer and replaces |
| 1441 | // it with its decremented value (minus 1). |